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

explicit caching broken since 0.6.3, when SAVE IMAGE used without explicitly setting image name #1594

Closed
andyli opened this issue Jan 20, 2022 · 3 comments · Fixed by #1600
Closed
Assignees
Labels
type:bug Something isn't working

Comments

@andyli
Copy link

andyli commented Jan 20, 2022

FROM busybox

file-a:
    RUN touch file-a
    SAVE IMAGE --cache-hint

file-b:
    RUN touch file-b
    SAVE IMAGE --cache-hint

build:
    BUILD +file-a
    BUILD +file-b

Build the +build target with enabled read-write caches:

vscode ➜ /workspace$ earthly --version
earthly version v0.6.3 linux/amd64; Ubuntu 20.04
vscode ➜ /workspace$ earthly --ci --push --remote-cache ghcr.io/andyli/test:cache +build

 1. Init 🚀
————————————————————————————————————————————————————————————————————————————————

           buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
           buildkitd | Updated image available. Restarting buildkit daemon...
           buildkitd | ...Done


 2. Build 🔧
————————————————————————————————————————————————————————————————————————————————

             busybox | --> Load metadata linux/amd64
Error: build target: build main: bkClient.Build: failed to solve: image  is defined multiple times for the same default platform

It seems to work with earthly 0.6.2, but I haven't tested throughly.

@alexcb alexcb added the type:bug Something isn't working label Jan 20, 2022
@alexcb
Copy link
Collaborator

alexcb commented Jan 20, 2022

Does this occur if you add VERSION 0.6 to the top line of the Earthfile, or is it specific only when VERSION 0.5 is being used (which is the default when no version is specified)

@andyli
Copy link
Author

andyli commented Jan 21, 2022

Got the same error with VERSION 0.6 added to the top.

@alexcb
Copy link
Collaborator

alexcb commented Jan 21, 2022

It looks like it's failing due to SAVE IMAGE omitting the name (which should be fine, but obviously isn't).

As a work-around, I was able to get this to work:

VERSION 0.6
FROM busybox

file-a:
    RUN touch file-a
    SAVE IMAGE --cache-hint file-a

file-b:
    RUN touch file-b
    SAVE IMAGE --cache-hint file-b

build:
    BUILD +file-a
    BUILD +file-b

Thanks for the bug report.

@alexcb alexcb changed the title explicit caching broken since 0.6.3 explicit caching broken since 0.6.3, when SAVE IMAGE used without explicitly setting image name Jan 21, 2022
@vladaionescu vladaionescu self-assigned this Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants