-
Notifications
You must be signed in to change notification settings - Fork 71
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
Make build layers read only for subsequent buildpacks #155
base: main
Are you sure you want to change the base?
Conversation
ce39879
to
1228814
Compare
I think this a good idea, but it does add both complexity and encourages coupling. Another buildpack needs to know how to fetch or find the directory. This can be done via an env var like the android SDK example or just accidental like the Python one. We have the working dir + slices which is the current place that shared writing can happen. I think being able to show why we don't want to pollute this directory could go a long way. There is an inherit idea today that a layer created by a buildpack is "owned" by it and this changes that. |
7e42239
to
5d067af
Compare
d85f0d8
to
b110d17
Compare
fcad940
to
23941e5
Compare
Per the last RFC deep dive meeting, I have converted this RFC to only cover the "layerization" part. I will create a sibling RFC for "shared-layers" which should be implemented as an atomic change along with this RFC. |
e5b1cbe
to
5099221
Compare
16a896b
to
d3aacd4
Compare
c2e37b1
to
1b0c61b
Compare
Signed-off-by: Sambhav Kothari <[email protected]>
Signed-off-by: Sambhav Kothari <[email protected]>
Signed-off-by: Sambhav Kothari <[email protected]>
Signed-off-by: Sambhav Kothari <[email protected]>
… UIDs Signed-off-by: Sambhav Kothari <[email protected]>
1b0c61b
to
6cbf750
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing my approval for now, because I thought we were working toward a solution that had an escape hatch.
# What it is | ||
[what-it-is]: #what-it-is | ||
|
||
Updates to the lifecycle so that `build` layers created by buildpacks should be layerized immediately after the buildpack that provided the layer is finished with its build process. This way any modification made by the future buildpacks would be ignore while still making this layer available to future buildpacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a buildpack indicate that a layer should not be layerized until all buildpacks have run?
If a subsequent buildpack modified a layer from an existing buildpack, can we save that as a new layer? This may be inefficient overall, but it makes it much easy to develop buildpacks in some cases.
I'm revisiting this RFC as I'm struggling to get |
The proposed changes due to perf reasons are pretty drastic. This RFC seems to have stalled without a decision one way or another. I propose we "postpone" this and create an issue on lifecycle to try to at least warn users when this is happening. It may be expensive perf wise, but it maybe worth spiking and measure how much it would cost. Thoughts @ekcasey @natalieparellano ? |
Maintainers, As you review this RFC please queue up issues to be created using the following commands:
Issues(none) |
This is blocked currently on this spike: buildpacks/lifecycle#703. |
Since @ekcasey is on leave, I'd like to reassign this. Do you mind if I assign you @natalieparellano? |
Coverting this to a draft while it is still blocked. |
@hone just to clarify, the spike is measuring the performance impact of notifying or failing if mod times change? Or something else? |
I ran a couple experiments for buildpacks/lifecycle#703. Detecting which buildpacks modify which layers using a file system watcher was pretty efficient (added ~0.5 seconds to a ~12-second build of Spring Petclinic REST with Paketo buildpacks). More details and results in the experiment repo. So, it seems feasible for lifecycle to detect and report a buildpack changing another buildpack's layer. On the broader topic, I've had some conversations with @yaelharel who is interested and has some good ideas to explore for read-only layers and change detection. |
While @mboldt ran some experiments with a hash function and a file system watcher (as described in this issue), we talked about some ideas for this RFC:
One tricky part is knowing ahead of time which buildpack should “own” a given layer. From a fresh build, it’s easy to see which buildpack creates a layer. But, with caching/restore, it’s a bit trickier as the layers already exist. We would need to track that somewhere but we think it’s possible to do so. Another concern about some of the hard-stop methods is that, although layers should be read-only per spec, it is not enforced today, and so could break some buildpacks. If we don’t want to create a breaking change, we think that we can create some kind of a flag that will tell us whether we should only warn or error based on the version. |
This was my ignorance...the platform API does include the buildpack ID in the layer path, so this is not a problem as I first thought. |
Signed-off-by: Sambhav Kothari [email protected]
Readable
Related RFC #163