-
Notifications
You must be signed in to change notification settings - Fork 68
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
pkg/imagebuilder: expose BuiltInBuildArgs
for downstream
#258
Conversation
The change LGTM, but the conformance test is failing with an error code "2", which I'm not sure where it's popping from. |
@TomSweeneyRedHat Conformance test failure looks unrealted, it needs to be restart but I dont have access. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nalind PTAL |
Is there a way to prevent callers from overwriting these values? |
At least one of the conformance test errors should be fixed by a rebase. |
@nalind Could we create a function which exposes a copy of the map and not the actual map. WDYT ? |
84015b2
to
ac04851
Compare
New changes are detected. LGTM label has been removed. |
ac04851
to
36a0f49
Compare
That would be fine. |
36a0f49
to
ff5f1ae
Compare
@nalind PTAL |
619a14d
to
9bdb309
Compare
dispatchers.go
Outdated
@@ -22,6 +22,7 @@ import ( | |||
"github.com/containers/storage/pkg/regexp" | |||
"github.com/openshift/imagebuilder/signal" | |||
"github.com/openshift/imagebuilder/strslice" | |||
"golang.org/x/exp/maps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this since this is easier to use, other projects such as containers/image
is already using this since this is expected to become part of golang
.
However this is totally optional, I can amend to do manual clone as well without any dep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm , this is changing to many deps.
Expose map BuiltInBuildArgs so downstream users like buildah can use it. Signed-off-by: Aditya R <[email protected]>
9bdb309
to
0f679ca
Compare
@flouthoc: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@nalind PTAL |
The use case for this suggests that it expects these values to be updated when FROM uses a --platform flag, but I don't see those updates being reflected in the current iteration. |
Ah i see, I am not sure if values of |
@nalind I don't think buildkit does this, I tried following FROM alpine
ARG TARGETOS TARGETARCH TARGETPLATFORM BUILDOS BUILDPLATFORM BUILDARCH
RUN echo "TARGETOS=$TARGETOS"
RUN echo "TARGETARCH=$TARETARCH"
RUN echo "TARGETPLATFORM=$TARGETPLATFORM"
RUN echo "BUILDOS=$BUILDOS"
RUN echo "BUILDARCH=$BUILDARCH"
RUN echo "BUILDPLATFORM=$BUILDPLATFORM"
RUN echo hey > hello
FROM --platform=linux/arm64 ubuntu
ARG TARGETOS TARGETARCH TARGETPLATFORM BUILDOS BUILDPLATFORM BUILDARCH
COPY --from=0 hello .
RUN echo "TARGETOS=$TARGETOS"
RUN echo "TARGETARCH=$TARETARCH"
RUN echo "TARGETPLATFORM=$TARGETPLATFORM"
RUN echo "BUILDOS=$BUILDOS"
RUN echo "BUILDARCH=$BUILDARCH"
RUN echo "BUILDPLATFORM=$BUILDPLATFORM" [fl@fedora patform]$ sudo docker buildx build --no-cache --progress=plain -t test .
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 32B done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s
#3 [internal] load metadata for docker.io/library/ubuntu:latest
#3 DONE 0.9s
#4 [internal] load metadata for docker.io/library/alpine:latest
#4 DONE 1.7s
#5 [stage-1 1/8] FROM docker.io/library/ubuntu@sha256:6120be6a2b7ce665d0cbddc3ce6eae60fe94637c6a66985312d1f02f63cc0bcd
#5 CACHED
#6 [stage-0 1/8] FROM docker.io/library/alpine@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1
#6 CACHED
#7 [stage-0 2/8] RUN echo "TARGETOS=linux"
#7 0.326 TARGETOS=linux
#7 DONE 0.4s
#8 [stage-0 3/8] RUN echo "TARGETARCH=$TARETARCH"
#8 0.363 TARGETARCH=
#8 DONE 0.4s
#9 [stage-0 4/8] RUN echo "TARGETPLATFORM=linux/amd64"
#9 0.349 TARGETPLATFORM=linux/amd64
#9 DONE 0.4s
#10 [stage-0 5/8] RUN echo "BUILDOS=linux"
#10 0.336 BUILDOS=linux
#10 DONE 0.4s
#11 [stage-0 6/8] RUN echo "BUILDARCH=amd64"
#11 0.339 BUILDARCH=amd64
#11 DONE 0.4s
#12 [stage-0 7/8] RUN echo "BUILDPLATFORM=linux/amd64"
#12 0.362 BUILDPLATFORM=linux/amd64
#12 DONE 0.4s
#13 [stage-0 8/8] RUN echo hey > hello
#13 DONE 0.4s
#14 [stage-1 2/8] COPY --from=0 hello .
#14 DONE 0.2s
#15 [stage-1 3/8] RUN echo "TARGETOS=linux"
#15 0.407 TARGETOS=linux
#15 DONE 0.5s
#16 [stage-1 4/8] RUN echo "TARGETARCH=$TARETARCH"
#16 0.382 TARGETARCH=
#16 DONE 0.4s
#17 [stage-1 5/8] RUN echo "TARGETPLATFORM=linux/amd64"
#17 0.419 TARGETPLATFORM=linux/amd64
#17 DONE 0.5s
#18 [stage-1 6/8] RUN echo "BUILDOS=linux"
#18 0.394 BUILDOS=linux
#18 DONE 0.4s
#19 [stage-1 7/8] RUN echo "BUILDARCH=amd64"
#19 0.387 BUILDARCH=amd64
#19 DONE 0.4s
#20 [stage-1 8/8] RUN echo "BUILDPLATFORM=linux/amd64"
#20 0.420 BUILDPLATFORM=linux/amd64
#20 DONE 0.5s
#21 exporting to image
#21 exporting layers
#21 exporting layers 0.5s done
#21 writing image sha256:db8f27a0fa0eaf3d57f1f2c93632f90e1f659b46898c650c4b8101d99b05ad63 done
#21 naming to docker.io/library/test
#21 naming to docker.io/library/test done
#21 DONE 0.6s
[fl@fedora patform]$
|
@nalind PTAL |
@nalind Could you PTAL |
Do they ever change? If not, what's the point of having two sets of variables whose values are always identical to each other? |
Are they affected by the |
@nalind Yes [fl@fedora patform]$ sudo docker buildx build --platform linux/amd64 --progress=plain --no-cache -t test .
[sudo] password for fl:
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 691B done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s
#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 3.1s
#4 [1/8] FROM docker.io/library/alpine@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1
#4 CACHED
#5 [2/8] RUN echo "TARGETOS=linux"
#5 0.309 TARGETOS=linux
#5 DONE 0.4s
#6 [3/8] RUN echo "TARGETARCH=$TARETARCH"
#6 0.346 TARGETARCH=
#6 DONE 0.4s
#7 [4/8] RUN echo "TARGETPLATFORM=linux/amd64"
#7 0.326 TARGETPLATFORM=linux/amd64
#7 DONE 0.4s
#8 [5/8] RUN echo "BUILDOS=linux"
#8 0.331 BUILDOS=linux
#8 DONE 0.4s
#9 [6/8] RUN echo "BUILDARCH=amd64"
#9 0.334 BUILDARCH=amd64
#9 DONE 0.4s
#10 [7/8] RUN echo "BUILDPLATFORM=linux/amd64"
#10 0.325 BUILDPLATFORM=linux/amd64
#10 DONE 0.4s
#11 [8/8] RUN echo hey > hello
#11 DONE 0.4s
#12 exporting to image
#12 exporting layers
#12 exporting layers 0.6s done
#12 writing image sha256:db056b8eb8e45d89c42e58d84e67bb9ddc4ae235248fe2ba0c7511716ff3a70d done
#12 naming to docker.io/library/test done
#12 DONE 0.6s
[fl@fedora patform]$ sudo docker buildx build --platform linux/arm64 --progress=plain --no-cache -t test .
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 32B done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s
#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 0.9s
#4 [1/8] FROM docker.io/library/alpine@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1
#4 CACHED
#5 [2/8] RUN echo "TARGETOS=linux"
#5 0.334 TARGETOS=linux
#5 DONE 0.4s
#6 [3/8] RUN echo "TARGETARCH=$TARETARCH"
#6 0.420 TARGETARCH=
#6 DONE 0.5s
#7 [4/8] RUN echo "TARGETPLATFORM=linux/arm64"
#7 0.354 TARGETPLATFORM=linux/arm64
#7 DONE 0.4s
#8 [5/8] RUN echo "BUILDOS=linux"
#8 0.401 BUILDOS=linux
#8 DONE 0.4s
#9 [6/8] RUN echo "BUILDARCH=amd64"
#9 0.343 BUILDARCH=amd64
#9 DONE 0.4s
#10 [7/8] RUN echo "BUILDPLATFORM=linux/amd64"
#10 0.348 BUILDPLATFORM=linux/amd64
#10 DONE 0.4s
#11 [8/8] RUN echo hey > hello
#11 DONE 0.4s
#12 exporting to image
#12 exporting layers
#12 exporting layers 1.1s done
#12 writing image sha256:6f64dac848d73a3a0560c82c05f4246b4b2be7f5e179927dfaf3fec6f7dcc858 done
#12 naming to docker.io/library/test done
#12 DONE 1.1s
[fl@fedora patform]$
|
@nalind PTAL |
Is this an oversight in the |
@nalind Do you mean if this could be a bug in buildkit implementation ? In a sense it could be an expected behavior since Consider a case where build-platform is Overall I'm not entirely sure if this is a bug but buildkit maintainers can confirm it better. |
Still waiting on this one. |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
@nalind Any opinion on this one ? |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Expose map BuiltInBuildArgs so downstream users like buildah can use it.
PR: containers/buildah#4839 directly uses this for info