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

[Bug]: Passing --platform=xxx causes Podman to pull image #17063

Open
fishy opened this issue Jan 10, 2023 · 7 comments
Open

[Bug]: Passing --platform=xxx causes Podman to pull image #17063

fishy opened this issue Jan 10, 2023 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@fishy
Copy link

fishy commented Jan 10, 2023

Issue Description

Passing --platform=linux/amd64 on linux/amd64 machine makes podman run significantly slower.

See also #12682 & #14197.

See the outputs below:

# First run to warm up the local cache
$ podman run --rm --platform=linux/amd64 ghcr.io/reddit/thrift-compiler:0.17.0 --version
<output omitted>
$ time podman run --rm --platform=linux/amd64 ghcr.io/reddit/thrift-compiler:0.17.0 --version
Thrift version 0.17.0

real    0m1.760s
user    0m0.229s
sys     0m0.045s

# First run to warm up the local cache
$ podman run --rm ghcr.io/reddit/thrift-compiler:0.17.0 --version
<output omitted>
$ time podman run --rm ghcr.io/reddit/thrift-compiler:0.17.0 --version
Thrift version 0.17.0

real    0m0.310s
user    0m0.067s
sys     0m0.038s

Steps to reproduce the issue

Steps to reproduce the issue

  1. run podman run --rm --platform=linux/amd64 ghcr.io/reddit/thrift-compiler:0.17.0 --version
  2. also run podman run --rm ghcr.io/reddit/thrift-compiler:0.17.0 --version
  3. compare the time it took for the above two runs

Describe the results you received

The one with --platform=linux/amd64 is significantly slower then the one without.

Describe the results you expected

They should take roughly the same time to run.

podman info output

host:
  arch: amd64
  buildahVersion: 1.28.0
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.3+ds1-1_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.3, commit: unknown'
  cpuUtilization:
    idlePercent: 99.06
    systemPercent: 0.3
    userPercent: 0.64
  cpus: 12
  distribution:
    codename: bookworm
    distribution: debian
    version: unknown
  eventLogger: journald
  hostname: perch
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.0.0-6-amd64
  linkmode: dynamic
  logDriver: journald
  memFree: 7720050688
  memTotal: 16377122816
  networkBackend: cni
  ociRuntime:
    name: crun
    package: crun_1.5+dfsg-1+b1_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.5
      commit: 54ebb8ca8bf7e6ddae2eb919f5b82d1d96863dea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.2.0-1_amd64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.4
  swapFree: 14998302720
  swapTotal: 16773017600
  uptime: 100h 31m 34.00s (Approximately 4.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/fishy/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs_1.9-1_amd64
      Version: |-
        fusermount3 version: 3.12.0
        fuse-overlayfs: version 1.9
        FUSE library version 3.12.0
        using FUSE kernel interface version 7.31
  graphRoot: /home/fishy/.local/share/containers/storage
  graphRootAllocated: 233595908096
  graphRootUsed: 165090025472
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/user/1000/containers
  volumePath: /home/fishy/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 0
  BuiltTime: Wed Dec 31 16:00:00 1969
  GitCommit: ""
  GoVersion: go1.19.4
  Os: linux
  OsArch: linux/amd64
  Version: 4.3.1


### Podman in a container

No

### Privileged Or Rootless

Rootless

### Upstream Latest Release

Yes

### Additional environment details

_No response_

### Additional information

_No response_
@fishy fishy added the kind/bug Categorizes issue or PR as related to a bug. label Jan 10, 2023
@vrothberg
Copy link
Member

Thanks for filing. Podman will pull an image if the user specified a custom platform (see #10682). I will see whether we can optimize something.

@vrothberg
Copy link
Member

Opened containers/common#1287 to fix/optimize for this specific case where the platforms match.

@vrothberg
Copy link
Member

Closing since containers/common#1287 got merged. The fix will make it into the upcoming Podman 4.4 release.

@vrothberg
Copy link
Member

Note that it turned out having caused issues (see containers/common#1299), so we had to revert the change.

@fishy
Copy link
Author

fishy commented Jan 31, 2023

should we reopen this issue then?

@vrothberg
Copy link
Member

Yes, good idea.

So at the moment this is "expected behavior". But I am sure we can improve on that.

@vrothberg vrothberg reopened this Feb 1, 2023
@vrothberg vrothberg changed the title [Bug]: Passing --platform=linux/amd64 on linux/amd64 machine makes podman run significantly slower [Bug]: Passing --platform=xxx causes Podman to pull image Feb 16, 2023
@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants