Skip to content

daemon: make daemon.getEntrypointAndArgs a regular function#49335

Merged
robmry merged 1 commit intomoby:masterfrom
thaJeztah:daemon_getEntrypointAndArgs_nomethod
Jan 27, 2025
Merged

daemon: make daemon.getEntrypointAndArgs a regular function#49335
robmry merged 1 commit intomoby:masterfrom
thaJeztah:daemon_getEntrypointAndArgs_nomethod

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

It was not using the daemon, so can be a regular function. While at it, also changed the parameter type to accept a regular string-slice, as we don't need strslice.StrSlice's json.Unmarshaler implementation, and reversed the logic for the early return.

Finally, for uses where the entrypoint was always nil, this patch removes the use of this utility altogether.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

It was not using the daemon, so can be a regular function. While at it,
also changed the parameter type to accept a regular string-slice, as
we don't need strslice.StrSlice's json.Unmarshaler implementation, and
reversed the logic for the early return.

Finally, for uses where the entrypoint was always nil, this patch removes
the use of this utility altogether.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added status/2-code-review area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code labels Jan 26, 2025
@thaJeztah thaJeztah added this to the 28.0.0 milestone Jan 26, 2025
@thaJeztah thaJeztah self-assigned this Jan 26, 2025
@thaJeztah
Copy link
Copy Markdown
Member Author

Looks like the SEGFAULTS with QEMU binfmt are not limited to just ppc64le;

also seeing it fail here on arm64 https://github.com/moby/moby/actions/runs/12975182886/job/36185938034?pr=49335

#24 [smoketest 3/3] RUN <<EOT (set -ex...)
#24 0.044 + file dockerd
#24 0.051 dockerd: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=1eb0837e67a6bc094da569bbc36b527c2bc54a65, for GNU/Linux 3.7.0, with debug_info, not stripped
#24 0.051 + dockerd --version
#24 0.121 Segmentation fault (core dumped)
#24 ERROR: process "/bin/sh -c   set -ex\n  file dockerd\n  dockerd --version\n  file docker-proxy\n  docker-proxy --version\n" did not complete successfully: exit code: 139
Run docker/setup-qemu-action@v3
  with:
    image: docker.io/tonistiigi/binfmt:latest
    platforms: all
    cache-image: true
  env:
    GO_VERSION: 1.23.5
    GIT_PAGER: cat
    PAGER: cat
    SETUP_BUILDX_VERSION: edge
    SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
    PLATFORM_PAIR: linux-arm64

Further details;

Details
Pulling binfmt Docker image
  Cache Size: ~23 MB (23958954 B)
  /usr/bin/tar -xf /home/runner/work/_temp/44daa18d-30f8-4c67-87b5-0427328566ff/cache.tzst -P -C /home/runner/work/moby/moby --use-compress-program unzstd
  Received 23958954 of 23958954 (100.0%), 22.8 MBs/sec
  Cache restored successfully
  Restored docker.io--tonistiigi--binfmt-latest-linux-x64 from GitHub Actions cache
  Cached to hosted tool cache /opt/hostedtoolcache/docker.io--tonistiigi--binfmt/latest/linux-x64
  Image found from cache in /home/runner/.docker/.cache/images/docker.io--tonistiigi--binfmt/latest/linux-x64/image.tar
  /usr/bin/docker load -i /home/runner/.docker/.cache/images/docker.io--tonistiigi--binfmt/latest/linux-x64/image.tar
  Loaded image: tonistiigi/binfmt:latest
  /usr/bin/docker pull docker.io/tonistiigi/binfmt:latest
  latest: Pulling from tonistiigi/binfmt
  Digest: sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55
  Status: Image is up to date for tonistiigi/binfmt:latest
  docker.io/tonistiigi/binfmt:latest
  /usr/bin/docker save -o /home/runner/work/_temp/docker-actions-toolkit-89BPqi/749e64100d3fa0c09bdbc8a02e4fb9cb3ee64266f7f661c98371040689abacb3.tar docker.io/tonistiigi/binfmt:latest
  Image cached to /home/runner/.docker/.cache/images/docker.io--tonistiigi--binfmt/latest/linux-x64/image.tar

