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

Next.js next build churns CPU forever in linux/amd64 container on arm64 silicon mac #23269

Closed
PunkFleet opened this issue Jul 13, 2024 · 7 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. macos MacOS (OSX) related remote Problem is in podman-remote stale-issue

Comments

@PunkFleet
Copy link

Issue Description

This issue belongs to nextjs, but has been reported and resolved by docker before. Now it is still not resolved in podman. Here is the link to the docker report: docker/for-mac#6998
nextjs report: vercel/next.js#60012

Is podman able to fix this error like docker does?

Steps to reproduce the issue

Steps to reproduce the issue

  1. when i run podman buildx build --platform linux/amd64 -t test:amd64 . It will be stuck indefinitely in the npm run build session. There is no error reporting or response

Describe the results you received

There is no error or response here, just an infinite jamming

Describe the results you expected

It should take care of the jamming problem

podman info output

podman version:

Client:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Git Commit:   94a24974ab345324db1a1489c924af4b89d2d0e9
Built:        Wed Jul 10 20:20:55 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Built:        Wed Jul 10 08:00:00 2024
OS/Arch:      linux/arm64

podman info:

host:
  arch: arm64
  buildahVersion: 1.36.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc40.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 99.55
    systemPercent: 0.21
    userPercent: 0.24
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "40"
  eventLogger: journald
  freeLocks: 2048
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.8.11-300.fc40.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 10098368512
  memTotal: 10653155328
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.11.0-1.20240628130058229856.main.10.g5ad6420.fc40.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.12.0-dev
    package: netavark-1.11.0-1.20240702123536284903.main.32.g49fb0c2.fc40.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.12.0-dev
  ociRuntime:
    name: crun
    package: crun-1.15-1.20240708144150212138.main.51.g6c158dd.fc40.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: 54f958d21c4e2299eae6b0f4d8b742304540dce6
      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^20240624.g1ee2eca-1.fc40.aarch64
    version: |
      pasta 0^20240624.g1ee2eca-1.fc40.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
  rootlessNetworkCmd: pasta
  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-2.fc40.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 0
  swapTotal: 0
  uptime: 0h 19m 13.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: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
    overlay.use_composefs: "false"
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 99252940800
  graphRootUsed: 4359884800
  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: 0
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.1.2
  Built: 1720569600
  BuiltTime: Wed Jul 10 08:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.5
  Os: linux
  OsArch: linux/arm64
  Version: 5.1.2


### Podman in a container

No

### Privileged Or Rootless

Privileged

### 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
@PunkFleet PunkFleet added the kind/bug Categorizes issue or PR as related to a bug. label Jul 13, 2024
@github-actions github-actions bot added macos MacOS (OSX) related remote Problem is in podman-remote labels Jul 13, 2024
@afbjorklund
Copy link
Contributor

You can disable Rosetta and go back to qemu-user, by changing a [machine] setting in containers.conf:

In case that works better, until the problem can be fixed? Otherwise you'd have to use podman farm build...

@afbjorklund
Copy link
Contributor

@PunkFleet
Copy link
Author

You can disable Rosetta and go back to qemu-user, by changing a [machine] setting in containers.conf:

In case that works better, until the problem can be fixed? Otherwise you'd have to use podman farm build...

Currently I'm learning to explore linking lima amd64 machines using podman-desktop and trying to build on a VM. No success yet!

@PunkFleet
Copy link
Author

PunkFleet commented Jul 16, 2024

The issue is related to node processes under rosetta only seeing 1 CPU, and thus can't multi-task...

update

I have successfully created a link to a lima amd64 VM in podman. But it still gets stuck in the npm run build phase when i run podman farm build -t localhost/test:latest . Due to the build getting stuck, it now automatically skips and ends up prompting an error:

Error: build: building: 1 error occurred:
        * building for "linux/amd64" on "-d": building at STEP "COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./": checking on sources under "/home/admin.linux/.local/share/containers/storage/overlay/c068dc7048222a82a35a4dc002abd8dfa6e24b624c191cac9e6eff82a20c4bea/merged": copier: stat: "/app/.next/standalone": no such file or directory

on Local

% podman version
Client:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Git Commit:   94a24974ab345324db1a1489c924af4b89d2d0e9
Built:        Wed Jul 10 20:20:55 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Built:        Wed Jul 10 08:00:00 2024
OS/Arch:      linux/arm64

podman.lima version

% podman.lima version
Client:       Podman Engine
Version:      5.1.2
API Version:  5.1.2
Go Version:   go1.22.5
Git Commit:   94a24974ab345324db1a1489c924af4b89d2d0e9
Built:        Wed Jul 10 20:20:55 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.1.1
API Version:  5.1.1
Go Version:   go1.22.3
Built:        Tue Jun  4 08:00:00 2024
OS/Arch:      linux/amd64
limactl shell podman uname -a
Linux lima-podman 6.8.5-301.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 11 20:00:10 UTC 2024 x86_64 GNU/Linux
% limactl list
NAME      STATUS     SSH                VMTYPE    ARCH      CPUS    MEMORY    DISK      DIR
podman    Running    127.0.0.1:55499    qemu      x86_64    8       12GiB     100GiB    ~/.lima/podman

Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Aug 16, 2024

I don't see how Podman can fix this.

@rhatdan rhatdan closed this as completed Aug 16, 2024
@afbjorklund
Copy link
Contributor

I think it will need some fix also for Podman Machine, once it is figured out why it doesn't see all CPUs...

@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 Nov 16, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Nov 16, 2024
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. macos MacOS (OSX) related remote Problem is in podman-remote stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants