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

podman run --override-arch do not download the image with correct architecture if the image with other architecture is exists. #8001

Closed
lisongmin opened this issue Oct 13, 2020 · 8 comments · Fixed by #9084
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@lisongmin
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

docker run --override-arch do not download the image with correct architecture if the image with other architecture is exists.

Steps to reproduce the issue:

  1. enable multiarch support on x86_64
$ sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
  1. ensure golang image is removed
$ podman image rm golang
  1. create a container of golang with native architecture. We can see that image is x86_64, which is expected.
$ podman run -ti --rm golang ldd /bin/ls
Trying to pull docker.io/library/golang...
Getting image source signatures
Copying blob fb320882041b skipped: already exists
Copying blob 71e126169501 skipped: already exists
Copying blob 03f1c9932170 skipped: already exists
Copying blob 57df1a1f1ad8 skipped: already exists
Copying blob 1af28a55c3f3 skipped: already exists
Copying blob f4773b341423 skipped: already exists
Copying blob 24b0ad6f9416 [--------------------------------------] 0.0b / 0.0b
Copying config 05c8f6d253 done
Writing manifest to image destination
Storing signatures
        linux-vdso.so.1 (0x00007ffe6ef2b000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fac06d25000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fac06b64000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fac06af0000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fac06aeb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fac06f77000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fac06aca000)
  1. run another container with --override-arch=arm64. The arch is x86_64, which is unexpected
$ podman run -ti --rm --override-arch arm64 golang ldd /bin/ls
        linux-vdso.so.1 (0x00007fff2c9cb000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f040364c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f040348b000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f0403417000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0403412000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f040389e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f04033f1000)
  1. remove golang image and try again. the arch is aarch64 which is expected.
$ podman image rm golang
Untagged: docker.io/library/golang:latest

$ podman run -ti --rm --override-arch arm64 golang ldd /bin/ls
Trying to pull docker.io/library/golang...
Getting image source signatures
Copying blob f6d50c93f607 skipped: already exists
Copying blob 422b93158f2f skipped: already exists
Copying blob ad7c41999aa9 skipped: already exists
Copying blob f110d64c2021 skipped: already exists
Copying blob d3a32671b631 skipped: already exists
Copying blob 4b1202c4ddac [--------------------------------------] 0.0b / 0.0b
Copying blob fd04c7f8ff00 [--------------------------------------] 0.0b / 0.0b
Copying config 9eeeacca48 done
Writing manifest to image destination
Storing signatures
        libselinux.so.1 => /lib/aarch64-linux-gnu/libselinux.so.1 (0x000000550186a000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x00000055018a0000)
        /lib/ld-linux-aarch64.so.1 (0x0000005500000000)
        libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000005501a12000)
        libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000005501a85000)
        libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000005501a99000)

Describe the results you received:

podman do not try to download image with correspoding architecture if image with another arch is exists.

Describe the results you expected:

podman should try to download the image if architecture is not matching.

It may be a good idea that podman can cache same tag with diff arch,
so we do not need to download image again and again when we run multiple architecture containers on the same node.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

❯ podman version
Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.15.2
Git Commit:   9f6d6ba0b314d86521b66183c9ce48eaa2da1de2
Built:        Sat Sep 26 23:50:37 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

❯ podman info --debug
host:
  arch: amd64
  buildahVersion: 1.16.1
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: Unknown
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21, commit: 35a2fa83022e56e18af7e6a865ba5d7165fa2a4a'
  cpus: 24
  distribution:
    distribution: arch
    version: unknown
  eventLogger: journald
  hostname: archlinux
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65535
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65535
  kernel: 5.8.14-arch1-1
  linkmode: dynamic
  memFree: 132395925504
  memTotal: 135064350720
  ociRuntime:
    name: runc
    package: Unknown
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc92
      commit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
      spec: 1.0.2-dev
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.1.4
      commit: b66ffa8e262507e37fca689822d23430f3357fe8
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
  swapFree: 0
  swapTotal: 0
  uptime: 4h 15m 23.82s (Approximately 0.17 days)
