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

placeholder: reason for emergency podman-build --arch exception #9915

Closed
edsantiago opened this issue Apr 1, 2021 · 8 comments
Closed

placeholder: reason for emergency podman-build --arch exception #9915

edsantiago opened this issue Apr 1, 2021 · 8 comments
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@edsantiago
Copy link
Member

edsantiago commented Apr 1, 2021

PR #9821 vendored in buildah v1.20.0. That brought in a new test of the --arch flag:
https://github.com/containers/buildah/blob/b405ca6551576a98fbc79ae8fe701246d1c7a4f0/tests/bud.bats#L2596

This test failed under podman CI, requiring an emergency skip to get CI passing:

# $ podman build --force-rm=false --layers=false --arch=arm64 -t arch-test --signature-policy /var/tmp/go/src/github.com/containers/podman/test-buildah-v1.20.0/tests/policy.json /var/tmp/tmp61d96368bc5feadfcbeaa482/my-dir
# STEP 1: FROM alpine
# time="2021-03-25T17:38:35-05:00" level=warning msg="failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
# time="2021-03-25T17:38:37-05:00" level=warning msg="failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
# time="2021-03-25T17:38:39-05:00" level=warning msg="failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
# Error: error creating build container: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

The reason for this has not been understood. It now seems like it's related to the prefetch helper. In particular, here is a reproducer:

# podman pull quay.io/libpod/alpine
# podman images
REPOSITORY             TAG     IMAGE ID      CREATED        SIZE
quay.io/libpod/alpine  latest  961769676411  19 months ago  5.85 MB
# podman save --format oci-archive --output=/tmp/alpine.tar alpine
# podman rmi -a
# podman load -i /tmp/alpine.tar     ! this changes the image name and ID
# podman images
REPOSITORY        TAG     IMAGE ID      CREATED        SIZE
localhost/alpine  latest  1f97f0559cbd  19 months ago  5.85 MB
# echo "FROM alpine" | podman build --arch=arm64 -t foo -
STEP 1: FROM alpine
WARN[0000] failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
WARN[0002] failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
WARN[0004] failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
Error: error creating build container: Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

The image does include arm64 and other arches:

# podman manifest inspect alpine|gron|grep -i arch
json.manifests[0].platform.architecture = "amd64";
json.manifests[1].platform.architecture = "arm";
json.manifests[2].platform.architecture = "arm";
json.manifests[3].platform.architecture = "arm64";
json.manifests[4].platform.architecture = "386";
json.manifests[5].platform.architecture = "ppc64le";
json.manifests[6].platform.architecture = "s390x";

I wonder if this is related to #3761, in which podman save/load changes digests?

Anyhow, sorry for the non-helpful issue; I'm out of time for today. Hope someone can run with this.

@rhatdan
Copy link
Member

rhatdan commented Apr 5, 2021

@vrothberg This looks like containers/image is not catching the localhost case?

@vrothberg
Copy link
Member

@vrothberg This looks like containers/image is not catching the localhost case?

Not quite. docker://localhost/alpine:latest instructs c/image to copy that image from a registry (i.e., "docker" transport).

There are a couple of things to unpack:

  1. "localhost" prefixes are a constant pain
  2. podman save/load may use these prefixes
  3. podman build and buildah bud have a bug in the image pull/look up logic. While there is a local localhost/alpine image in @edsantiago's reproducer, the local image has the wrong architecture so we need to pull one in the desired architecture. This image reference (localhost/alpine) then seems to be used for pulling which is arguably wrong.

I think it's a Buildah bug. Added to my todo.

containers/image is entirely unaware of the "localhost" prefixing that Podman and Buildah do.

@vrothberg
Copy link
Member

vrothberg commented Apr 6, 2021

Update. It's a podman-side bug. Cannot reproduce with buildh bud.

vrothberg added a commit to vrothberg/buildah that referenced this issue Apr 6, 2021
Move the platform check into `resolveLocalImage` and inspect each of the
candidates in the given order.  This preserves the local lookup order
and fixes a bug reported in containers/podman/issues/9915.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
vrothberg added a commit to vrothberg/buildah that referenced this issue Apr 6, 2021
Move the platform check into `resolveLocalImage` and inspect each of the
candidates in the given order.  This preserves the local lookup order
and fixes a bug reported in containers/podman/issues/9915.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
@vrothberg
Copy link
Member

I opened containers/buildah#3129 to fix it. It worked with Buildah since it's using a different default pull policy.

@vrothberg
Copy link
Member

containers/buildah#3129 merged. @rhatdan, do you want to backport or shall we wait for the next release?

@rhatdan
Copy link
Member

rhatdan commented Apr 6, 2021

Wait for next release. which might be coming up quickly.

@github-actions
Copy link

github-actions bot commented May 7, 2021

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

@rhatdan
Copy link
Member

rhatdan commented May 7, 2021

This looks like it is fixed in the main branch now.

@rhatdan rhatdan closed this as completed May 7, 2021
edsantiago added a commit to edsantiago/libpod that referenced this issue May 10, 2021
The following bugs seem to be fixed:

* containers#6510 (e2e tests) - podman rmi gives "layer not known"

* containers#9915 (buildah-bud tests) - podman build --arch

* containers#10248 - spurious warning from first-ever invocation
  of rootless podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
edsantiago added a commit to edsantiago/libpod that referenced this issue May 10, 2021
The following bugs seem to be fixed:

* containers#6510 (e2e tests) - podman rmi gives "layer not known"

* containers#9915 (buildah-bud tests) - podman build --arch

* containers#10248 - spurious warning from first-ever invocation
  of rootless podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
Procyhon pushed a commit to Procyhon/podman that referenced this issue May 27, 2021
The following bugs seem to be fixed:

* containers#6510 (e2e tests) - podman rmi gives "layer not known"

* containers#9915 (buildah-bud tests) - podman build --arch

* containers#10248 - spurious warning from first-ever invocation
  of rootless podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants