Incremental load support for commit and extract. - #1439
Conversation
|
/assign @alex1545 |
a9c48ac to
87effd5
Compare
|
As I'm trying to use this patch in our repo I'm noticing there's a couple of incompatibilities between the way these and the other rules are used that is making the code very finnicky, I will smooth out the difference in a second commit, but the tradeoff for that is that the interface will be very incompatible. It might be worth having that as a separate PR. |
|
Note this isn't ready to merge because it doesn't update all the other rules in the repo to use the new interface, but I'd like some initial feedback on the approach before continuing with that. |
594748b to
12bfbcf
Compare
smukherj1
left a comment
There was a problem hiding this comment.
Taking a brief look, I feel like this change could be simplified a lot by keeping the existing commit.sh.tpl and extract.sh.tpl scripts and just making a couple of changes to the incremental_load.sh.tpl to support your changes. This way all the existing rules wouldn't need to be modified to pipe in the extra flags. I feel this mode of build and then maybe commit or extract and then run is making the semantics of container_image too complicated. Further, it goes against the general principle that rules in //container' never require the docker` executable.
|
Yes, that makes sense: use incremental load to just load the image, then run the separate script to do the extracting or committing. I tried it as my first approach but I couldn't get it to work: templating it so the the two ended up into one script only required a lot of changes, and making it two different scripts was hard to make correct because it required expressing the side effect of having the image loaded as a side effect of the first script, rather than having an output produced as usual. Let me try again now that I have a working approach, might be able to do something. I didn't know |
ef8cad8 to
cd08c94
Compare
|
Done, now with fewer changes in |
|
@smukherj1 What you do think of this approach? |
|
This approach looks good! Could you please look into the CI failures (example here I'm going to launch the GCB tests as well... |
|
/gcbrun |
|
Any update on this? I have a quite heavy image (50 GB of intermediate tarballs) built using the “build image with source layer, run_and_extract” pattern, and if I understand this issue correctly, this PR would eliminate those. |
|
No this only cuts it in half: it removes the need for the tarballs on the read side, but it still produces tarballs on the write side. Sorry we've been using this patch for a while now and it's working fine, but I haven't had time to clean it up, I'll come back to it. |
|
Also see my comment in #1384 (comment): it's unlikely we'll ever be able to remove the need for the tarball on the write side since docker does not expose any APIs to output layers, so we've been changing our usage of |
cd08c94 to
27643b2
Compare
|
So, this is a fun one. We have a circular dep here. The package install tests are attempting to see if we can reproducible install a package from apt into a container using This change modifies the way container_image is implemented so it seems like we have some circular dep thing here. Not sure as to the cause but this is what I'd investigate. This is done in this repo: https://github.com/GoogleContainerTools/base-images-docker Maybe this is the culprit: https://github.com/GoogleContainerTools/base-images-docker/blob/master/WORKSPACE#L33-L38 |
0fdd1dc to
8a7c792
Compare
|
TODO: the new code has a trap in |
|
Turns out the test failure might not have been related to the PR at all: but now I can't run the tests locally because of the transitions not working on macOS. |
b3850a9 to
dd0f0a2
Compare
|
And we're back, this time |
Which version of bazel are you running? This repo seems to not work with 5.x. You can try 4.0.0 as that's the one used in CI. |
|
Great catch, that was exactly the issue. I was able to run the test locally and it passes, so maybe it's another test caching / flakiness issue on CI? |
dd0f0a2 to
c95f72d
Compare
Done by removing those traps, the only thing that is leftover in each case is a file created with |
c95f72d to
aaab1e4
Compare
|
This is the error from the build: not sure where it's coming from since I couldn't find any related |
|
was this merged ? |
|
It wasn't merged, but we're still using it internally. I stopped updating the PR because it wasn't getting any traction. |
|
Sorry for the lack of activity. This seems like a useful change which I'm sure we'd be happy to add. |
|
@lamcw you recently had to update this patch, can you update this PR with the changes? I've given you access to my fork. |
|
Oh, can't reopen the PR off a recreated or force pushed branch, will have to open a new PR. |
container_run_and_commitandcontainer_run_and_extractdon't support the intermediate format because they were moved from https://github.com/GoogleContainerTools/base-images-docker.This modifies them to support that.
See #1384.