buildah
buildah copied to clipboard
imagebuildah, `cache-from`: pull cache from remote repo after adding content summary
For certain instruction actual history matching makes sense after content summary is processed and added, In such cases generated cacheKey for distributed cache is changed hence for such cases attempt to pull available cache from remote repo once cacheKey is generated again after adding content summary.
Example use case which works with --cache-from and --cache-to after this commit.
FROM alpine
ARG VAR=hello
RUN echo "Hello $VAR"
Closes: https://github.com/containers/buildah/issues/4315
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: flouthoc
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [flouthoc]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@containers/buildah-maintainers @nalind PTAL
LGTM
@nalind PTAL
@flouthoc you may need to rebase this one
One possible nit, but definitely would like a head nod from @nalind
Rebased following PR with main @containers/buildah-maintainers @nalind PTAL .
LGTM
/lgtm
Heads-up to everyone involved, the buildah treadmill found that this is not working in podman-remote:
#| FAIL: podman-remote build ....
#| expected: =~ 'STEP 2/3: ARG VAR=hello
--> Cache pulled from remote'
#| actual: 'STEP 1/3: FROM alpine'
#| ...
#| > 'STEP 2/3: ARG VAR=hello'
#| > '--> Pushing cache localhost:39951/temp:73dcec7230efcfd8cd8e041d68f6c74b04f1242fc3c1e67c64b0c92abcaa2d28'
#| > '--> 4e92a602438'
i.e., "Cache pulled from remote" does not appear in the output.
For now I've just added skip_if_remote to the treadmill; it will need to be addressed for real in the next buildah vendor.
Heads-up to everyone involved, the buildah treadmill found that this is not working in podman-remote:
#| FAIL: podman-remote build .... #| expected: =~ 'STEP 2/3: ARG VAR=hello --> Cache pulled from remote' #| actual: 'STEP 1/3: FROM alpine' #| ... #| > 'STEP 2/3: ARG VAR=hello' #| > '--> Pushing cache localhost:39951/temp:73dcec7230efcfd8cd8e041d68f6c74b04f1242fc3c1e67c64b0c92abcaa2d28' #| > '--> 4e92a602438'i.e., "Cache pulled from remote" does not appear in the output.
For now I've just added
skip_if_remoteto the treadmill; it will need to be addressed for real in the next buildah vendor.
@edsantiago I'll take a look at this thanks, could you share full log link here as well.
@edsantiago Following PR should fix this https://github.com/containers/buildah/pull/4386