Commit Graph

398 Commits

Author SHA1 Message Date
Andrea Luzzardi
5b7b1cab79 Migrate dagger.#Secret and dagger.#Stream to new format
- Refactored to keep every transformation of built-in types (e.g. FS,
  Secret, etc) to/from CUE in the same place (plancontext)
- dagger.#Service and dagger.#Secret are now following the new FS-like format
  (e.g. `_service: id: string`)
- Backward compatibility
- dagger.#Stream is now an alias for dagger.#Service

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-12-01 17:33:35 -08:00
Andrea Luzzardi
0aea10d23e dagger.#FS support
- Implement dagger.#FS support
- Migrate `context.imports` to dagger.#FS
- Backward compat: dagger.#FS can be passed in lieu of a
  dagger.#Artifact
- For instance, an import (`dagger.#FS`) can be passed to the current
  `yarn.#Package` implementation

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-11-30 12:58:50 -08:00
Andrea Luzzardi
6bedfb7c63
Merge pull request #1162 from aluzzardi/europa-context
europa: new execution engine and #Plan support
2021-11-29 16:14:14 -08:00
Andrea Luzzardi
2a4db167e4 runtime: new execution engine
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-11-24 16:51:52 -08:00
Sam Alba
399a7aba30
Merge pull request #1158 from grouville/http-wait
http.#Wait package implementation
2021-11-24 14:25:46 -08:00
guillaume
475e47de09 Modify getting started doc to integrate http.#Wait, fix doc dependency issue
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-11-23 21:30:03 +01:00
guillaume
84952b1725 Add tests for http.#Wait
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-11-23 19:24:00 +01:00
guillaume
6ce8731d69 Fix infinite loop issue on container healthcheck
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-11-23 19:22:19 +01:00
guillaume
ec3c39aea0 Implement http.#Wait to wait for a URL to be ready. It creates a dependency in the Cue tree
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-11-23 18:33:28 +01:00
Alvise88
656d6beb31 Fix typo in docker command
Signed-off-by: Alvise88 <vitalvise@gmail.com>
2021-11-19 15:56:17 -08:00
Andrea Luzzardi
22fb91548b test: docker-run-ports: fix sandbox escaping of dagger stream
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-11-19 11:29:38 -08:00
Andrea Luzzardi
a61e8dcb62 prepare the transition to #Plan.context
This change helps the transition between `dagger input` and `#Plan.context`.

In summary, the codebase now relies on a *context* for execution with mapping to *IDs*.
In the future, *context* will come from a `#Plan.context`.
In the meantime, a bridge converts `dagger input` to a plan context. This allows both *old* and *new* style configurations to co-exist with the same underlying engine.

