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 support for --no-container to run windows/macos #97

Closed
chenrui333 opened this issue Feb 24, 2020 · 69 comments · Fixed by #1293
Closed

Add support for --no-container to run windows/macos #97

chenrui333 opened this issue Feb 24, 2020 · 69 comments · Fixed by #1293
Labels
area/runner Relating to errors in the runner kind/feature-request New feature or request needs-work Extra attention is needed stale-exempt Exempt from stale

Comments

@chenrui333
Copy link
Contributor

Thanks for creating this wonderful tool. It would be nice to have MacOS also supported as well.

@cplee
Copy link
Contributor

cplee commented Feb 24, 2020

All steps for act run in a docker container...not sure how to accomplish that with MacOS runner. Would you want it to NOT use a container and just run the commands directly on the mac that act is running on?

@cplee cplee added kind/question Further information is requested area/runner Relating to errors in the runner labels Feb 27, 2020
@fwilhe
Copy link

fwilhe commented Mar 10, 2020

Kinda related: Sometime I think you really don't want to run stuff in containers, for example when act is invoked in a container itself which contains the required software already. Not sure if this is in scope, but it would be kind of nice if it had a --no-container flag which would do what it does now, except for using the locally installed tools..

How feasible would this be?

@cplee cplee added kind/feature-request New feature or request and removed kind/question Further information is requested labels Apr 16, 2020
@cplee cplee changed the title [feature] Support 'macOS-latest' Add support for --no-container to run windows/macos Apr 16, 2020
@cplee
Copy link
Contributor

cplee commented Apr 16, 2020

I like the idea @fwilhe - would like to see a flag --no-container that runs all the steps directly on your local workstation, and assumes the right tools are installed. This would enable both windows and macos environments.

@albertofem

This comment has been minimized.

@cplee
Copy link
Contributor

cplee commented May 13, 2020

@albertofem - this looks really promising! What do you think about also supporting --no-container to force the platform to be host?

@jcansdale

This comment has been minimized.

@fwilhe
Copy link

fwilhe commented May 14, 2020

In my experience it is a viable workaround for failing setup actions to build a docker image that has everything your build needs. Provides you the same experience locally and in actions if you run your workflow in the image.

@jcansdale
Copy link

@fwilhe I did wonder about doing that. It's good to hear that it works well in practice!

Since you can optionally specify an image to use with Codespaces, this could be a good opportunity to sync-up build and development environments. 🤔

@albertofem
Copy link
Contributor

@cplee Yes, I think the flag makes more sense for the general case rather than assuming non-supported hosts. I'm gonna rework my brach and come back as soon as I have something ready for review.

@cplee cplee mentioned this issue Jun 9, 2020
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label Jul 16, 2020
@fwilhe

This comment has been minimized.

@cplee cplee removed the stale label Jul 16, 2020
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label Sep 15, 2020
@jcansdale

This comment has been minimized.

@cplee cplee removed the stale label Nov 8, 2020
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label Jan 8, 2021
@adnathanail

This comment has been minimized.

@jonioni
Copy link

jonioni commented Feb 1, 2021

Still care +1. This may also solve certain scenarios as in #119 and #107 without having to download a 20GB image.

@catthehacker
Copy link
Member

Are the plans to add support for windows & mac still active?

The issue is not closed so...

@FranklinYu
Copy link

You all are clearly quite ahead of me but one more thought I'd like to add, perhaps adding support for qemu might be interesting. It would likely be a lot more work, but it would pave the way to for full macOS and Windows support.

macOS on QEMU on KVM is against Apple EULA (End User License Agreement), FYI. This at least mean that support will be limited, and bug will be expected.

Not sure about Windows; perhaps they allow you to run Windows VM without a license?

@jacob-carlborg
Copy link

macOS on QEMU on KVM is against Apple EULA

You're allowed to virtualize macOS on Apple hardware.

@FranklinYu
Copy link

That's too much work for such little project especially since what you linked, those projects are not written in Go so it will be hard to make them work together.

How about https://github.com/penberg/go-osxhv? Direct cgo binding of Hypervisor Framework (i.e. the backend of xhyve).

@fugkco
Copy link

fugkco commented Dec 21, 2021

macOS on QEMU on KVM is against Apple EULA (End User License Agreement), FYI. This at least mean that support will be limited, and bug will be expected.

Not sure about Windows; perhaps they allow you to run Windows VM without a license?

It's not up to this project to figure out licensing anyway. It's up to the individual user of it to ensure they don't run Windows and macOS against Microsoft/Apple ToS.

@fugkco
Copy link

fugkco commented Dec 21, 2021

qemu has absolutely terrible performance and breaks easily

I guess when I said qemu I meant qemu-kvm which should provide near native speeds. I can't say much about it breaking easily though as I've always used it through frontends.

@jacob-carlborg
Copy link

How about https://github.com/penberg/go-osxhv? Direct cgo binding of Hypervisor Framework (i.e. the backend of xhyve).

You would need to reimplement a hypervisor, basically what Xhyve and QEMU are already doing. Probably a huge amount of work.

@davetapley
Copy link
Contributor

