Skip to content

GH-200 · Domain 4: Manage GitHub Actions for the enterprise · 24% of the exam

Task 4.2: Manage runners at scale

GitHub-hosted, larger and self-hosted runners, runner groups and labels, Actions Runner Controller, networking and IP allow lists, runner images and installed software, and runner troubleshooting.

Study it

  • GitHub-hosted, larger and self-hosted runners, runner groups and networking

    Lesson coming

  • Actions Runner Controller and runner scale sets on Kubernetes

    Partly covered by: Pods, ReplicaSets & Deployments

Sample questions

Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.

Question 1 · choose 2

A platform team is building autoscaling for self-hosted runners on virtual machines and plans to register them with --ephemeral. Which two statements are true? (Choose TWO.)

  1. AGitHub wipes and reimages the machines after each job
  2. BEach runner is de-registered after it processes one job
  3. CGitHub recommends persistent runners for autoscaling, with ephemeral ones as a fallback
  4. DAn ephemeral runner keeps taking jobs from the same workflow run
  5. ERunner logs should be forwarded to external storage before the machines are removed
Show the answer and why
  • AGitHub wipes and reimages the machines after each job

    Incorrect

    GitHub de-registers the runner; wiping the machine is up to your automation.

  • BEach runner is de-registered after it processes one job

    Correct

    The service removes an ephemeral runner's registration after one job.

  • CGitHub recommends persistent runners for autoscaling, with ephemeral ones as a fallback

    Incorrect

    GitHub recommends ephemeral runners for autoscaling, not persistent ones.

  • DAn ephemeral runner keeps taking jobs from the same workflow run

    Incorrect

    An ephemeral runner gets exactly one job.

  • ERunner logs should be forwarded to external storage before the machines are removed

    Correct

    GitHub recommends forwarding ephemeral runners' log files to an external store for troubleshooting.

GitHub recommends autoscaling with ephemeral self-hosted runners, because it can then guarantee that only one job is assigned to each runner. Registering with --ephemeral makes the service de-register the runner after one job; your automation then wipes or replaces the machine. Ephemeral runners' log files should be forwarded to an external store before such a setup goes to production.

Question 2 · choose 1

Self-hosted runners in a locked-down network can reach github.com, api.github.com and *.actions.githubusercontent.com over HTTPS. Jobs start and steps run, but uploading artifacts and saving caches fail. Which domains should the network team allow next?

  1. Acodeload.github.com
  2. Bghcr.io and *.pkg.github.com
  3. Cobjects.githubusercontent.com
  4. Dresults-receiver.actions.githubusercontent.com and *.blob.core.windows.net
Show the answer and why
  • Acodeload.github.com

    Incorrect

    That domain is used to download actions.

  • Bghcr.io and *.pkg.github.com

    Incorrect

    Those serve GitHub Packages, not artifacts and caches.

  • Cobjects.githubusercontent.com

    Incorrect

    That domain serves runner version updates.

  • Dresults-receiver.actions.githubusercontent.com and *.blob.core.windows.net

    Correct

    GitHub lists these for uploading and downloading job summaries, logs, artifacts and caches; the blob storage domain isn't covered by the domains already allowed.

Self-hosted runners make outbound HTTPS connections over port 443. Besides the essential domains, uploading and downloading job summaries, logs, workflow artifacts and caches need results-receiver.actions.githubusercontent.com and *.blob.core.windows.net; other functions, such as downloading actions, packages and runner updates, need their own domains.

Question 3 · choose 1

A build passed yesterday and fails today on ubuntu-latest because a compiler version changed. The team wants to see exactly which runner image version and preinstalled tool versions each run used. Where should it look first?

  1. AThe workflow's status badge
  2. BThe repository's dependency graph
  3. CThe cache usage page in the Actions settings
  4. DThe Set up job step of each run's log
Show the answer and why
  • AThe workflow's status badge

    Incorrect

    A badge shows pass or fail only.

  • BThe repository's dependency graph

    Incorrect

    The dependency graph lists project dependencies, not runner software.

  • CThe cache usage page in the Actions settings

    Incorrect

    That page shows cache sizes.

  • DThe Set up job step of each run's log

    Correct

    On GitHub-hosted runners, it records the image details and links to the list of preinstalled tools.

For jobs on GitHub-hosted runners, the Set up job step records details of the runner image and includes a link to the list of preinstalled tools on that runner. The actions/runner-images repository publishes the images and their release notes.

Question 4 · choose 1

Persistent self-hosted runners keep leftover files from earlier jobs in their work directory, and some builds pick them up. The team wants a cleanup script to run on the runner before every job, without changing any workflow. What should it set?

  1. AACTIONS_RUNNER_HOOK_JOB_STARTED with the script's absolute path
  2. BA first step in every workflow that deletes the leftover work directory
  3. CACTIONS_STEP_DEBUG set to true
  4. DA pre-job script stored inside the actions-runner directory
Show the answer and why
  • AACTIONS_RUNNER_HOOK_JOB_STARTED with the script's absolute path

    Correct

    The runner runs that script after a job is assigned and before it starts.

  • BA first step in every workflow that deletes the leftover work directory

    Incorrect

    That changes every workflow, which the stem rules out.

  • CACTIONS_STEP_DEBUG set to true

    Incorrect

    That only adds debug logging.

  • DA pre-job script stored inside the actions-runner directory

    Incorrect

    Hook scripts shouldn't be kept in the runner application directory.

Self-hosted runners can run scripts before or after a job. When the ACTIONS_RUNNER_HOOK_JOB_STARTED or ACTIONS_RUNNER_HOOK_JOB_COMPLETED variable, set in the system or in the runner's .env file, holds a script's absolute path, the runner runs it. Scripts shouldn't be stored in the actions-runner directory.

Question 5 · choose 1

An administrator registers ten new self-hosted runners without naming a runner group, then wants five of them in both the build and the release groups. What applies?

  1. ANew runners join every group the repository can use
  2. BRunners can be in several groups at once if each group uses different labels
  3. CThe runners start in the default group, and each can be in only one group
  4. DRunners must be re-registered to change groups
Show the answer and why
  • ANew runners join every group the repository can use

    Incorrect

    New runners go to the default group unless another is given.

  • BRunners can be in several groups at once if each group uses different labels

    Incorrect

    Labels don't change group membership.

  • CThe runners start in the default group, and each can be in only one group

    Correct

    A runner belongs to one group at a time, so the five can't be in both.

  • DRunners must be re-registered to change groups

    Incorrect

    Runners can be moved between groups.

New runners are assigned to the default group unless another group is specified. A runner can be in only one group at a time, and runners can be moved from one group to another.

Question 6 · choose 1

A new self-hosted runner is registered on a Linux x64 machine without custom labels. Which labels does it get by default?

  1. Aubuntu-latest
  2. Bdefault only
  3. Cself-hosted, linux and x64
  4. DNo labels such as self-hosted or linux until an administrator adds them
Show the answer and why
  • Aubuntu-latest

    Incorrect

    That is a GitHub-hosted runner label.

  • Bdefault only

    Incorrect

    No label named default is applied to new runners.

  • Cself-hosted, linux and x64

    Correct

    Runners get the self-hosted label plus their operating system and architecture.

  • DNo labels such as self-hosted or linux until an administrator adds them

    Incorrect

    Default labels are added at registration.

Self-hosted runners receive default labels: self-hosted, the operating system and the architecture. The --no-default-labels flag prevents the self-hosted label from being applied.

Question 7 · choose 1

In the organization's runner list, a self-hosted runner shows the status Idle. What does that mean?

  1. AIt lost its connection to GitHub Actions for now
  2. BIt is connected and ready to take a job
  3. CIt is running a job
  4. DIt was disabled by a policy
Show the answer and why
  • AIt lost its connection to GitHub Actions for now

    Incorrect

    That is shown as Offline.

  • BIt is connected and ready to take a job

    Correct

    Idle runners are connected and waiting for work.

  • CIt is running a job

    Incorrect

    That is shown as Active.

  • DIt was disabled by a policy

    Incorrect

    That is shown as Disabled.

A self-hosted runner's status is Idle when it is connected to GitHub and ready to execute jobs, Active while it runs a job, and Offline when it isn't connected.

Question 8 · choose 1

A developer on a GitHub Free personal account wants a 16-core larger runner for builds. What does GitHub document?

  1. AAny account can add one after a payment method is on file
  2. BGitHub Free includes one larger runner per account
  3. CLarger runners require self-hosted runner groups
  4. DLarger runners are for organizations and enterprises on GitHub Team or GitHub Enterprise Cloud
Show the answer and why
  • AAny account can add one after a payment method is on file

    Incorrect

    A payment method alone doesn't make larger runners available.

  • BGitHub Free includes one larger runner per account

    Incorrect

    Larger runners aren't part of the GitHub Free plan.

  • CLarger runners require self-hosted runner groups

    Incorrect

    Larger runners are hosted by GitHub.

  • DLarger runners are for organizations and enterprises on GitHub Team or GitHub Enterprise Cloud

    Correct

    Personal accounts on GitHub Free can't add larger runners.

Larger runners are only available for organizations and enterprises using the GitHub Team or GitHub Enterprise Cloud plans, so a personal account on GitHub Free can't add one. They are hosted by GitHub, not self-hosted.

Question 9 · choose 1

A team moves small linting jobs to the ubuntu-slim label. How does that runner differ from ubuntu-latest?

  1. AIt is a single-CPU runner hosted in a container on a shared VM
  2. BIt runs as a runner on the team's own machines
  3. CIt has more memory than ubuntu-latest
  4. DIt can run Docker container actions only
Show the answer and why
  • AIt is a single-CPU runner hosted in a container on a shared VM

    Correct

    Single-CPU runners run in a container, while other hosted runners are new VMs.

  • BIt runs as a runner on the team's own machines

    Incorrect

    ubuntu-slim is a GitHub-hosted label.

  • CIt has more memory than ubuntu-latest

    Incorrect

    It has one CPU and less memory.

  • DIt can run Docker container actions only

    Incorrect

    It is meant for light automation jobs in general, not for one kind of action.

Except for single-CPU runners, each GitHub-hosted runner is a new virtual machine. The single-CPU ubuntu-slim runner is hosted in a container on a shared VM, with one CPU and 5 GB of memory.

Practice domain 4 →Practice all domains →