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 --platform linux/amd64 breaks caching #14197

Closed
fishy opened this issue May 11, 2022 · 2 comments
Closed

podman run --platform linux/amd64 breaks caching #14197

fishy opened this issue May 11, 2022 · 2 comments
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

@fishy
Copy link

fishy commented May 11, 2022

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

/kind bug

Description

To give some context, we provide a container of thrift compiler to our developers as that's the easiest way to distribute it:

And we also provide a shell script, thrift-docker.sh, to use with the container we provided as a drop-in replacement of thrift command line, so instead of thrift --gen go file.thrift they just run thrift-docker.sh --gen go file.thrift instead.

Because a lot of our devs are using Mac, the script supports both docker and podman. the last line of the script is something like this:

exec ${docker_run_cmd} --rm -v "${PWD}":/data/ --user "$(id -u):$(id -g)" "${docker_repo}:${docker_tag}" "$@"

The ${docker_run_cmd} part would be by default docker run but can be overridden to podman run --userns=keep-id to use podman instead of docker.

Now since more and more of our devs are using M1 mac, it seems that in order to use a linux/amd64 docker image on m1 mac docker you have to add --platform linux/amd64 arg to docker run. so the final command being executed should be something like this:

exec docker run --platform linux/amd64 --rm ...

If I replace the docker run part with podman run --userns=keep-id, so the command being executed is actually:

exec podman run --userns=keep-id --platform linux/amd64 --rm ...

It seems to still work, but the problem is that every invocation of this script will try to pull the container image again.

We have a makefile to run thrift compiler against multiple thrift files. without the platform arg, it just runs smoothly like this:

$ make DOCKER_RUN="podman run --userns=keep-id"
./thrift-docker.sh -out . --gen go:... path/to/file1.thrift
./thrift-docker.sh -out . --gen go:... path/to/file2.thrift
...

But with the platform arg, it does this with podman:

$ make DOCKER_RUN="podman run --userns=keep-id --platform linux/amd64"
./thrift-docker.sh -out . --gen go:... path/to/file1.thrift
Trying to pull ghcr.io/reddit/thrift-compiler:0.16.0...
Getting image source signatures
Copying blob 4dc5b27f35a1 skipped: already exists  
Copying blob c40d24cfe61e skipped: already exists  
Copying blob 16ed032c2182 skipped: already exists  
Copying blob 23dc407c2795 skipped: already exists  
Copying blob 68e7bb398b9f skipped: already exists  
Copying config 033d32780a done  
Writing manifest to image destination
Storing signatures
./thrift-docker.sh -out . --gen go:... path/to/file2.thrift
Trying to pull ghcr.io/reddit/thrift-compiler:0.16.0...
Getting image source signatures
Copying blob 4dc5b27f35a1 skipped: already exists  
Copying blob c40d24cfe61e skipped: already exists  
Copying blob 16ed032c2182 skipped: already exists  
Copying blob 23dc407c2795 skipped: already exists  
Copying blob 68e7bb398b9f skipped: already exists  
Copying config 033d32780a done  
Writing manifest to image destination
Storing signatures
...

Which makes things significantly slower (and also makes the console much more noisier)

We can, of course, just ask our devs using M1 Mac to set their environment variable as DOCKER_RUN="docker run --platform linux/amd64", but since that arg is "harmless" in docker, it would be great if it can also be harmless in podman so we can just set it in the script by default.

Steps to reproduce the issue:

Describe the results you received:

Describe the results you expected:

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

Output of podman version:

$ podman version
Version:      3.4.7
API Version:  3.4.7
Go Version:   go1.18.1
Built:        Wed Dec 31 16:00:00 1969
OS/Arch:      linux/amd64

Output of podman info --debug:

$ podman info --debug
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids       
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: 'conmon: /usr/bin/conmon'
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpus: 12
  distribution:
    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: 5.17.0-1-amd64
  linkmode: dynamic
  logDriver: journald
  memFree: 1133502464
  memTotal: 16377475072
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      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: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.7.0
  swapFree: 16010964992
  swapTotal: 16773017600
  uptime: 360h 53m 43.12s (Approximately 15.00 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  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: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.10.5
        fuse-overlayfs: version 1.8.2
        FUSE library version 3.10.5
        using FUSE kernel interface version 7.31
  graphRoot: /home/fishy/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 5
  runRoot: /run/user/1000/containers
  volumePath: /home/fishy/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.7
  Built: 0
  BuiltTime: Wed Dec 31 16:00:00 1969
  GitCommit: ""
  GoVersion: go1.18.1
  OsArch: linux/amd64
  Version: 3.4.7

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

$ apt list podman
Listing... Done
podman/testing,now 3.4.7+ds1-3+b1 amd64 [installed]

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

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

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label May 11, 2022
@mheon
Copy link
Member

mheon commented May 11, 2022

@vrothberg PTAL

@vrothberg
Copy link
Member

Thanks for reaching out, @fishy!

The issue is a duplicate of #12682.

@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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
Development

No branches or pull requests

3 participants