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

Add self-hosted macOS runner support? #24

Closed
mrmachine opened this issue Mar 20, 2021 · 5 comments · Fixed by #30
Closed

Add self-hosted macOS runner support? #24

mrmachine opened this issue Mar 20, 2021 · 5 comments · Fixed by #30

Comments

@mrmachine
Copy link

Behaviour

Docker Desktop works on macOS (Docker runs in a Linux VM managed by Docker Desktop).

GitHub Actions docs say only Linux runners are supported for Docker builds.

Multi-arch builds on GitHub hosted runners via setup-qemu-action are INSANELY slow (from 10 minutes to 1.5 hours). The same multi-arch builds on my Intel MacBook Pro with Docker Desktop is very fast.

It would be great if I could utilise my own hardware to build multi-arch images quickly with GitHub Actions.

Steps to reproduce this issue

Send a job using setup-qemu-action to a self hosted macOS runner.

Expected behaviour

setup-qemu-action should work on self hosted macOS runners.

Actual behaviour

When I attempt a build on a self-hosted macOS runner I get this error:

Error: Only supported on linux platform

Configuration

name: ci

on:
  push:
    branches:
      - '*multiarch'

jobs:
  ci:
    runs-on:
      - macOS
      - self-hosted
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Docker meta
        id: docker_meta
        uses: crazy-max/ghaction-docker-meta@v1
        with:
          images: FOO/BAR
          tag-sha: true

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1

... snipped since error occurs in `setup-qemu-action`

Logs

Run docker/setup-qemu-action@v1
  with:
    image: tonistiigi/binfmt:latest
    platforms: all
Error: Only supported on linux platform
@tonistiigi
Copy link
Member

@mrmachine So if I understand correctly, you do have Docker installed in your macos self-hosted runner?

@mrmachine
Copy link
Author

I run a GitHub self hosted runner in a container with docker desktop for Mac.

@tonistiigi
Copy link
Member

I run a GitHub self hosted runner in a container with docker desktop for Mac.

Why would it detect it as macos then if it is already in Linux container.

@crazy-max Anyway, I think we can allow this if docker is available.

@mrmachine
Copy link
Author

Actually, sorry, it's been a while since I submitted this ticket.

I think I am NOW running GitHub Actions inside a container. However, I was wanting to run the GitHub Actions runner natively (per their recommended installation instructions). Since docker CLI is available on macOS, even if the engine is running inside a managed VM, I am not sure why the GitHub Actions runner cannot support Docker based actions.

As I said, ARM builds on hosted GitHub Actions runners are insanely slow. And the only option (I have found) for cloud based self hosted runners is to use an AWS t4g instance which is an unnecessary expense when I have an ARM based Mac that can run Docker and good bandwidth at home.

@crazy-max
Copy link
Member

@mrmachine I've removed os limitation (#30). Can you try with crazy-max/docker-setup-qemu-action@remove-limitation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants