Commit Graph

179 Commits

Author SHA1 Message Date
Solomon Hykes
e6e8ab390d Rename "deployment" to "environment": code
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-27 13:59:27 -07:00
Sam Alba
520030d4ee fixed tests creds + added authprovider to client solver
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-26 18:00:31 -07:00
Sam Alba
45ecc32423 implemented docker-login op to add custom registry credentials to the buildkit from a pipeline
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-26 17:40:51 -07:00
Tom Chauveau
907430d409 Fix Subdir op
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-24 19:31:36 +02:00
Andrea Luzzardi
2b7dfcae29 Revert "support registry auth"
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-23 16:59:22 -07:00
Andrea Luzzardi
d77c6f46ff
Merge pull request #342 from verdverm/scan-for-inputs
add cmd/input/list to scan a plan for inputs
2021-04-22 18:41:23 -07:00
Tony Worm
6488d41603 add cmd/input/list to scan a plan for inputs
Signed-off-by: Tony Worm <tony@hofstadter.io>
2021-04-22 17:39:36 -04:00
Andrea Luzzardi
8cadd97c60
Merge pull request #344 from aluzzardi/registry-auth
support registry auth
2021-04-22 12:14:59 -07:00
Sam Alba
d000b2912b
Merge pull request #338 from dagger/pushcontainer-image-ref
Pushcontainer image ref
2021-04-22 11:49:35 -07:00
Sam Alba
6e16207221 pipeline: better error handling on WriteFile
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-22 09:43:45 -07:00
Andrea Luzzardi
692bd72095 support registry auth
HACK: the way buildkit works, we can only supply an Auth Provider for the entirety of the build session (`dagger up`). Therefore, we start by scanning all auth in the entire Cue tree and supply an auth provider for all of them.

Drawbacks:
- As soon as you add `auth` in a Pipeline for a registry, all other Pipelines have access to the same registry
- You can't use different credentials for the same registry

Fixes #301

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-20 15:28:33 -07:00
Sam Alba
6818659c14 op: push-container stores metadata on fs, under /dagger/
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-16 16:18:33 -07:00
Andrea Luzzardi
84f914216d
Merge pull request #331 from dagger/fix-double-exec
Fixed duplicated execution on `op.#Exec.always: true`
2021-04-15 13:09:00 -07:00
Sam Alba
d8a632064b removed dead code
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 12:37:17 -07:00
Sam Alba
468ac1220a added comment about always flag + cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 12:34:15 -07:00
Sam Alba
f4c712e373 pipeline: implemented op.#Exec.always correctly
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 12:09:01 -07:00
Sam Alba
075fbbf3d5 pipeline: forward the no-cache option to the dockerbuild frontend
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 11:26:01 -07:00
Sam Alba
9ffe5c053c solver: fixed lint error (double import)
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-14 16:27:15 -07:00
Sam Alba
83f56897a7 solver/client: add ability to disable the cache at the LLB level
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-14 16:21:18 -07:00
Andrea Luzzardi
bb5542e26e Proper support for Docker Image metadata
- Both FetchContainer and DockerBuild read the image metadata and
  convert to LLB (e.g. `ENV foo bar` in Dockerfile shows up in
  `op.#Exec`)
- Image metadata is "sticky" between Pipelines (e.g. `op.#Load` will
  re-use the same metadata)
- Image metadata is injected back to #PushContainer, so that
  DockerBuild+PushContainer and FetchContainer+PushContainer do not lose
  any metadata.
- Tests for all the above

Fixes #142

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-12 17:47:58 -07:00
Andrea Luzzardi
0fa8e18d81
Merge pull request #305 from fkautz/pr_out_add_support_for_input_file_in_dagger_compute
Add support for input file in dagger compute
2021-04-12 10:42:33 -07:00
Frederick F. Kautz IV
e595e1d833 variables shouldn't shadow packages
Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
2021-04-11 16:30:48 -07:00
Frederick F. Kautz IV
0458c0a838 * add support for --input-file in dagger compute
* secrets now supports bytes
* error reporting for unhandled content data types in WriteFile

Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
2021-04-11 16:18:59 -07:00
Andrea Luzzardi
60db93a246 client: pass through the deployment directly
we can't serialize Cue in a lossless way. The current architecture has
the frontend serialize the state (plan, input, computed) to Cue files,
then the client loads them back. We lose information by doing this, and
therefore the merge fails.

This change removes the abstraction so that we operate directly on the
cue.Instance.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 18:11:06 -07:00
Andrea Luzzardi
8b0eea6e7f compiler: simplify InstanceMerge
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 17:22:25 -07:00
Andrea Luzzardi
b4c530653c compiler: fix data race issue
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 16:30:55 -07:00
Andrea Luzzardi
e54f1b0c3a store only computed values in compute layer
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-07 19:37:48 -07:00
Andrea Luzzardi
5381d0bfe1 up: store outputs and merge in query
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-07 19:05:09 -07:00
Andrea Luzzardi
5a6a8c0ff6 store: fix duplicate paths
A deployment with multiple times the same path would appear repeated in
`LookupDeploymentByPath`.

This change indexes paths as a map rather than a list, thus avoiding the
issue altogether.

Fixes #276

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-05 14:28:59 -07:00
Frederick F. Kautz IV
cb59e23cd4 fix build break
Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
2021-04-04 20:00:22 -07:00
Andrea Luzzardi
0c79488a18
Merge pull request #268 from dagger/deployment-multi-path
store: support multiple deployments per path
2021-04-02 17:54:11 -07:00
Sam Alba
a79e13a35c test: fixed input_test.go
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 17:32:05 -07:00
Sam Alba
ce6ce871ab moved abs path to DirInput
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 17:26:19 -07:00
Sam Alba
a799dd05d7 cli: moved abs path resolve to input.go
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 17:14:01 -07:00
Sam Alba
d3fc31ab57 fixed inputs when input target is overriden
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 16:47:49 -07:00
Andrea Luzzardi
33a7770459 store: support multiple deployments per path
- Add support for multiple deployments per path in the Store
- Add a bunch of tests
- Change the Lookup deployment API
- Add disambiguation in the CLI commands

Fixes #231

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-02 16:40:20 -07:00
Sam Alba
540f373993
Merge pull request #265 from dagger/query-formats
dagger query [--format cue|json|text|yaml] (default is json)
2021-04-02 16:20:39 -07:00
Andrea Luzzardi
8a4aa4d42b pipeline: #compute -> #up
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-02 16:08:15 -07:00
Solomon Hykes
e2e56a5143 dagger query [--format cue|json|text|yaml] (default is json)
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-02 23:05:08 +00:00
Andrea Luzzardi
33d5add54b deployment API cleanup
The API was a bit confusing with code mixing the usage of Deployment and
DeploymentState.

This change marks a clear separation:

- Client is the only piece of code manipulating *Deployment
- CLI commands can manipulate DeploymentState objects and pass them to
  Client

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-02 15:30:38 -07:00
Andrea Luzzardi
2657a516b3 fix lint error
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-02 14:29:17 -07:00
Andrea Luzzardi
5ae5b1bb50 fix dagger input dir
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-01 23:17:38 -07:00
Andrea Luzzardi
526d3af364 state: store in ~/.dagger
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-01 23:00:30 -07:00
Andrea Luzzardi
d848afe7a9 store: fix root directory
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-01 22:16:29 -07:00
Sam Alba
fb9aae38ef cmd/new: added support for plan-git option
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-01 17:46:42 -07:00
Andrea Luzzardi
429820036f tests: add basic cli tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-01 16:46:05 -07:00
Sam Alba
c583dc20ef implemented ClientDoFunc callback to make the client.Up code reusable for other client actions
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-03-31 16:32:15 -07:00
Andrea Luzzardi
b9bd250634 client: fix cue error reporting
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-03-31 14:20:02 -07:00
Andrea Luzzardi
993b96dcb4 cue: simplify lookup wrappers
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-03-31 13:40:46 -07:00
Andrea Luzzardi
a8b41c06b7 cue: Use FillPath everywhere since Fill is now deprecated
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-03-31 13:14:36 -07:00