`Solve() of `llb.Scratch()` returns a `nil` reference. This causes
Pipelines with no operations to panic when interacted with, because of
`nil` pointer de-reference.
Mitigates #189 and #184
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Maps were causing the same Pipeline to randomly produce slightly different LLB
on each run (because they are represented as an array in LLB, wheras
they're a map in CueLLB).
This forces every Cue field iteration (env, mount, etc) to be
predictable by using stable sorting.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Add support for --input-json and --input-yaml (plaintext)
- Input files can optionally be encrypted using sops, with transparent
decryption by dagger
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Solver: Encapsulates all access to Buildkit. Can solve plain LLB, invoke external frontends (for DockerBuild) and export (for ContainerPush)
- FS (now BuildkitFS) implements the standard Go 1.16 io/fs.FS interface and provides a read-only filesystem on top of a buildkit result. It can be used with built-ins such as fs.WalkDir (no need to have our own Walk functions anymore)
- Moved CueBuild into compiler.Build since it no longer depends on Buildkit. Instead it relies on the io/fs.FS interface, which is used both for the base config and the stdlib (go:embed also uses io/fs.FS). Overlaying base and the stdlib is now done by the same code.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Extracted from #140
This will help be more flexible in what gets executed and how (e.g. for
running tests for instance)
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Automatically start a buildkit daemon if no BUILDKIT_HOST is
provided (and if not already started)
- Customization of BUILDKIT_HOST is still possible, just like before
- Automatically upgrade the managed daemon to the version used by dagger
if necessary
- Add CI test to make sure the managed buildkit and the vendored
buildkit versions match
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Remove unnecessary Fill() in Export()
- Change `set()` and the way we store outputs so we don't fill
intermediaries as much
- WIP: Scan the tree only once. Changed LocalDirs to use cueflow rather than
doing our own Walk. In a follow up we should use the same flow
instance.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>