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

Unable to build multi-arch via Podman CURL / API. #22071

Closed
cdrage opened this issue Mar 18, 2024 · 6 comments · Fixed by #23103
Closed

Unable to build multi-arch via Podman CURL / API. #22071

cdrage opened this issue Mar 18, 2024 · 6 comments · Fixed by #23103
Assignees
Labels
5.0.1 HTTP API Bug is in RESTful API 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. remote Problem is in podman-remote stale-issue

Comments

@cdrage
Copy link

cdrage commented Mar 18, 2024

Issue Description

When trying to pass in --platform equivalent within the API, I am getting this parsing error:

{"cause":"invalid argument","message":"failed to parse query parameter 'platform': \"linux/arm64,linux/amd64\": invalid platform syntax for --platform=\"linux/arm64,linux/amd64\": \"arm64,linux\" is an invalid component of \"linux/arm64,linux/amd64\": platform specifier component must match \"^[A-Za-z0-9_-]+$\": invalid argument","response":400}

Steps to reproduce the issue

Steps to reproduce the issue

  1. Package any Containerfile (tar -czf context.tar.gz -C dir .)
  2. Use the below CURL command:
curl --unix-socket ~/.local/share/containers/podman/machine/applehv/podman.sock -X POST \
     -H "Content-Type: application/tar" \
     -H "Content-Encoding: gzip" \
     --data-binary "@context.tar.gz" \
     "http://d/v4.0.0/libpod/build?platform=linux/arm64,linux/amd64&t=quay.io/mytestcontainer"

{"cause":"invalid argument","message":"failed to parse query parameter 'platform': \"linux/arm64,linux/amd64\": invalid platform syntax for --platform=\"linux/arm64,linux/amd64\": \"arm64,linux\" is an invalid component of \"linux/arm64,linux/amd64\": platform specifier component must match \"^[A-Za-z0-9_-]+$\": invalid argument","response":400}

Describe the results you received

Getting a platform error (see above).

Describe the results you expected

Passing, similar to:

podman build --platform="linux/arm64,linux/amd64" -t mytestcontainer .

podman info output

▶ podman info
host:
  arch: arm64
  buildahVersion: 1.34.1-dev
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc39.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 98.84
    systemPercent: 0.65
    userPercent: 0.51
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "39"
  eventLogger: journald
  freeLocks: 2020
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.7.5-200.fc39.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 510242816
  memTotal: 2047860736
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.20240229100444279141.main.16.g03ce519.fc39.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.11.0-dev
    package: netavark-1.10.1-1.20240229113356745230.main.40.g773fd54.fc39.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.11.0-dev
  ociRuntime:
    name: crun
    package: crun-1.14.3-1.20240229113428746398.main.10.g31aab34.fc39.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: aea8fc0fc7d0aabdbcfd1462d7bf6ea0d1e5215b
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240220.g1e6f92b-1.fc39.aarch64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/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: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 0h 32m 30.00s
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 0
    stopped: 2
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 21349634048
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 10
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.0.0-dev-96f9d0867
  Built: 1709164800
  BuiltTime: Wed Feb 28 19:00:00 2024
  GitCommit: ""
  GoVersion: go1.21.7
  Os: linux
  OsArch: linux/arm64
  Version: 5.0.0-dev-96f9d0867


### Podman in a container

No

### Privileged Or Rootless

None

### Upstream Latest Release

Yes

### Additional environment details

Additional environment details

### Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
@cdrage cdrage added the kind/bug Categorizes issue or PR as related to a bug. label Mar 18, 2024
@github-actions github-actions bot added the remote Problem is in podman-remote label Mar 18, 2024
@Luap99 Luap99 added the HTTP API Bug is in RESTful API label Mar 18, 2024
@mheon mheon added the 5.0.1 label Mar 19, 2024
@cdrage
Copy link
Author

cdrage commented Mar 22, 2024

Closing this as this is intentional in the API and not a bug.

To create multi-platform / multi-arch, it's creating a manifest, then building, then adding it to manifest.

@cdrage cdrage closed this as completed Mar 22, 2024
@nalind
Copy link
Member

nalind commented Mar 27, 2024

It should work, by setting a "manifest" parameter and passing two "platform" parameters.

@nalind
Copy link
Member

nalind commented Mar 27, 2024

(Whether needing to set "manifest" rather than "t" and needing to supply elements of the platforms list in separate "platform" arguments is a bug is not something I'm enough of an expert to weigh in on.)

@mheon
Copy link
Member

mheon commented Mar 27, 2024

I'll reopen given Nalin's comments

@mheon mheon reopened this Mar 27, 2024
Copy link

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

@Luap99
Copy link
Member

Luap99 commented Jun 25, 2024

The docker API seems to accept comma separated values so we must match this in the API.

@Luap99 Luap99 self-assigned this Jun 25, 2024
Luap99 added a commit to Luap99/libpod that referenced this issue Jun 25, 2024
The docker API uses only a single arg for platform and multiple
platforms are given as comma separated list.

Fixes containers#22071

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@stale-locking-app stale-locking-app 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 24, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5.0.1 HTTP API Bug is in RESTful API 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. remote Problem is in podman-remote stale-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants