Open andre-lx opened 3 years ago
So, basically the whole point of this action doesn't even work?
Edit: NVM works for me lol xD
Edit: Doesn't work for different build types, e.g. cache is not shared between push and PR, even if the PR is for a single commit that was already built.
I was also surprised to see this. In my case I have a run that is triggered by a regular push, then another one when I tag the version. I was expecting the second to not rebuild docker images but it does 🤷♂️. They are the same commit so I would expect the cache to work in that case. I'm using docker-compose to build my images.
Run of the push before tagging it
with:
key: docker-layer-caching-SATTL-{hash}
restore-keys: docker-layer-caching-SATTL-
concurrency: 4
skip-save: false
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
Received 10853 of 10853 (100.0%), 0.2 MBs/sec
...
Cache saved successfully
119
Stored layer cache: {"key":"layer-docker-layer-caching-SATTL-f0ef9365e55bcbec8d3ee03a24ee9f410a784f1b5e42c358c399f0cdcdb030f9","cacheId":57}
Run of the tag
with:
key: docker-layer-caching-SATTL-{hash}
restore-keys: docker-layer-caching-SATTL-
concurrency: 4
skip-save: false
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: **
AWS_SECRET_ACCESS_KEY: **
Root cache could not be found. aborting.
@satackey 👆 you probably have an idea of what is going on ?
@andre-lx and @cscetbon it might be due to the keys and restore keys being used. Try this:
- uses: satackey/action-docker-layer-caching@v0.0.11
with:
key: docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}-{hash}
restore-keys: |
docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}-{hash}
docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}
docker-layer-caching-${{ github.workflow }}
docker-layer-caching-
And see if it makes any difference.
FYI I tried the above and it didn't make a difference
Describe the bug
Using the following configuration, the cache works great across jobs in the same run (even with the default values of
key
andrestore-keys
, but, re-running the workflow, the cache is never found:Output:
Don't know if it's related with: https://github.com/satackey/action-docker-layer-caching/issues/49
Because the post step works fine, and again, puts all the layers in cache (and can be used in the next job), but never in the next run.
Expected behavior The cache can be used across different runs.
Runner Environment:
I am doing something wrong?
Thanks