- Implement `plancontext`. Context holds the execution context for a plan. Currently this includes the platform, local directories, secrets and services (e.g. unix/npipe).
- Contextual data can be registered at any point. In the future, this will be done by `#Plan.context`
- Migrated the `dagger input` codebase to register inputs in a `plancontext`
- Migrated low-level types/operations to the *Context ID* pattern.
  - `dagger.#Stream` now only includes an `id` (instead of `unix` path)
  - `dagger.#Secret` still includes only an ID, but now it's based off `plancontext`
  - `op.#Local` now only includes an `id` (instead of `path`, `include`, `exclude`.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-11-19 11:29:38 -08:00
Sam Alba
7450c70214 mod/stdlib: attempt to remove the lock file after file unlock
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-17 16:23:23 -08:00
Andrea Luzzardi
8ffee8922e
Merge pull request #1112 from samalba/windows-input-stream
Add support for Windows named pipe as Input stream
2021-11-08 18:06:50 -08:00
Sam Alba
ace8ea26f1 stdlib: lock when vendoring to avoid race conditions
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-08 17:29:56 -08:00
Sam Alba
e6de59a340 added support for stream type npipe (Windows named pipe)
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-08 17:16:38 -08:00
Sam Alba
a4761c0f64 stdlib/docker: #Run do not fail if container exists and recreate is false
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-02 15:09:15 -07:00
Sam Alba
72723c4ca7 stdlib/docker: #Run checks if the container exists and can optionnally recreate it
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-02 11:41:53 -07:00
Tom Chauveau
faf2b76bcb
Fix argoCD timeout in universe test
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-11-02 13:34:42 +01:00
Sam Alba
564ad09d2b
Merge pull request #1066 from slumbering/universe-http
create http universe package
2021-10-29 09:55:59 -07:00
guillaume
3fb03cd2d7 Fix packages + Implement working tests
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-10-29 01:29:55 +02:00
guillaume
8f6b3e95a8 Fix lint issues
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-10-28 17:58:18 +02:00
jffarge
40f132b77b Execute os file before Atoi execution
Signed-off-by: jffarge <slumbering.pierrot@gmail.com>
2021-10-28 17:20:41 +02:00
jffarge
0e3ca30189 remove comments
Signed-off-by: jffarge <slumbering.pierrot@gmail.com>
2021-10-28 17:20:41 +02:00
jffarge
04781f4e07 add more args for http container test
Signed-off-by: jffarge <slumbering.pierrot@gmail.com>
2021-10-28 17:20:41 +02:00
jffarge
b94b8c0c70 create http universe package
Signed-off-by: jffarge <slumbering.pierrot@gmail.com>
2021-10-28 17:20:41 +02:00
guillaume
701be92dad Implement #Image
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-10-28 15:52:20 +02:00
guillaume
aac70c2f17 Implement Trivy Config && Trivy CLI
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-10-28 15:52:20 +02:00
jffarge
541d1a7032 init trivy universe
Signed-off-by: jffarge <slumbering.pierrot@gmail.com>
2021-10-28 15:52:20 +02:00
Sam Alba
428aca1c03
Merge pull request #1070 from jhult/cue-repo-link
Link to new CUE GitHub repository
2021-10-20 17:39:05 -07:00
Andrea Luzzardi
d01940b9a1 debug
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-20 13:10:11 -07:00
Jonathan Hult
d0e7d9b564
Link to new CUE GitHub repository
https://github.com/cue-lang/cue/issues/1078

Signed-off-by: Jonathan Hult <Jonathan@JonathanHult.com>
2021-10-20 14:49:26 -04:00
Andrea Luzzardi
c08f619b02 Fix local directory error handling
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-20 11:38:42 -07:00
Sam Alba
aa491ae67c
Merge pull request #1049 from PaulBarrie/feature/aws/add-cli-v2
Feature:  allow to use AWS CLI v2
2021-10-18 20:48:21 -07:00
guillaume
de8cd3a52a Add secrets for secure mount of .env local files inside Dagger
Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2021-10-14 13:34:58 +02:00
Andrea Luzzardi
322997b74a stdlib: docker: clean up docker.#Command inputs
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-12 17:10:46 -07:00
Andrea Luzzardi
b2c4fea73d tests: add docker load test
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-12 15:39:04 -07:00
Andrea Luzzardi
50d55a8885 op.#SaveImage: export the image ID
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-12 15:39:04 -07:00
Andrea Luzzardi
5a1d4bff62 Support loading artifacts into a Docker Engine
This adds support to loading artifacts (e.g. docker.#Build,
os.#Container, ...) into any arbitrary docker engine (through a
dagger.#Stream for UNIX sockets or SSH for a remote engine)

Implementation:
- Add op.#SaveImage which serializes an artifact into an arbitrary path
  (docker tarball format)
- Add docker.#Load which uses op.#SaveImage to serialize to disk and
  executes `docker load` to load it back

Caveats: Because we're doing this in userspace rather than letting
dagger itself load the image, the performance is pretty bad.

The buildkit API is meant for streaming (get a stream of a docker image
pipe it into docker load). Because of userspace, we have to load the
entire docker image into memory, then serialize it in a single WriteFile
LLB operation.

Example:

```cue
package main

import (
	"alpha.dagger.io/dagger"
	"alpha.dagger.io/docker"
)

source: dagger.#Input & dagger.#Artifact

dockersocket: dagger.#Input & dagger.#Stream

build: docker.#Build & {
	"source": source
}

load: docker.#Load & {
	source: build
	tag:    "testimage"
	socket: dockersocket
}
```

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-12 14:16:01 -07:00
paulb
7d9db41f4b feat: allow use of v2 AWS CLI
Signed-off-by: paulb <barrie.paul@protonmail.com>
2021-10-08 17:43:54 +02:00
Andrea Luzzardi
dd1bf18ec2 logger: TTY logs support (live update)
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-05 15:38:34 -07:00
Guillaume de Rouville
ce02caff51 Improve/git: Git.#Repository's origin now uses the provided URL
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
2021-10-04 16:45:34 +02:00
Richard Jones
4a21475b1e
one last var needed quotes
Signed-off-by: Richard Jones <richard@dagger.io>
2021-09-28 10:00:26 -06:00
Richard Jones
d63ac607a4
added quotes to fix GHA
Signed-off-by: Richard Jones <richard@dagger.io>
2021-09-28 09:52:49 -06:00
Richard Jones
d496b77c71
added test for docker run with ports
Signed-off-by: Richard Jones <richard@dagger.io>
2021-09-28 09:33:02 -06:00
Richard Jones
c04ef323d2
cue fmt
Signed-off-by: Richard Jones <richard@dagger.io>
2021-09-27 20:40:55 -06:00
Richard Jones
9f16bcdadb added ports to docker.#Run
Signed-off-by: Richard Jones <richard@dagger.io>
2021-09-27 20:39:28 -06:00
Sam Alba
9c32c8a564
Merge pull request #1010 from talentedmrjones/rename-workspace-flag
Rename workspace to project including flag, references, and tests
2021-09-23 16:01:26 -07:00
Sam Alba
b5f2f65bfd
Merge pull request #1008 from grouville/fix/netlify
Fix/Netlify package: reinsert always:true
2021-09-23 15:31:44 -07:00
Sam Alba
e757af6706
Merge pull request #980 from VazeeKevin/tasks/docker-args-secrets
Add #Secret type to Docker #Build args
2021-09-23 15:31:03 -07:00