douglascamata / setup-docker-macos-action

A Github Action to setup Docker on macOS runners.
MIT License
29 stars 9 forks source link

action fails on latest macos-14 GitHub runner #26

Closed piotrpawlaczek closed 7 months ago

piotrpawlaczek commented 7 months ago

Action crashes on m1 GitHub runner.

Lima https://github.com/piotrpawlaczek/setup-docker-macos-action/actions/runs/7745160104/job/21120522041

Installing Lima version v0.20.1
  x ./
  x ./bin/
  x ./share/
  x ./share/lima/: Can't create 'share/lima'
  x ./share/doc/: Can't create 'share/doc'

Colima https://github.com/piotrpawlaczek/setup-docker-macos-action/actions/runs/7745338011/job/21121084290

  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] hostagent socket created at /Users/runner/.colima/_lima/colima/ha.sock"
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Using system firmware (\"/opt/homebrew/share/qemu/edk2-aarch64-code.fd\")"
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Starting QEMU (hint: to watch the boot progress, see \"/Users/runner/.colima/_lima/colima/serial*.log\")"
  time="2024-02-01T17:38:08Z" level=info msg="SSH Local Port: 49251"
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Waiting for the essential requirement 1 of 4: \"ssh\""
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Driver stopped due to error: \"signal: abort trap\""
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Shutting down the host agent"
  time="2024-02-01T17:38:08Z" level=warning msg="[hostagent] failed to exit SSH master"
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] Shutting down QEMU with ACPI"
  time="2024-02-01T17:38:08Z" level=warning msg="[hostagent] Failed to remove SSH binding for port 49251"
  time="2024-02-01T17:38:08Z" level=warning msg="[hostagent] failed to open the QMP socket \"/Users/runner/.colima/_lima/colima/qmp.sock\", forcibly killing QEMU"
  time="2024-02-01T17:38:08Z" level=info msg="[hostagent] QEMU has already exited"
  time="2024-02-01T17:38:08Z" level=fatal msg="exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see \"/Users/runner/.colima/_lima/colima/ha.stderr.log\")"
  time="2024-02-01T17:38:08Z" level=fatal msg="error starting vm: error at 'creating and starting': exit status 1"
  Error: Process completed with exit code 1.
douglascamata commented 7 months ago

Thanks for the report, @piotrpawlaczek. I was interested in trying things out in the M1 runners since I saw the post announcing them. Will give this a try this week. 👍

douglascamata commented 7 months ago

Reported the /usr/local/share permission issue to Github: https://github.com/actions/runner-images/issues/9272

douglascamata commented 7 months ago

Will skip download the binaries to move straight to the colima VM part of the problem.

douglascamata commented 7 months ago

@piotrpawlaczek the issue seems to come from lack of support for nested virtualization in the M1 processor. This prevents QEMU or even Virtualization.framework from working.

QEMU will report {"level":"debug","msg":"qemu[stderr]: qemu-system-aarch64: Error: HV_UNSUPPORTED","time":"2024-02-01T19:34:57Z"}

Trying to use Virtualization.framework in Colima through --vm-type=vz will report {"level":"fatal","msg":"Error Domain=VZErrorDomain Code=2 Description=\"Invalid virtual machine configuration. Virtualization is not available on this hardware.\" UserInfo={\n NSLocalizedFailure = \"Invalid virtual machine configuration.\";\n NSLocalizedFailureReason = \"Virtualization is not available on this hardware.\";\n}","time":"2024-02-01T19:36:49Z"}.

There's nothing I can do besides see if Github can answer my pleas.

douglascamata commented 7 months ago

I experimented with this on #27, by the way. Used https://github.com/mxschmitt/action-tmate to ssh into the runner, tried to start Colima and checked logs.

douglascamata commented 7 months ago

@piotrpawlaczek I can't make this work because of the limitations I mentioned (lack of software support in all cases, lack of hardware support in some), I added a notice and a check that I can't support M-series processors as of today (see #28).

I'm happy to support the M2 and M3 processors when Apple adds the software support.

piotrpawlaczek commented 7 months ago

Hello @douglascamata, I appreciate your discovery and insights. It's unfortunate, though. I was really looking forward to macos-14, especially since our arm64 builds are quite time-consuming on non-native GitHub runners. However, it appears that installing the Docker daemon is not straightforward given the circumstances.

douglascamata commented 7 months ago

@piotrpawlaczek that is indeed very unfortunate. I was also excited for this, as I love the performance of my M1 Pro machine. Now we have to choose between Docker or M1… unless GitHub finds a way to give us shareable runners that aren’t VMs.

Could be possible if they had a special flavor of runners that ran our actions directly in an instance of Colima, without access to the host. They would make this whole project obsolete, for the best.