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

Rinning with the caching Slower then without a cache #247

Open
avifatal opened this issue Mar 1, 2022 · 3 comments
Open

Rinning with the caching Slower then without a cache #247

avifatal opened this issue Mar 1, 2022 · 3 comments

Comments

@avifatal
Copy link

avifatal commented Mar 1, 2022

Hi,
The image bellow shows that this plugin makes the build really slower. When I run without the plugin, I get better results.
Im sure the problem is on my side, what am I doing wrong?
Thanks

image

This is the code:

jobs:
  build-push-gcr:
    name: Build and Push to GCP
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - uses: satackey/action-docker-layer-caching@v0.0.11

        continue-on-error: true
      - uses: google-github-actions/setup-gcloud@master
        with:
          service_account_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
          project_id: ${{ secrets.PROJECT_ID }}

      - name: Build Docker Image
        run: DOCKER_BUILDKIT=1 docker build -t ${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }} -f ./infra/build/${{ inputs.APP_NAME }}/Dockerfile .

      - name: Configure Docker Client
        run: |-
          gcloud auth configure-docker --quiet
          gcloud auth configure-docker us-central1-docker.pkg.dev --quiet

      - name: Push Docker Image to Container Registry (GCR)
        run: |-
          docker tag ${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }} gcr.io/${{ secrets.PROJECT_ID }}/${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }}
          docker push gcr.io/${{ secrets.PROJECT_ID }}/${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }}
@raress96
Copy link

The problem is with the docker push command. I have the same issue, the caching also caches those images, and when loading it loads those as well, even though they are irrelevant.

Not sure how to fix this though...

@ripmd-alex-deng
Copy link

Yes, I just put a step at the end after pushing those images to delete the tag image for the registry.

However do you guys know if there is a way to clear the images that are already in the cache?

@raress96
Copy link

Yes, I just put a step at the end after pushing those images to delete the tag image for the registry.

However do you guys know if there is a way to clear the images that are already in the cache?

Can you share the snippet on how you clear the images?
You can clear images from cache by changing the cache key and restore-keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants