New & Improved Package Structure: efficient OCI storage, remote & local signing, OCI import, sget deprecation #1298
Replies: 4 comments 5 replies
-
Need to add a section about signing--idea would be to focus on cosign blob signing using normal key-based signing if the user defines/provides a key to perform the signing. |
Beta Was this translation helpful? Give feedback.
-
This is great @jeff-mccoy! I had some clarifying questions about what some of the details are going to look like, sorry for they hop all over in ideas OCI LayersWe should make a decision about whether images/artifacts within an imported zarf package should be re-generated by the parent zarf package creation process, or should copy those artifacts hosted remotely on the registry (in the non-skeleton zarf package). Regardless, I think the ability to import artifacts from a registry may be needed for situations like air-gap builds. Given the assumption that I'd like to be able to use the artifacts from the zarf package in my import:
Nested ReferencesFor the skeleton package, if my package imports a component from an OCI hosted skeleton file would my zarf package/skeleton:
Skeleton TagIf the skeleton tag was the same as the original zarf package, minus the images directory, it might be very simple to create a new tag/OCI image with no additional layers/storage being used. Or we could bypass the need for the tag regardless if the zarf.yaml (and signature) were always the last 2 (or first 2) layers in the zarf package. Zarf could then just pull those particular layers for import (and validation) without the need for a second tag. |
Beta Was this translation helpful? Give feedback.
-
Implementation is starting over at Issue #1319. |
Beta Was this translation helpful? Give feedback.
-
The "skeleton" package looks very interesting. If I understand correctly, it would be the full package minus any images, storing references instead. It's a little unclear, would OCI imported components ( Talking to the team during the Zarf Weekly Team Sync, it sounds like the (initial?) target of skeleton packages is something more like a "template" for other zarf packages (with OCI component import?), not to be used to deploy to clusters (it won't work with When do the referenced images actually pulled? During If images are referenced by Docker tag, there is some risk that the images may change between I would be interested in the skeleton mode expanding to be usable for deploying to clusters too. I have been a little worried with the push towards large full stack Zarf packages, but I think this could enable some workflows to make the large package actually quite lightweight in packaged size and enable data reuse. Often every component in a full stack does not get updated at once. Perhaps a user has some very large (10s of GB) images in one component, but a different component has been updated (maybe just BB values updated) and This also makes some potential CI pipeline development workflows a little nicer (imagine all of the following could be independent pipelines, each reusing data from the previous):
I still want |
Beta Was this translation helpful? Give feedback.
-
Implementation is starting over at Issue #1319.
You can track this work in milestone 0.25.x
New universal package structure
This proposal seeks to define a normalized package structure for Zarf packages. In addition to providing signing without depending on cosign sget, it will also allow treating local or remote packages the same way. Additionally, this proposal discusses a new command,
zarf package publish
for allowing users to publish packages to a remote registry for deployment or reuse in other packages.Context Driving Change (OCI Packaging)
We know we are successful when:
Package Structure Changes
zarf.yaml
flagmetadata.uncompressed
now changes compression of./components/<name>.tar
../images/
./images/
dir exists, it will be used instead of./images.tar
./components/<name>.tar.?
exists, it will be used instead of the./components/<name>/
dir./checksums.txt
exists it will be processedmetadata.checksumSignature
is also not an empty string, it will used to verify the signature of the checksums file./sboms/.tar.zst
exists it will be used instead of the./sboms/
dir./zarf.yaml.sig
exists it will be used to verify the signature of./zarf.yaml
Top Level Structure
Old Package Structure
New Package Structure
Zarf Package Config (Kafka Strimzi Example)
Publishing Zarf Packages
Using the new package structure detailed above, publishing to an OCI Distribution Registry will assume that the layers will be written/optimized for reuse which means that the OCI artifact will operate in lieu of a tarball. When the package is published to a registry, two different artifacts will be published: the package and a skeleton package. The skeleton package will be a copy of the package with all layers that can be pulled remotely removed. This is intended to be used to extend a package or in the case of
zarf package create
. The standard package will be published for directly deploying a package.Publish a package will follow the convention
<repo>/<package-name>:<version>-<arch>
and<repo>/<package-name>:<version>-skeleton
. Using the package example above:Command:
Result:
Skeleton Package
A skeleton package is a special package that is essentially a copy/paste of the local folder where the
zarf.yaml
is defined. Note, in this solution referencing files outside of the currentzarf.yaml
folder path will not work properly. One particular note is Kustomizations, they will not be processed or converted into manifests but will simply be copied into the OCI artifact for later composition if imported.Deploying OCI Packages
Deploying will be very similar to prior
sget
behavior. Using the package example above:Alternatively, we could look at defining a new command:
Eventually the Zarf UI could include the ability to search a registry for packages and deploy or download them.
Importing OCI Packages/Components
It can be confusing, but you cannot directly import a package in Zarf. A component is an atomic unit imported/extended within a package. We refer to this as composable components. It is possible to import a package/component that is only a single component. The challenge with OCI imports of packages/components is that we will have to copy things locally before finishing the composition. Additionally, composable components today do not have a concept of special handling for remote assets already pulled into a package/local location. This is where the skeleton component proposal comes in. The skeleton package will be loaded into a temp directory and referenced like a local package/component. This will occur at the normal composition stage, before the confirm step on
zarf package create
.Example OCI import
This example would then call
oci://defenseunicorns/terraform:1.3.7-skeleton
and include it as a part of the package definition onzarf package create
. As with local imports, this would be completely transparent onzarf package deploy
.Decision: I'm not sure if we should include a checksum or signature file for skeleton files as they will be incomplete and regenerated anyway during package create.
Beta Was this translation helpful? Give feedback.
All reactions