Image info
  /usr/bin/docker image inspect docker.io/tonistiigi/binfmt:latest
  [
      {
          "Id": "sha256:354472a378935adfe74a19600b89bd9ada7bb058306fff23b3d6613405852faf",
          "RepoTags": [
              "tonistiigi/binfmt:latest"
          ],
          "RepoDigests": [
              "tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55"
          ],
          "Parent": "",
          "Comment": "buildkit.dockerfile.v0",
          "Created": "2022-08-02T19:13:20.178433831Z",
          "DockerVersion": "",
          "Author": "",
          "Config": {
              "Hostname": "",
              "Domainname": "",
              "User": "",
              "AttachStdin": false,
              "AttachStdout": false,
              "AttachStderr": false,
              "Tty": false,
              "OpenStdin": false,
              "StdinOnce": false,
              "Env": [
                  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                  "QEMU_PRESERVE_ARGV0=1"
              ],
              "Cmd": null,
              "Image": "",
              "Volumes": {
                  "/tmp": {}
              },
              "WorkingDir": "/",
              "Entrypoint": [
                  "/usr/bin/binfmt"
              ],
              "OnBuild": null,
              "Labels": {
                  "org.opencontainers.image.created": "2022-08-02T18:32:39.936Z",
                  "org.opencontainers.image.description": "Cross-platform emulator collection distributed with Docker images",
                  "org.opencontainers.image.licenses": "MIT",
                  "org.opencontainers.image.revision": "a161c41c7aeaf3ef1c5b97f91aa02a12cca73432",
                  "org.opencontainers.image.source": "https://github.com/tonistiigi/binfmt",
                  "org.opencontainers.image.title": "Binfmt",
                  "org.opencontainers.image.url": "https://github.com/tonistiigi/binfmt",
                  "org.opencontainers.image.version": "qemu-v7.0.0-28"
              }
          },
          "Architecture": "amd64",
          "Os": "linux",
          "Size": 60182964,
          "GraphDriver": {
              "Data": {
                  "LowerDir": "/var/lib/docker/overlay2/66e4a0b2740dd4613574a138828ad890550c3d565b7897bbda05d0d0430c872e/diff",
                  "MergedDir": "/var/lib/docker/overlay2/765b900f409c7325385e0165f82d1e91e938c457e1f6a413ba9fc98222abf889/merged",
                  "UpperDir": "/var/lib/docker/overlay2/765b900f409c7325385e0165f82d1e91e938c457e1f6a413ba9fc98222abf889/diff",
                  "WorkDir": "/var/lib/docker/overlay2/765b900f409c7325385e0165f82d1e91e938c457e1f6a413ba9fc98222abf889/work"
              },
              "Name": "overlay2"
          },
          "RootFS": {
              "Type": "layers",
              "Layers": [
                  "sha256:4c67e4044f8c0fe3e3efaf76f2a3d5d3d866f8ef2e8a9da756949d90e576baa0",
                  "sha256:949acf1cb73a60306e050836deb85a26fe23e226f6bcc499872b057efbf22dd1"
              ]
          },
          "Metadata": {
              "LastTagTime": "0001-01-01T00:00:00Z"
          }
      }
  ]

Installing QEMU static binaries
  /usr/bin/docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all
  installing: arm64 OK
  installing: arm OK
  installing: mips64 OK
  installing: mips64le OK
  installing: s390x OK
  installing: ppc64le OK
  installing: riscv64 OK
  {
    "supported": [
      "linux/amd64",
      "linux/arm64",
      "linux/riscv64",
      "linux/ppc64le",
      "linux/s390x",
      "linux/386",
      "linux/mips64le",
      "linux/mips64",
      "linux/arm/v7",
      "linux/arm/v6"
    ],
    "emulators": [
      "cli",
      "llvm-10-runtime.binfmt",
      "llvm-11-runtime.binfmt",
      "llvm-12-runtime.binfmt",
      "python2.7",
      "python3.8",
      "qemu-aarch64",
      "qemu-arm",
      "qemu-mips64",
      "qemu-mips64el",
      "qemu-ppc64le",
      "qemu-riscv64",
      "qemu-s390x"
    ]
  }

Extracting available platforms
  linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6

Docker info from that run;

Details
Docker info
  /usr/bin/docker version
  Client: Docker Engine - Community
   Version:           26.1.3
   API version:       1.45
   Go version:        go1.21.10
   Git commit:        b72abbb
   Built:             Thu May 16 08:33:49 2024
   OS/Arch:           linux/amd64
   Context:           default
  
  Server: Docker Engine - Community
   Engine:
    Version:          26.1.3
    API version:      1.45 (minimum version 1.24)
    Go version:       go1.21.10
    Git commit:       8e96db1
    Built:            Thu May 16 08:33:49 2024
    OS/Arch:          linux/amd64
    Experimental:     false
   containerd:
    Version:          1.7.25
    GitCommit:        bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
   runc:
    Version:          1.2.4
    GitCommit:        v1.2.4-0-g6c52b3f
   docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0
  /usr/bin/docker info
  Client: Docker Engine - Community
   Version:    26.1.3
   Context:    default
   Debug Mode: false
   Plugins:
    buildx: Docker Buildx (Docker Inc.)
      Version:  v0.20.0
      Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    compose: Docker Compose (Docker Inc.)
      Version:  v2.27.1
      Path:     /usr/libexec/docker/cli-plugins/docker-compose
  
  Server:
   Containers: 0
    Running: 0
    Paused: 0
    Stopped: 0
   Images: 15
   Server Version: 26.1.3
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Using metacopy: false
    Native Overlay Diff: false
    userxattr: false
   Logging Driver: json-file
   Cgroup Driver: cgroupfs
   Cgroup Version: 1
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
   Swarm: inactive
   Runtimes: io.containerd.runc.v2 runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
   runc version: v1.2.4-0-g6c52b3f
   init version: de40ad0
   Security Options:
    apparmor
    seccomp
     Profile: builtin
   Kernel Version: 5.15.0-1078-azure
   Operating System: Ubuntu 20.04.6 LTS
   OSType: linux
   Architecture: x86_64
   CPUs: 4
   Total Memory: 15.62GiB
   Name: fv-az803-863
   ID: d54f040b-39b3-4b04-8c14-ff01b8ba2f99
   Docker Root Dir: /var/lib/docker
   Debug Mode: false
   Username: githubactions
   Experimental: false
   Insecure Registries:
    127.0.0.0/8
   Live Restore Enabled: false

Copy link
Copy Markdown

@p1-0tr p1-0tr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robmry robmry merged commit bd353d4 into moby:master Jan 27, 2025
@thaJeztah thaJeztah deleted the daemon_getEntrypointAndArgs_nomethod branch January 27, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants