containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.37k stars 781 forks source link

broken test: bud-multiple-platform-values #4396

Open edsantiago opened 1 year ago

edsantiago commented 1 year ago

Two tests are not run in CI because the CI VMs don't have emulation tools:

ok 350 bud-multiple-platform-values # skip unable to run arm container, assuming emulation is not available
ok 352 bud-multiple-platform-failure # skip unable to run arm container, assuming emulation is not available

Both are broken. I can fix the "-failure" one (it's just a wrong expected exit code, 125 when it should be 1) but I don't know the intention of the "-values" one and can't fix it. This is the failure:

Error: COPY --from=alpine: no stage or image found with that name

...and this is the Dockerfile: https://github.com/containers/buildah/blob/3cfa17a69564a7a3968a5b4671f6c203c9ec1eda/tests/bud/multiarch/Dockerfile#L8

Maybe that should be from=base, or maybe line 4 should be FROM alpine AS somethingelse? I'm not wise enough to know. @nalind this is your code from June 2021, I'll leave it in your hands.

And, I wonder if we should install qemu in our test VMs?

nalind commented 1 year ago
Error: COPY --from=alpine: no stage or image found with that name

...and this is the Dockerfile:

https://github.com/containers/buildah/blob/3cfa17a69564a7a3968a5b4671f6c203c9ec1eda/tests/bud/multiarch/Dockerfile#L8

Maybe that should be from=base, or maybe line 4 should be FROM alpine AS somethingelse? I'm not wise enough to know. @nalind this is your code from June 2021, I'll leave it in your hands.

Nope, that's testing that COPY --from=... can refer to an image by its name, and "alpine" is the name of an image that we definitely know we have at that point, since it's the base image for that stage. If that step is failing, then we broke something.

And, I wonder if we should install qemu in our test VMs?

It shouldn't break anything if we do.

flouthoc commented 1 year ago

Nope, that's testing that COPY --from=... can refer to an image by its name, and "alpine" is the name of an image that we definitely know we have at that point, since it's the base image for that stage. If that step is failing, then we broke something.

This should be reproduce-able outside of multiple platform test as well, let me try reproducing it on a simpler test.

flouthoc commented 1 year ago

huh i was wrong this bug does not persists on regular multi-stage build

FROM alpine as one
RUN touch hey
RUN echo hello

FROM alpine as two
COPY --from=one hey .
COPY --from=alpine /tmp .
./buildah build -t test .
[1/2] STEP 1/3: FROM alpine AS one
[1/2] STEP 2/3: RUN touch hey
[1/2] STEP 3/3: RUN echo hello
hello
[2/2] STEP 1/3: FROM alpine AS two
[2/2] STEP 2/3: COPY --from=one hey .
[2/2] STEP 3/3: COPY --from=alpine /tmp .
[2/2] COMMIT test
Getting image source signatures
Copying blob 994393dc58e7 skipped: already exists  
Copying blob 3cdd3495f0b5 done  
Copying config 2134847aca done  
Writing manifest to image destination
Storing signatures
--> 2134847acaa
Successfully tagged localhost:5000/test:latest
2134847acaa4235fbba828f2785b6285699819113fe5657dd16ce00523ec5dba
rhatdan commented 1 year ago

Is this the one that you and I (mostly you) fixed today?

flouthoc commented 1 year ago

@rhatdan I think this is different unrelated to that.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.

rhatdan commented 1 year ago

@flouthoc Any chance you can look at this?

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.

flouthoc commented 1 year ago

Had no success reproducing this last time on regular mult-stage builds will try again for multiple architectures with emulation enabled.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.

edsantiago commented 1 year ago

I don't understand the failure to reproduce. It still reproduces 100% on buildah @ main:

$ env BUILDAH_BINARY=$(pwd)/bin/buildah bats --filter "bud-multiple-platform-values" tests/bud.bats  
....
Error: creating build container: locating pulled image "docker.io/library/alpine:latest" name in containers storage: docker.io/library/alpine:latest: image not known

This is on my f37 laptop, and obviously with qemu installed because the test is skipped otherwise.

flouthoc commented 1 year ago

@edsantiago That was bad explanation on my part here: https://github.com/containers/buildah/issues/4396#issuecomment-1302240116, i assumed that this should be reproduceable even with regular multi-stage build but this only persists on a multi-stage builds when built for multiple platforms.

edsantiago commented 1 year ago

Filed #4596 to hard-skip this test, because it is triggering in Fedora gating tests. If/when anyone fixes this, please remove the skip.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 30 days.