Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You will need an on-prem machine and service account to run the runner. Either you or someone from ESCP will need root privilege to configure the service. Please contact escp-ticket@tufts.edu to create these.

After you’re able to login to the machine, and become the service account (i.e. sudo su - gitrunner1), open a web browser and browse to your repository.service account is created, someone with root privileges should do this:

  • In your web browser, browse to your repository.

  • Go to Settings > Actions > Runners > New Self-Hosted Runner.

  • It will give you a series of commands to paste into the terminal, downloading and extracting a tarball. Then when you get to the config line, here are additional instructions:

    Code Block$

    . Instead of pasting them into the terminal, do this:

    • Find the line that says "./config.sh

    • --url

    [
    • =...

    .] # !!!! # !!!! When prompted for name of runner group, just press enter for default. # !!!! When prompted for name of runner, use hostname_username, for example, myhost-dev-01_gitrunner1 # !!!! When prompted for additional labels, just press enter for default. # !!!! When prompted for work folder, press Enter for default _work # !!!! # !!!!!! DON'T DO THIS! This will launch the runner once in the terminal, # !!!!!! and it will die when you logout. Instead, see below # Last step, run it! $ ./run.sh # (Yes, do this). To run as a service: # as root: # In the following, Don't just copy and paste. Edit before doing it. # runasuser=gitrunnerX # cd /home/${runasuser}/actions-runner # ./svc.sh install ${runasuser} # It will create a service, and display the service name. You can start, such as: # systemctl enable --now actions.runner.Tufts-Technology-Services.myhost-dev-01_${runasuser} # TODO!! # selinux will block the runner. For now, just disable selinux and reboot. # To-do: We're going to have to do some of this: # https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext
    • "

    • Get the URL and the token.

    • Read the URL to ensure it's a specific repository, not the organization or whatever.

    • Run this script as root. The script installs the runner, creates the service, and launches the service as the service account. It records the URL of which repository it's working for, in the user's home directory under "actions-runner-url.txt":

      Code Block
      /root/bin/create-gitrunner.sh username GithubRepositoryURL token
    • Browse back to Actions > Runners, and confirm the new runner appears there, with a green Status, and Idle.