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

Exporter changes for run image extension #1055

Merged
merged 77 commits into from
Apr 17, 2023
Merged

Conversation

natalieparellano
Copy link
Member

@natalieparellano natalieparellano commented Mar 30, 2023

Fixes #999

Also fixes some issues with other phases found during demo testing

- The logic to update the default path for TOML files was repeated across phases
- In general it is safe to provide default values for inputs that might not be relevant to the current phase,
  as these will be ignored when constructing a new service for the phase;
  e.g., platform.LifecycleInputs.OrderPath will be ignored when constructing a lifecycle.Exporter
- As more inputs are shared across phases (e.g., analyzed.toml is now an input to the detect phase),
  duplicating the logic for providing default values is becoming more cumbersome

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
…= 0.10

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
…kage

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
… the platform spec

Signed-off-by: Natalie Arellano <narellano@vmware.com>
…mage.extend = <true or false, default false>

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
… should fail if the selected base image is not found in run.toml.

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
- digest ref for run image
- target data for run image

Additionally the restorer will download the run image manifest & config when extend is true

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Because we change the media types to be oci types (vs docker types) this changes the digest of the image

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
imgutil/layout/sparse modifies the image media types which we don't want

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
// WithBase if populated indicates that the Dockerfile switches the image base to the provided value.
// If WithBase is empty, Extend should be true, otherwise there is nothing for the Dockerfile to do.
// However if WithBase is populated, Extend may be true or false.
WithBase string
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason WithBase seemed more clear than NewBase. But we can change it back if that's not true

Copy link
Contributor

Choose a reason for hiding this comment

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

generator.go Outdated Show resolved Hide resolved
generator.go Outdated Show resolved Hide resolved
Comment on lines +127 to +128
// We need to create the temp directory before `it.Before` blocks because we want the variable to be populated
// when we set up the table tests.
Copy link
Member Author

Choose a reason for hiding this comment

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

spec nuances

@@ -246,7 +246,7 @@ func testExporter(t *testing.T, when spec.G, it spec.S) {
})
})

it("creates app layer on Run image", func() {
it("creates app layer on run image", func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR obviously needs some more unit tests 🙃

exporter.go Outdated Show resolved Hide resolved
exporter.go Outdated Show resolved Hide resolved
exporter.go Outdated Show resolved Hide resolved
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Instead of hard-coding the run image and run image top layer SHAs,
we can derive their values

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@natalieparellano natalieparellano marked this pull request as ready for review April 13, 2023 21:22
@natalieparellano natalieparellano requested a review from a team as a code owner April 13, 2023 21:22
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Copy link
Contributor

@jabrown85 jabrown85 left a comment

Choose a reason for hiding this comment

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

😅 - Sure are a bunch of changes! Looks solid and this is gated behind experimental. 👍

exporter.go Outdated Show resolved Hide resolved
Copy link
Contributor

@joe-kimmel-vmw joe-kimmel-vmw left a comment

Choose a reason for hiding this comment

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

LGTM

cmd/lifecycle/exporter.go Outdated Show resolved Hide resolved
generator.go Show resolved Hide resolved
natalieparellano and others added 5 commits April 14, 2023 13:28
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@natalieparellano natalieparellano merged commit e0e3011 into main Apr 17, 2023
@natalieparellano natalieparellano deleted the runext/export-999 branch April 17, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC #0105] Exporter changes for run image extension (Dockerfiles phase 3)
3 participants