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

[Analyze] Validate stack IDs #471

Closed
natalieparellano opened this issue Nov 16, 2020 · 7 comments
Closed

[Analyze] Validate stack IDs #471

natalieparellano opened this issue Nov 16, 2020 · 7 comments
Assignees
Labels
epic/stackpacks/phase-1 Reverse analyze & detect; analyze enhancements epic/stackpacks good first issue A good first issue to get started with. status/blocked status/ready type/enhancement New feature or request

Comments

@natalieparellano
Copy link
Member

The buildpacks spec states that

The lifecycle MUST run /bin/detect for all buildpacks in a group in a container using common stack with a common set of mixins. The lifecycle MUST fail detection if any of those buildpacks does not list that stack in buildpack.toml. The lifecycle MUST fail detection if any of those buildpacks specifies a mixin associated with that stack in buildpack.toml that is unavailable in the container.

However, the lifecycle does not currently validate stack IDs (leaving this up to the platform).

The lifecycle should validate that the provided buildpacks and the provided stack can work together by validating that all buildpacks list the provided stack (or *, if on a buildpack API that contains https://github.com/buildpacks/rfcs/blob/main/text/0056-any-stack-buildpacks.md). The lifecycle can examine CNB_STACK_ID to know what stack was provided.

@ekcasey
Copy link
Member

ekcasey commented Nov 19, 2020

In addition, we should ensure that the following all match

  1. The previous image stack ID
  2. The build environment stack ID
  3. The run image stack ID

We should also consider checking whether the layers in the cache were created for the correct stack ID. If we decided to do this:

  1. We will need to store stack ID in the cache metadata.
  2. For backwards compatibility, in cases where the cache metadata is missing the stack ID we should be optimistic and assume the layers were created for the correct stack.

@natalieparellano natalieparellano added this to the lifecycle-0.11.0 milestone Jan 4, 2021
@jabrown85 jabrown85 self-assigned this Jan 21, 2021
@natalieparellano
Copy link
Member Author

@jabrown85 do we want to move this to 0.12.0? I think it'll go nicely with buildpacks/spec#206

@jabrown85
Copy link
Contributor

That sounds good to me @natalieparellano

@natalieparellano natalieparellano modified the milestones: lifecycle-0.11.0, lifecycle-0.12.0 Mar 12, 2021
@natalieparellano natalieparellano changed the title Lifecycle should validate stack IDs [Analyze] Validate stack IDs Apr 12, 2021
@natalieparellano
Copy link
Member Author

We should also consider checking whether the layers in the cache were created for the correct stack ID. If we decided to do this:

We will need to store stack ID in the cache metadata.
For backwards compatibility, in cases where the cache metadata is missing the stack ID we should be optimistic and assume the layers were created for the correct stack.

I think this probably makes sense to be a separate issue.

@natalieparellano
Copy link
Member Author

Q: If stack IDs are the same, can we assume that the images have the same platform & architecture?

@natalieparellano natalieparellano added the epic/stackpacks/phase-1 Reverse analyze & detect; analyze enhancements label Apr 13, 2021
@natalieparellano
Copy link
Member Author

Blocked on #530

@natalieparellano natalieparellano added the good first issue A good first issue to get started with. label Apr 29, 2021
jabrown85 added a commit that referenced this issue May 12, 2021
During analyze, Platform 0.7 and above will validate the build and stack image if the data is available to do so.

Addresses: #471

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit that referenced this issue May 17, 2021
During analyze, Platform 0.7 and above will validate the build and stack image if the data is available to do so.

Addresses: #471

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit that referenced this issue Jun 14, 2021
During analyze, Platform 0.7 and above will validate the build and stack image if the data is available to do so.

Addresses: #471

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit that referenced this issue Jun 14, 2021
During analyze, Platform 0.7 and above will validate the build and stack image if the data is available to do so.

Addresses: #471

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit that referenced this issue Jun 14, 2021
During analyze, Platform 0.7 and above will validate the build and stack image if the data is available to do so.

Addresses: #471

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
@natalieparellano
Copy link
Member Author

Removing this from 0.12.0 milestone for the same reason as #573 (comment)

@natalieparellano natalieparellano removed this from the lifecycle-0.12.0 milestone Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/stackpacks/phase-1 Reverse analyze & detect; analyze enhancements epic/stackpacks good first issue A good first issue to get started with. status/blocked status/ready type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants