From 3e1c0b0714bddd973670d9a23d033cc077102487 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 4 Oct 2023 15:18:45 -0700 Subject: [PATCH] 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 --- util/github-runners-vagrant/README.md | 5 ++--- util/github-runners-vagrant/Vagrantfile | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/util/github-runners-vagrant/README.md b/util/github-runners-vagrant/README.md index 2ea5b3e588..0b93ff6693 100644 --- a/util/github-runners-vagrant/README.md +++ b/util/github-runners-vagrant/README.md @@ -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 `` in the Vagrantfile with your token. -Next, replace instances of `` 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 `` with `example/example-repo`. +Next, replace instances of `` 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///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. diff --git a/util/github-runners-vagrant/Vagrantfile b/util/github-runners-vagrant/Vagrantfile index 4bc0b85fd7..0f1eb9ee49 100644 --- a/util/github-runners-vagrant/Vagrantfile +++ b/util/github-runners-vagrant/Vagrantfile @@ -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/ --token $(curl -L \ + echo -ne '\n\nrun\n\n' | ./config.sh --url https://github.com/ --token $(curl -L \ -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer " \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos//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