util: Move runners from gem5 repository to gem5 org
There are two places self-hosted runners can exist on GitHub: 1. At the level of the repository: In this case the runners can only be used by that repository and runners can only be distinguished from one another by labels. 2. At the level of the organization: In this case the runners can be used by any repository in the organization, thus increasing their versatility. In addition to labels, runners in the level of the organization can be organized into groups. While we do not use our self-hosted runners on other repositories, there may be future use for this, so we might as well enable it now. Change-Id: Id5e113194314336221dcdc8c2858b352afcbaf6e
This commit is contained in:
@@ -26,8 +26,7 @@ sudo apt purge vagrant-libvirt
|
||||
First, generate a Personal Access Token, which you can create [here](https://github.com/settings/tokens)
|
||||
Make sure to set admin permissions on this token, then replace the of `<PERSONAL ACCESS TOKEN>` in the Vagrantfile with your token.
|
||||
|
||||
Next, replace instances of `<GITHUB REPO>` with your GitHub account name and the repository name, separated by a forward slash.
|
||||
For example, if your GitHub account name is `example` and your repository name is `example-repo`, you would replace `<GITHUB REPO>` with `example/example-repo`.
|
||||
Next, replace instances of `<GITHUB_ORG>` with your GitHub organization you wish to add this runner.
|
||||
|
||||
## Install Vagrant Plugins
|
||||
|
||||
@@ -62,7 +61,7 @@ vagrant up --provider=libvirt
|
||||
```
|
||||
|
||||
This should automatically create your machine, as well as configure and start up a Github Actions runner.
|
||||
You can check the status of the runner here: https://github.com/<account>/<repo>/settings/actions/runners
|
||||
You can check the status of the runner here: https://github.com/organizations/{GITHUB_ORG}/settings/actions/runners
|
||||
|
||||
If the runner ever shows as offline, you can rerun the `vagrant up --provider=libvirt` command to make sure everything is working properly.
|
||||
|
||||
|
||||
4
util/github-runners-vagrant/Vagrantfile
vendored
4
util/github-runners-vagrant/Vagrantfile
vendored
@@ -37,10 +37,10 @@ Vagrant.configure("2") do |config|
|
||||
# configure the runner
|
||||
# echo automatically sets the name of the runner, and the tags
|
||||
# create a personal access token with admin permission and copy it into the curl command
|
||||
echo -ne '\n\nrun\n\n' | ./config.sh --url https://github.com/<GITHUB REPO> --token $(curl -L \
|
||||
echo -ne '\n\nrun\n\n' | ./config.sh --url https://github.com/<GITHUB_ORG> --token $(curl -L \
|
||||
-X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer <PERSONAL ACCESS TOKEN>" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/<GITHUB REPO>/actions/runners/registration-token | jq -r '.token')
|
||||
https://api.github.com/orgs/${GITHUB_ORG}/actions/runners/registration-token | jq -r '.token')
|
||||
# start the runner
|
||||
nohup ./run.sh &
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user