Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix: create efficient oci images with reusable layers #294

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

malt3
Copy link
Contributor

@malt3 malt3 commented Apr 2, 2024

This set of functions generates layers that can be combined into OCI image layout directories. Those can directly be pushed to a registry.
Strong focus was placed on making the layers reusable in arbitrary ways. This allows for efficient distribution of binary artifacts via container image layers.

Feel free to suggest a different layout in nix!

@malt3 malt3 added the no changelog PRs not listed in the release notes label Apr 2, 2024
@malt3 malt3 marked this pull request as ready for review April 3, 2024 08:31
@malt3 malt3 requested a review from katexochen as a code owner April 3, 2024 08:31
Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only reviewd the ociLayer file in detail.

I think adding a README with some documentation would be nice. Maybe we can add it to the top level function and link it into the other pkgs?

packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociLayerTar/package.nix Show resolved Hide resolved
@malt3 malt3 force-pushed the feat/nix/oci-image-functions branch 3 times, most recently from 8f2429e to b71253d Compare April 15, 2024 09:55
Copy link

PR Preview Action v1.4.7
🚀 Deployed preview to https://edgelesssys.github.io/contrast/pr-preview/pr-294/
on branch gh-pages at 2024-04-15 09:59 UTC

@malt3 malt3 force-pushed the feat/nix/oci-image-functions branch 3 times, most recently from 4b3468c to 96161b5 Compare April 15, 2024 10:20
@malt3 malt3 requested a review from katexochen April 15, 2024 10:30
@malt3 malt3 force-pushed the feat/nix/oci-image-functions branch from 96161b5 to 15c5fd2 Compare April 15, 2024 11:55
packages/by-name/ociImageLayout/README.md Outdated Show resolved Hide resolved
packages/by-name/ociImageManifest/package.nix Outdated Show resolved Hide resolved
packages/by-name/ociImageLayout/README.md Outdated Show resolved Hide resolved
packages/by-name/ociImageLayout/README.md Show resolved Hide resolved
packages/by-name/ociImageManifest/package.nix Outdated Show resolved Hide resolved
Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me. Is there any easy way to add a test for this?

@malt3 malt3 force-pushed the feat/nix/oci-image-functions branch from 15c5fd2 to c6f2050 Compare April 16, 2024 08:48
@malt3
Copy link
Contributor Author

malt3 commented Apr 16, 2024

Looks pretty good to me. Is there any easy way to add a test for this?

I think the best real test case will be the node installer image. We could also add a dummy image with expected file contents. Would that be preferred as part of this PR?

This set of functions generates layers that can be combined into OCI image layout directories.
Those can directly be pushed to a registry.
Strong focus was placed on making the layers reusable in arbitrary ways.
This allows for efficient distribution of binary artifacts via container image layers.
@malt3 malt3 force-pushed the feat/nix/oci-image-functions branch from c6f2050 to 892eed2 Compare April 16, 2024 08:51
@katexochen
Copy link
Member

Looks pretty good to me. Is there any easy way to add a test for this?

I think the best real test case will be the node installer image. We could also add a dummy image with expected file contents. Would that be preferred as part of this PR?

Likely you're right and having it in our end-to-end flow is enough. I thought about a simple test creating an image and running it with docker or so just to see it is valid. But not strictly necessary.

@katexochen
Copy link
Member

I think the best real test case will be the node installer image. We could also add a dummy image with expected file contents. Would that be preferred as part of this PR?

Maybe using a file format validator could be enough of a test? https://github.com/opencontainers/image-tools/blob/master/man/oci-image-tool-validate.1.md

@malt3 malt3 requested a review from katexochen April 16, 2024 11:29
Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@malt3 malt3 merged commit 6a2c9df into main Apr 16, 2024
8 checks passed
@malt3 malt3 deleted the feat/nix/oci-image-functions branch April 16, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants