Replies: 4 comments 1 reply
-
Here are some diagrams of what a declarative CNAB bundle could look like. Note that it doesn't have an invocation image and instead the runtime is responsible for reading the workflow definition from the bundle.json and executing it, passing bundle outputs as parameters/credentials to bundles used in the workflow, and mounting shared volumes so that they can share state, such as the original files shipped with the bundle in /cnab, or allowing a tool like porter to manage state with its own volume (/porter). |
Beta Was this translation helpful? Give feedback.
-
Leaving a note for myself that even if mixins are distributed separately, and not inside a single invocation image, we may still want to let the mixins run a command during build, for example to call |
Beta Was this translation helpful? Give feedback.
-
This proposal has been assigned to PEP # |
Beta Was this translation helpful? Give feedback.
-
I was literally about to propose the same idea. Glad I searched here first 😁 |
Beta Was this translation helpful? Give feedback.
-
I have a huge proposal to our mixin infrastructure: implementing mixins as bundles. Mixins would still be executables, and have roughly the same inputs and outputs. However instead of distributing them in binary format, and then building them into each bundle's invocation image, mixins are packaged into bundles, distributed via existing bundle infrastructure (Docker Registries) and execute in isolation within their bundle.
I have a lot of detail worked out for how this needs to be implemented but wanted to keep this overview short to give everyone an idea of the overall direction and impact. I will put an excruciating amount of detail in the PEP to follow. 😅
This would be a fundamental change to how bundles are executed and still stay true to the original intent of mixins (composable bundles). The bundle would be decomposed into separate components that are easier to validate, distribute, reason about provenance, and isolate.
The new bundle manifest would look like this:
Bundle Manifest
Pros
Cons
Bundle Size
For thin bundles, the size of the bundle will be significantly reduced because the bundle no longer needs to "re-ship" an os distribution, porter binary, and mixins. It only contains the files unique to the bundle.
For thick (archived) bundles, the mixins would still be included in the archive so the tgz file would remain the same size.
In both cases, the size is less impactful because by separating mixins into bundles, we can take advantage of Docker caching.
CNAB Runtime
The composition of a bundle from other bundles (in Porter's case mixins) is one way to solve the desire for "declarative" bundles, where the bundle doesn't ship unique binaries and logic. Everything about the bundle and what it will do when run is declared in the bundle definition. We would use this to define a "declarative bundle" spec in CNAB, and if well received, as a starting point for discussing CNAB v2.
Changes to Existing Mixin Design
Use Cases
This change is designed to address the following use cases:
Roadmap
I don't have a plan yet for how this fits into our existing roadmap. It's a very large change, one that impacts mixin authors, porter.yaml schema, and Porter's compatibility with the v1 CNAB spec. It solves so many use cases, that I think it's worth working on soon, but how it fits in with our v1 milestone is TBD.
Beta Was this translation helpful? Give feedback.
All reactions