registries:
  search:
  - docker.io
store:
  configFile: /home/lsm/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/lsm/.local/share/containers/storage
  graphStatus: {}
  imageStore:
    number: 26
  runRoot: /run/user/1000
  volumePath: /home/lsm/.local/share/containers/storage/volumes
version:
  APIVersion: 2.0.0
  Built: 1601135437
  BuiltTime: Sat Sep 26 23:50:37 2020
  GitCommit: 9f6d6ba0b314d86521b66183c9ce48eaa2da1de2
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 2.1.1

Package info (e.g. output of rpm -q podman or apt list podman):

❯ pacman -Qi podman
Name            : podman
Version         : 2.1.1-1
Description     : Tool and library for running OCI-based containers in pods
Architecture    : x86_64
URL             : https://github.com/containers/libpod
Licenses        : Apache
Groups          : None
Provides        : None
Depends On      : cni-plugins  conmon  device-mapper  iptables  libseccomp  runc  slirp4netns  libsystemd  fuse-overlayfs  skopeo
Optional Deps   : podman-docker: for Docker-compatible CLI
                  btrfs-progs: support btrfs backend devices [installed]
                  catatonit: --init flag support
                  crun: support for unified cgroupsv2 [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 77.95 MiB
Packager        : Morten Linderud <[email protected]>
Build Date      : 2020年09月26日 星期六 23时50分37秒
Install Date    : 2020年10月09日 星期五 10时31分44秒
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2020
@rhatdan
Copy link
Member

rhatdan commented Oct 13, 2020

I take it you meant to say

podman run --override-arch do not download the image with correct architecture if the image with other architecture is exists.

@rhatdan
Copy link
Member

rhatdan commented Oct 13, 2020

@vrothberg PTAL

@vrothberg
Copy link
Member

@rhatdan, I can tackle the bug once short names are merged.

Thanks for opening the issue, @lisongmin

@vrothberg vrothberg changed the title docker run --override-arch do not download the image with correct architecture if the image with other architecture is exists. podman run --override-arch do not download the image with correct architecture if the image with other architecture is exists. Nov 3, 2020
vrothberg added a commit to vrothberg/libpod that referenced this issue Nov 24, 2020
When pulling an image, account for the specified OS, architecture and
variant when looking up local images.  While a local image may be found
based on the specified name, the platform may be different from what the
user desires.  In that case, do not use the local image but continue
pulling.

Also remove pull-policy logic from the client.  That'll reduce one
roundtrip for the remote client and reduces code scattering.  The
backend should be the single source of truth for pull-policy handling.

Fixes: containers#8001
Signed-off-by: Valentin Rothberg <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 4, 2020

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

@rhatdan
Copy link
Member

rhatdan commented Dec 4, 2020

@vrothberg Reminder. Shortnames has merged. :^)

@vrothberg
Copy link
Member

@vrothberg Reminder. Shortnames has merged. :^)

Maybe I am a dreamer :) Right after short names, podman cp was on my table. Getting there, step by step

@rhatdan
Copy link
Member

rhatdan commented Dec 24, 2020

This is now working for me on Buildah, although I am dropping --override-arch and just using --arch.

containers/buildah#2868

@github-actions
Copy link

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

@rhatdan rhatdan self-assigned this Jan 25, 2021
rhatdan added a commit to rhatdan/podman that referenced this issue Jan 25, 2021
Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os.  No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch.  This PR also fixes this issue.

Fixes: containers#8001

Signed-off-by: Daniel J Walsh <[email protected]>
iwita pushed a commit to iwita/podman that referenced this issue Jan 26, 2021
Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os.  No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch.  This PR also fixes this issue.

Fixes: containers#8001

Signed-off-by: Daniel J Walsh <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Feb 8, 2021
Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os.  No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch.  This PR also fixes this issue.

Fixes: containers#8001

Signed-off-by: Daniel J Walsh <[email protected]>
@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
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
4 participants