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

Is a self-hosted Windows runner even possible? #637

Open
JanikHelbig-NB opened this issue Mar 11, 2024 · 2 comments
Open

Is a self-hosted Windows runner even possible? #637

JanikHelbig-NB opened this issue Mar 11, 2024 · 2 comments
Labels
question Further information is requested windows Microsoft Windows Platform

Comments

@JanikHelbig-NB
Copy link

JanikHelbig-NB commented Mar 11, 2024

Hi!

I'm currently trying to set up a bare-metal, self-hosted Windows runner for workflows using unity-builder@v4.
However, I keep running into issues and I'm starting to wonder if it's been futile from the start.

I'm a bit confused by the documentation in regards to this. The guide for setting up a self hosted runner in the Game-CI docs makes no mention of windows at all and the GitHub Actions documentation states here that "you must use a Linux machine" to use actions utilizing docker containers. (Which I assume refers to actions such as this.)

For a little more context, I'm running into this error:

...
Building locally
"C:\Program Files\Docker\Docker\resources\bin\docker.exe" run --workdir c:/github/workspace --rm ((flags omitted for brevity)) powershell c:/steps/entrypoint.ps1
docker: Error response from daemon: the working directory 'c:/github/workspace' is invalid, it needs to be an absolute path.
See 'docker run --help'.
Error: Build failed with exit code 125

This error does not occur when running the same workflow on a GitHub-hosted Windows runner.
I'm not sure if this is an issue I can fix on my end or if there is some magic happening with GitHub's runners that I don't understand.

@CheeryLee
Copy link

In our case we have built CI/CD pipeline on top of Cygwin and host installation of Unity. No Docker used due to it's limitations. Therefore it's possible. Yes, this method does not provide complete isolation, but it is still fully functional.

However, it is worth saying that our configuration is already very different from the one presented in this repository. We have chosen the way to not to separate build scripts but stay on vanilla Bash with POSIX compatible instructions that are working both on Linux and Windows as well. In this case all you need to do is install Cygwin or MSYS (note: these things are different and have various POSIX compatibility) and change system related paths.

Unity binaries installation and license resolution work via Unity Hub, so you must have an access to a build machine via RDP or something else. Install all required versions of engine and activate the license once.

@webbertakken
Copy link
Member

webbertakken commented Mar 22, 2024

@JanikHelbig-NB builder on Windows just runs a docker command https://github.com/game-ci/unity-builder/blob/main/src/model/docker.ts#L91, not much different from what happens on the ubuntu variant.

Regarding the quote from GitHub Actions docs

If you want to run workflows that use Docker container actions or service containers, you must use a Linux machine and Docker must be installed.

I'd take that as a recommendation and as a word of warning for if you want "official support". However there's no reason why a windows runner wouldn't be able to run docker. In fact the very error you're getting indicates that docker is installed and works (as the error comes from the docker daemon).

Looks like the folder might not exist and the error is a bit misleading saying it's not an absolute path, or otherwise it might be a quoting issue.

Generally if things work on the GitHub hosted runners, then it should work on your runner too, as long as you use the official images (i.e. exactly the ones as GitHub hosted is running too).

The reason why I'm saying that is that people have reported problems before with different images. For example a docker-instanced runner has given people trouble because of the lack of DinD support and the instances not being exactly equal to the actual images that GitHub hosted runs on.

@davidmfinol davidmfinol added question Further information is requested windows Microsoft Windows Platform labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested windows Microsoft Windows Platform
Projects
None yet
Development

No branches or pull requests

4 participants