-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: compatibility with self-hosted runners with SELinux #355
Conversation
When using a self-hosted runner with SELinux (fedora) volumes need to be mounted with ":z" in order to have write access these flags are documented [here](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label)
src/model/docker.ts
Outdated
const github_home = join(runnerTemporaryPath, "_github_home"); | ||
existsSync(github_home) || mkdirSync(github_home); | ||
const github_workflow = join(runnerTemporaryPath, "_github_workflow"); | ||
existsSync(github_workflow) || mkdirSync(github_workflow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these directories should exist according to the spec. Could you explain a little bit about why this is needed?
Also prefer the more semantic if(condition) // do something
over ||
which makes the code harder to read for new developers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do exist in github runners, but when running in self-hosted runners, the _temp folder is completely empty.
I get this error:
Error: statfs /var/github/_temp/_github_home: no such file or directory
Error: The process '/usr/bin/docker' failed with exit code 125
I worked around the problem by doing this in my workflow:
# this is a workaround for self hosted runners
- name: Create Folders
run: |
cd $RUNNER_TEMP
mkdir -p _github_home
mkdir -p _github_workflow
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneLinux64
buildMethod: com.mindblocks.build.BuildAutomation.LinuxServer
and that worked.
I will change them to if
Could you run Also make sure you install ESLint and Prettier plugins in your editor. |
similar to game-ci/unity-builder#355 * Use $RUNNER_TEMP variable instead of hardcoded path for _github_home and _github_workflow * create the folders if they don't exist * mount volumes with :z for compatibility with SELinux
similar to game-ci/unity-builder#355 * Use $RUNNER_TEMP variable instead of hardcoded path for _github_home and _github_workflow * create the folders if they don't exist * mount volumes with :z for compatibility with SELinux
Thank you very much! |
* feat: support self-hosted runners similar to game-ci/unity-builder#355 * Use $RUNNER_TEMP variable instead of hardcoded path for _github_home and _github_workflow * create the folders if they don't exist * mount volumes with :z for compatibility with SELinux * compile typescript files
When using a self-hosted runner with SELinux (fedora)
volumes need to be mounted with ":z" in order to have write access
these flags are documented here
Also the in self-hosted runners, _temp is empty, so this creates the child folders.
Changes
Checklist