Commit Graph

3 Commits

Author SHA1 Message Date
Marcos Lilljedahl
d80acf805b Add experimental way to set a target platform when building
Add an --experimental-platform flag to the do command to allow
overriding the default auto-detected build platform until we find the
time to think about the definitive multi-platform builds UX

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2022-04-05 18:24:14 -03:00
Marcos Lilljedahl
34c7a2ff12 Automatically set target platform based on client architecture
Set the default platform based on the client's OS and architecture. This
function is the same one that buildkit uses (https://github.com/moby/buildkit/blob/master/frontend/dockerfile/builder/build.go#L100-L102) to set the default build target platform

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2022-04-05 15:30:11 -03: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