Just to throw it out there: If ⬇️ ever gets done then that might be another way to support Windows runners?

@Lewiscowles1986
Copy link

Perhaps a point others have considered. But why would running locally be the default for no-container, versus something like specifying an IP to a machine; which could just be a vagrant to use a VM to run in? I Feel like this must be what GitHub is doing anyway if they are providing a clean-room on every run. Just build a box (nee golden image); provide ssh to connect to and pull files from, run some commands. When done, run a command to "clean" the box (in case of a VM, stop it, delete it, spin up another for next-time command runs).

@catthehacker
Copy link
Member

But why would running locally be the default for no-container, versus something like specifying an IP to a machine; which could just be a vagrant to use a VM to run in?

Because you can just use ssh and then act inside it. Sure it's less convenient, but re-implementing remote execution or implementing 3rd party lib adds a maintainenace burden and requires manpower.

@Lewiscowles1986
Copy link

I'm fairly certain the request is because this won't run windows or macosx regardless of them being in a vm, but okay. Thanks for quick response.

@lotyp
Copy link

lotyp commented May 1, 2022

Maybe this can help ? https://github.com/sickcodes/Docker-OSX

Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! > macOS in a Docker container!

This project is built on top of upstream project: https://github.com/kholia/OSX-KVM

@catthehacker
Copy link
Member

Maybe this can help ? sickcodes/Docker-OSX

Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! > macOS in a Docker container!

This project is built on top of upstream project: kholia/OSX-KVM

Please read before posting. I already mentioned it and it doesn't solve the issue as it runs Docker inside Linux VM inside macOS VM as Docker container.

@lotyp
Copy link

lotyp commented May 13, 2022

Maybe this can help ? sickcodes/Docker-OSX

Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! > macOS in a Docker container!

This project is built on top of upstream project: kholia/OSX-KVM

Please read before posting. I already mentioned it and it doesn't solve the issue as it runs Docker inside Linux VM inside macOS VM as Docker container.

Sorry, but this thread is so long, and your answer was under spoiler. You can check that on this screen:

image

@grigorye
Copy link
Contributor

grigorye commented Jul 20, 2022

Just to let you know, on macOS, we're experimenting with a custom shim for bash that lets us employ local "runners" (setup from the pool of dedicated macOS users) over ssh. We did not get it to perfection atm, but you get the idea.

@ChristopherHX
Copy link
Contributor

I finally created a PR of my non docker execution environment: #1293, based on my initial work #97 (comment)

This just runs commands on your host device, without any virtualization technology. If you want to exec commands on a VM, just download act to it and run it there. Docker actions are not supported.

Maybe you can help finding bugs, because it has limited test cases for non linux platforms.

@ChrisKader
Copy link

As for Windows, we could go the route of Docker Desktop or the even cooler route of "forcing" docker to run inside a WSL 2 container so we then can have windows running WSL 2 which then has a docker instance to then run windows VMs.

@lublak
Copy link

lublak commented Sep 7, 2022

what about https://hub.docker.com/_/microsoft-windows-base-os-images windows based images to have a "real" runner?

@xwartz

This comment was marked as spam.

@mergify mergify bot closed this as completed in #1293 Nov 16, 2022
@duolabmeng6
Copy link

I also need to run tests in macos. I want to build software that I hope can support.

@honeyspoon
Copy link

TLDR;
act -P macos-latest=-self-hosted

For anybody looking at this in the future and wants to run their actions that require macOS like building and iOS app.
You can do it locally with that command.

@melMass
Copy link

melMass commented Jul 24, 2023

I think this should be stated in the readme directly, you are linking this issue while the flag in the title does not exist

@NewtonChutney
Copy link

TLDR;
act -P macos-latest=-self-hosted

Is Windows support added too.. as like MacOS?

@ChristopherHX
Copy link
Contributor

There are a lot more possibilities to use that experimental mode.

Just to name a few

act -P windows-latest=-self-hosted
act -P ubuntu-latest=-self-hosted
act -P macos-latest=-self-hosted
act -P freebsd-latest=-self-hosted

<label>=-self-hosted, <label> can be replaced by what you use in runs-on. Due to a bug in act choose only one of possible many labels of your runs-on. E.g. runs-on: [abc, bcd] both -P abc=-self-hosted and -P bcd=-self-hosted would work.

You must be running act on that operating system or it is logically wrong. The -self-hosted pseudo image platform is a replacement for the docker image normally used inside that option.

Problems with --no-container and why it doesn't exist yet.

  • What if you use a self-hosted Runner with a custom runner label?
  • Should act run all platforms on your host including those logging unsupported? That would run macOS jobs on a windows rost and vice versa.

Never heard from freebsd-latest? It's a possible platform like solaris, netbsd, plan9 and more in github-act-runner a self-hosted runner for GitHub Actions using their protocol for accepting jobs

This is experimental, almost no tests run in CI for macos and windows in that mode. I wouldn't use the word supported in this context

The ci checks of this experimental mode are not required, that means if dependablebot opens a PR whichs breaks the mode it will be merged without waiting for any maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runner Relating to errors in the runner kind/feature-request New feature or request needs-work Extra attention is needed stale-exempt Exempt from stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.