|
| 1 | +--- |
| 2 | +title: Setting up Dependabot to run on self-hosted action runners using the Actions Runner Controller |
| 3 | +intro: You can configure the {% data variables.product.prodname_actions_runner_controller %} to run {% data variables.product.prodname_dependabot %} on self-hosted runners. |
| 4 | +versions: |
| 5 | + feature: dependabot-arc-support |
| 6 | +permissions: '{% data reusables.permissions.dependabot-various-tasks %}' |
| 7 | +topics: |
| 8 | + - Repositories |
| 9 | + - Dependabot |
| 10 | + - Version updates |
| 11 | + - Security updates |
| 12 | + - Dependencies |
| 13 | + - Pull requests |
| 14 | +allowTitleToDifferFromFilename: true |
| 15 | +shortTitle: Configure ARC |
| 16 | +--- |
| 17 | + |
| 18 | +## Working with the {% data variables.product.prodname_actions_runner_controller %} (ARC) |
| 19 | + |
| 20 | +{% data reusables.dependabot.arc-support-private-preview-note %} |
| 21 | + |
| 22 | +This article provides step-by-step instructions for setting up ARC on a Kubernetes cluster and configuring {% data variables.product.prodname_dependabot %} to run on self-hosted action runners. The article: |
| 23 | + |
| 24 | +* Contains an overview of the ARC and {% data variables.product.prodname_dependabot %} integration. |
| 25 | +* Provides detailed installation and configuration steps using helm scripts. |
| 26 | + |
| 27 | +## What is ARC? |
| 28 | + |
| 29 | +The {% data variables.product.prodname_actions_runner_controller %} is a Kubernetes controller that manages self-hosted {% data variables.product.prodname_actions %} as Kubernetes pods. It allows you to dynamically scale and orchestrate runners based on your workflows, providing better resource utilization and integration with Kubernetes environments. See [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/about-actions-runner-controller). |
| 30 | + |
| 31 | +## {% data variables.product.prodname_dependabot %} on ARC |
| 32 | + |
| 33 | +You can run {% data variables.product.prodname_dependabot %} on self-hosted {% data variables.product.prodname_actions %} runners managed within a Kubernetes cluster via ARC. This enables auto-scaling, workload isolation, and better resource management for {% data variables.product.prodname_dependabot %} jobs, ensuring that dependency updates can run efficiently within an organization's controlled infrastructure while integrating seamlessly with {% data variables.product.prodname_actions %}. |
| 34 | + |
| 35 | +## Setting up ARC for {% data variables.product.prodname_dependabot %} on your Local environment |
| 36 | + |
| 37 | +### Prerequisites |
| 38 | + |
| 39 | +* A Kubernetes cluster |
| 40 | + * For a managed cloud environment, you can use Azure Kubernetes Service (AKS). |
| 41 | + * For a local setup, you can use minikube. |
| 42 | +* Helm |
| 43 | + * A package manager for Kubernetes. |
| 44 | + |
| 45 | +### Setting up ARC |
| 46 | + |
| 47 | +1. Install ARC. For more information, see [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller). |
| 48 | +1. Create a work directory for the ARC setup and create a shell script file (for example, `helm_install_arc.sh`) to install the latest ARC version. |
| 49 | + |
| 50 | + ```bash copy |
| 51 | + mkdir ARC |
| 52 | + touch helm_install_arc.sh |
| 53 | + chmod 755 helm_install_arc.sh |
| 54 | + ``` |
| 55 | + |
| 56 | +1. Edit `helm_install_arc.sh` with this bash script for installing ARC. |
| 57 | + |
| 58 | + ```text copy |
| 59 | + NAMESPACE="arc-systems" |
| 60 | + helm install arc \ |
| 61 | + --namespace "${NAMESPACE}" \ |
| 62 | + --create-namespace \ |
| 63 | + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller |
| 64 | + ``` |
| 65 | + |
| 66 | +1. Execute the `helm_install_arc.sh` script file. |
| 67 | + |
| 68 | + ```bash |
| 69 | + ./helm_install_arc.sh |
| 70 | + ``` |
| 71 | + |
| 72 | +1. Now, you need to configure the runner scale set. For this, let's start by creating and editing a file with the following bash script. |
| 73 | +
|
| 74 | + ```bash copy |
| 75 | + touch arc-runner-set.sh |
| 76 | + chmod 755 arc-runner-set.sh |
| 77 | + ``` |
| 78 | +
|
| 79 | + ```text copy |
| 80 | + INSTALLATION_NAME="dependabot" |
| 81 | + NAMESPACE="arc-runners" |
| 82 | + GITHUB_CONFIG_URL=REPO_URL |
| 83 | + GITHUB_PAT=PAT |
| 84 | + helm install "${INSTALLATION_NAME}" \ |
| 85 | + --namespace "${NAMESPACE}" \ |
| 86 | + --create-namespace \ |
| 87 | + --set githubConfigUrl="${GITHUB_CONFIG_URL}" \ |
| 88 | + --set githubConfigSecret.github_token="${GITHUB_PAT}" \ |
| 89 | + --set containerMode.type="dind" \ |
| 90 | + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set |
| 91 | + ``` |
| 92 | +
|
| 93 | +1. Execute the `arc-runner-set.sh` script file. |
| 94 | +
|
| 95 | + ```bash copy |
| 96 | + ./arc-runner-set.sh |
| 97 | + ``` |
| 98 | +
|
| 99 | +> [!NOTE] |
| 100 | +> |
| 101 | +> * The installation name of the runner scale set has to be `dependabot` in order to target the dependabot job to the runner. |
| 102 | +> * The `containerMode.type="dind"` configuration is required to allow the runner to connect to the Docker daemon. |
| 103 | +> * If an organization-level or enterprise-level runner is created, then the appropriate scopes should be provided to the {% data variables.product.pat_generic_title_case %} (PAT). |
| 104 | +> * A {% data variables.product.pat_v1 %} (PAT) can be created. The token should have the following scopes based on whether you are creating a repository, organization or enterprise level runner scale set. |
| 105 | +> * Repository level: **repo** |
| 106 | +> * Organization level: **admin:org** |
| 107 | +> * Enterprise level: **admin:enterprise**\ |
| 108 | +> For information about creating a {% data variables.product.pat_v1 %}, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). |
| 109 | +
|
| 110 | +### Adding runner groups |
| 111 | +
|
| 112 | +Runner groups are used to control which organizations or repositories have access to runner scale sets. To add a runner scale set to a runner group, you must already have a runner group created. |
| 113 | +
|
| 114 | +For information about creating runner groups, see [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners/managing-access-to-self-hosted-runners-using-groups#creating-a-self-hosted-runner-group-for-an-organization). |
| 115 | +
|
| 116 | +Don't forget to add the following setting to the runner scale set configuration in the helm chart. |
| 117 | + |
| 118 | + ```text copy |
| 119 | + --set runnerGroup="<Runner group name>" \ |
| 120 | + ``` |
| 121 | + |
| 122 | +### Checking your installation |
| 123 | + |
| 124 | +1. Check your installation. |
| 125 | + |
| 126 | + ```bash copy |
| 127 | + helm list -A |
| 128 | + ``` |
| 129 | + |
| 130 | + Output: |
| 131 | + |
| 132 | + ```text |
| 133 | + ➜ ARC git:(master) ✗ helm list -A |
| 134 | + NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION |
| 135 | + arc arc-systems 1 2025-04-11 14:41:53.70893 -0500 CDT deployed gha-runner-scale-set-controller-0.11.0 0.11.0 |
| 136 | + arc-runner-set arc-runners 1 2025-04-11 15:08:12.58119 -0500 CDT deployed gha-runner-scale-set-0.11.0 0.11.0 |
| 137 | + dependabot arc-runners 1 2025-04-16 21:53:40.080772 -0500 CDT deployed gha-runner-scale-set-0.11.0 |
| 138 | + ``` |
| 139 | + |
| 140 | +1. Check the manager pod using this command. |
| 141 | + |
| 142 | + ```bash copy |
| 143 | + kubectl get pods -n arc-systems |
| 144 | + ``` |
| 145 | + |
| 146 | + Output: |
| 147 | + |
| 148 | + ```text |
| 149 | + ➜ ARC git:(master) ✗ kubectl get pods -n arc-systems |
| 150 | +
|
| 151 | + NAME READY STATUS RESTARTS AGE |
| 152 | + arc-gha-rs-controller-57c67d4c7-zjmw2 1/1 Running 8 (36h ago) 6d9h |
| 153 | + arc-runner-set-754b578d-listener 1/1 Running 0 11h |
| 154 | + dependabot-754b578d-listener 1/1 Running 0 14h |
| 155 | + ``` |
| 156 | + |
| 157 | +### Setting up {% data variables.product.prodname_dependabot %} |
| 158 | + |
| 159 | +{% ifversion fpt or ghec %} |
| 160 | + |
| 161 | +{% data reusables.repositories.navigate-to-repo %} |
| 162 | +{% data reusables.repositories.sidebar-settings %} |
| 163 | +{% data reusables.repositories.navigate-to-code-security-and-analysis %} |
| 164 | + |
| 165 | +1. Under "{% data variables.product.prodname_dependabot %}", scroll to "{% data variables.product.prodname_dependabot %} on Action Runners", and select **Enable** for "{% data variables.product.prodname_dependabot %} on self-hosted runners". |
| 166 | + |
| 167 | +{% elsif ghes %} |
| 168 | + |
| 169 | +1. Create an organization on {% data variables.product.prodname_ghe_server %}. For more information, see [AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch). |
| 170 | +1. Create a runner group. See [Adding runner groups](#adding-runner-groups). |
| 171 | +1. Enable the dependency graph from the {% data variables.enterprise.management_console %}. See [AUTOTITLE](/admin/managing-code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise#enabling-the-dependency-graph-via-the-management-console). |
| 172 | +1. Enable {% data variables.product.prodname_github_connect %} for your enterprise. See [AUTOTITLE](/admin/configuring-settings/configuring-github-connect/enabling-github-connect-for-githubcom#enabling-github-connect). |
| 173 | +1. Enable {% data variables.product.prodname_dependabot_alerts %} for the enterprise. See [AUTOTITLE](/admin/configuring-settings/configuring-github-connect/enabling-dependabot-for-your-enterprise#enabling-dependabot-alerts). |
| 174 | + |
| 175 | +{% endif %} |
| 176 | + |
| 177 | +## Triggering a {% data variables.product.prodname_dependabot %} run |
| 178 | + |
| 179 | +Now that you've set up ARC, you can start a {% data variables.product.prodname_dependabot %} run. |
| 180 | +
|
| 181 | +{% data reusables.repositories.navigate-to-repo %} |
| 182 | +{% data reusables.repositories.navigate-to-insights %} |
| 183 | +{% data reusables.repositories.click-dependency-graph %} |
| 184 | +
|
| 185 | +1. Under "Dependency graph", click **{% data variables.product.prodname_dependabot %}**. |
| 186 | +1. To the right of the name of manifest file you're interested in, click **Recent update jobs**. |
| 187 | +1. If there are no recent update jobs for the manifest file, click **Check for updates** to re-run a {% data variables.product.prodname_dependabot %} version updates'job and check for new updates to dependencies for that ecosystem. |
| 188 | +
|
| 189 | +## Viewing the generated ARC runners |
| 190 | +
|
| 191 | +You can the ARC runners that have been created for the {% data variables.product.prodname_dependabot %} job. |
| 192 | +
|
| 193 | +{% data reusables.repositories.navigate-to-repo %} |
| 194 | +{% data reusables.repositories.actions-tab %} |
| 195 | +
|
| 196 | +1. On the left sidebar, click **Runners**. |
| 197 | +1. Under "Runners", click **Self-hosted runners** to view the list of all the runners available in the repository. You can see the ephemeral dependabot runner that has been created. |
| 198 | +  |
| 199 | +
|
| 200 | + You can also view the same dependabot runner pod created in your kubernetes cluster from the terminal by executing this command. |
| 201 | +
|
| 202 | + ```text copy |
| 203 | + ➜ ARC git:(master) ✗ kubectl get pods -n arc-runners |
| 204 | + NAME READY STATUS RESTARTS AGE |
| 205 | + dependabot-sw8zn-runner-4mbc7 2/2 Running 0 46s |
| 206 | + ``` |
| 207 | +
|
| 208 | +Additionally, you can verify: |
| 209 | +
|
| 210 | +* The logs, by checking the runner and machine name. See [AUTOTITLE](/code-security/dependabot/troubleshooting-dependabot/viewing-dependabot-job-logs). |
| 211 | +
|
| 212 | +  |
| 213 | +
|
| 214 | +* The version update pull requests created by the dependabot job in the **Pull requests** tab of the repository. |
0 commit comments