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>
- 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>
Now using the same pattern as Go's http package.
- the `compiler.Compiler` struct can be used directly (and tests to do
to avoid messing with the global version)
- `compiler.DefaultCompiler` contains a public default Compiler instance
- `compiler` exposes proxy functions (e.g. Compile) back to the
DefaultCompiler
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>