gopidesupavan commented on PR #45266:
URL: https://github.com/apache/airflow/pull/45266#issuecomment-2564814190

   > > One question-> does the PR workflow build uses cache? from where it uses 
is it from github registry?
   > 
   > PRs are using cache from the artifacts. If you look at the 
`ci-image-build.xml`, we are attempting to download the cached artifact image 
and load it to the registry (the load command will only run when 
"stash/restore" command will have a cache hit:
   > 
   > ```yaml
   >       - name: "Restore CI docker image ${{ inputs.platform }}:${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
   >         uses: 
apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
   >         with:
   >           key: "ci-image-save-${{ inputs.platform }}-${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
   >           path: "/tmp/"
   >         id: restore-ci-image
   >       - name: "Load CI image ${{ inputs.platform }}:${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
   >         run: breeze ci-image load --platform ${{ inputs.platform }}
   >         shell: bash
   >         if: steps.restore-ci-image.stash-hit == 'true'
   > ```
   > 
   > This is the nice thing with using `stash` action - because it will 
download artifacts "up" the hierarchy when it finds it (see 
https://github.com/apache/infrastructure-actions/tree/main/stash#features)
   > 
   > 1. It will try to attempt to find cache in current workflow  (it will not 
find any because we have not built an image yet)
   > 2. It will look for cache in previous action runs of the current branch 
(which means that even if you modify Dockerfile or other scripts, the cached 
image uploaded in previous run of your PR will be used subsequent runs of the 
same PR within 2 days should be faster
   > 3. If it does not find it (first time you run your PR) - it will look for 
the same artifact in the target branch (`main` or `v-*-test`)   - which will be 
the last "canary" built image
   > 
   > Which is EXACTLY what we need.
   
   Understood, Acutally i have replicated this scenario, uploading image as 
artifact and restoring and rebuilding, but its not used any cache from the 
restored artifact, instead it built all the layers. as per my understand the 
docker image load will not load the image into buildx, this is slightly bit 
behaving different. 
   
   There is issue also i think for this 
https://github.com/docker/buildx/issues/847 ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to