Comments (2)
Sorry for the delay; here you go:
Earthfile:
VERSION --try 0.8
test:
FROM python:3.12
RUN echo "asdf" > ./some-other-file
TRY
RUN python -c 'import time; time.sleep(5); print("jkl;")' > ./testfile
FINALLY
SAVE ARTIFACT ./testfile AS LOCAL ./testfile
END
First run:
➜ earthly +test
<snip>
Build 🔧
————————————————————————————————————————————————————————————————————————————————
python:3.12 | --> Load metadata python:3.12 linux/arm64
+test | --> FROM python:3.12
+test | [----------] 100% FROM python:3.12
+test | --> RUN echo "asdf" > ./some-other-file
+test | --> RUN python -c 'import time; time.sleep(5); print("jkl;")' > ./testfile
(5 second pause)
+test | --> SAVE ARTIFACT ./testfile +test/testfile AS LOCAL ./testfile
output | --> exporting outputs
output | sent 1 file stat)
output | [----------] 100% exporting outputs
output | --> exporting outputs
<snip>
Second run (immediately following first):
➜ earthly +test
<snip>
Build 🔧
————————————————————————————————————————————————————————————————————————————————
python:3.12 | --> Load metadata python:3.12 linux/arm64
+test | --> FROM python:3.12
+test | [----------] 100% FROM python:3.12
+test | *cached* --> RUN echo "asdf" > ./some-other-file
+test | --> RUN python -c 'import time; time.sleep(5); print("jkl;")' > ./testfile
(5 second pause)
+test | *cached* --> SAVE ARTIFACT ./testfile +test/testfile AS LOCAL ./testfile
output | --> exporting outputs
output | sent 1 file stat)
output | [----------] 100% exporting outputs
output | --> exporting outputs
<snip>
On the second run, I'd have expected the RUN
inside the TRY
/FINALLY
to have been a cache hit, but it was a cache miss, and accordingly it took 5 seconds to run.
from earthly.
can you provide a minimal reproduction case that we can run?
Your example can't be run as-is (e.g. missing a VERSION
command, missing the project
directory, missing whatever dependencies are done in the base target).
from earthly.
Related Issues (20)
- earthly/dind release process needs improvement HOT 1
- WITH DOCKER using compose gives "Project name not found" HOT 3
- Build says it didn't push image when it did HOT 2
- earthly/dind `alpine` tag docs is now outdated
- Log streaming sometimes lags behind terminal output
- Export fails on Windows HOT 2
- Improve AWS authentication experience V1
- Improve AWS authentication experience V2
- Capture more target data in Logstream deltas
- WITH DOCKER breaks parallelization HOT 1
- incorrect error message when attempting to copy non existent file
- Overriding args with --pass-args doesn't behave as expected
- Update to runc 1.1.12 - CVE-2024-21626 / GHSA-xr7r-f8xq-vfvv
- Consecutive `SAVE IMAGE` commands result in different image digests HOT 1
- EARTHLY_GIT_AUTHOR contains only the email address
- [Question] Earthly in Azure DevOps.
- buildkit update HOT 18
- Internal GET GIT META command fails with "exec: format error" HOT 4
- Support BuildKit multi-platform builds without binfmt_misc adjustments on Linux
- Passing attestation options to buildkit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earthly.