earthly: Cache export hangs on target with just `BUILD` commands, and no `FROM` in the base target
I am using earthly with GitHub Actions and the following earthly command:
earthly --ci --remote-cache=ghcr.io/notin-dev/cache:cache --push +build-all
The entire build is taking about 8 minutes to complete, but the cache step is taking over 20 minutes to complete and I get the following output
cache | --> exporting cache
[653](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:653)
cache | [ ] 0% preparing build cache for export
[654](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:654)
cache | [██████████] 100% preparing build cache for export
[655](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:655)
ongoing | cache (1 minute ago)
[656](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:656)
ongoing | cache (2 minutes ago)
[657](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:657)
ongoing | cache (3 minutes ago)
[658](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:658)
ongoing | cache (4 minutes ago)
[659](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:659)
ongoing | cache (5 minutes ago)
[660](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:660)
ongoing | cache (6 minutes ago)
[661](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:661)
ongoing | cache (7 minutes ago)
[662](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:662)
ongoing | cache (8 minutes ago)
[663](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:663)
ongoing | cache (9 minutes ago)
[664](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:664)
ongoing | cache (10 minutes ago)
[665](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:665)
ongoing | cache (11 minutes ago)
[666](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:666)
ongoing | cache (12 minutes ago)
[667](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:667)
ongoing | cache (13 minutes ago)
[668](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:668)
ongoing | cache (14 minutes ago)
[669](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:669)
ongoing | cache (15 minutes ago)
[670](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:670)
ongoing | cache (16 minutes ago)
[671](https://github.com/notin-dev/lomp/runs/6957678719?check_suite_focus=true#step:5:671)
ongoing | cache (17 minutes ago)
I initially though that the issue was with heavy usage of SAVE IMAGE --cache-hint and so I removed every occurrence of that in the repository but even then the cache step is taking forever to complete.
I’m not sure if I’m doing something wrong here.
This is my GitHub Actions file:
name: Build Project
on:
pull_request:
branches: [main]
push:
branches:
- main
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build_project:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Logging into Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Installing earthly
run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.14/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'
- name: Building project
run: earthly --ci --remote-cache=ghcr.io/notin-dev/cache:cache --push +build-all
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 17 (11 by maintainers)
This is a buildkit bug of some sort - we found a way to work around it in #2154.
Awesome, glad we were able to find a workaround 🙌
We’ll leave this issue open until the underlying bug in Earthly is fixed.
Thanks @chandraaditya - I have access and will see if I can figure out what’s going on with that cache export.