diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..24a8e879 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2399a8ce..9207c3d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,13 @@ - [Opening the Pull Request](#opening-the-pull-request) - [Helm Version Changes](#helm-version-changes) - [Testing Controller Built from a Pull Request](#testing-controller-built-from-a-pull-request) + - [Release process](#release-process) + - [Workflow structure](#workflow-structure) + - [Releasing legacy actions-runner-controller image and helm charts](#releasing-legacy-actions-runner-controller-image-and-helm-charts) + - [Release actions-runner-controller runner images](#release-actions-runner-controller-runner-images) + - [Release gha-runner-scale-set-controller image and helm charts](#release-gha-runner-scale-set-controller-image-and-helm-charts) + - [Release actions/runner image](#release-actionsrunner-image) + - [Canary releases](#canary-releases) ## Welcome @@ -25,14 +32,13 @@ reviewed and merged. ## Before contributing code -We welcome code patches, but to make sure things are well coordinated you should discuss any significant change before starting the work. -The maintainers ask that you signal your intention to contribute to the project using the issue tracker. -If there is an existing issue that you want to work on, please let us know so we can get it assigned to you. -If you noticed a bug or want to add a new feature, there are issue templates you can fill out. +We welcome code patches, but to make sure things are well coordinated you should discuss any significant change before starting the work. The maintainers ask that you signal your intention to contribute to the project using the issue tracker. If there is an existing issue that you want to work on, please let us know so we can get it assigned to you. If you noticed a bug or want to add a new feature, there are issue templates you can fill out. When filing a feature request, the maintainers will review the change and give you a decision on whether we are willing to accept the feature into the project. + For significantly large and/or complex features, we may request that you write up an architectural decision record ([ADR](https://github.blog/2020-08-13-why-write-adrs/)) detailing the change. -Please use the [template](/adrs/0000-TEMPLATE.md) as guidance. + +Please use the [template](/docs/adrs/yyyy-mm-dd-TEMPLATE) as guidance. workflow_a["arc-publish.yaml"] + event_b{{"workflow_dispatch"}} -- triggers --> workflow_a["arc-publish.yaml"] + workflow_a["arc-publish.yaml"] -- uploads --> package["actions-runner-controller.tar.gz"] + end + subgraph repository: actions-runner-controller/releases + workflow_a["arc-publish.yaml"] -- triggers --> event_d{{"repository_dispatch"}} --> workflow_b["publish-arc.yaml"] + workflow_b["publish-arc.yaml"] -- push --> A["GHCR: \nactions-runner-controller/actions-runner-controller:*"] + workflow_b["publish-arc.yaml"] -- push --> B["DockerHub: \nsummerwind/actions-runner-controller:*"] + end +``` + +#### Release actions-runner-controller runner images + +**Manual steps:** + +1. Navigate to the [actions-runner-controller/releases](https://github.com/actions-runner-controller/releases) repository +2. Trigger [the release-runners.yaml](https://github.com/actions-runner-controller/releases/actions/workflows/release-runners.yaml) workflow. + 1. The list of input prameters for this workflow is defined in the table below (always inspect the workflow file for the latest version) + + +| Parameter | Description | Default | +|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| +| `runner_version` | The version of the [actions/runner](https://github.com/actions/runner) to use | `2.300.2` | +| `docker_version` | The version of docker to use | `20.10.12` | +| `runner_container_hooks_version` | The version of [actions/runner-container-hooks](https://github.com/actions/runner-container-hooks) to use | `0.2.0` | +| `sha` | The commit sha from [actions/actions-runner-controller](https://github.com/actions/actions-runner-controller) to be used to build the runner images. This will be provided to `actions/checkout` & used to tag the container images | Empty string. | +| `push_to_registries` | Whether to push the images to the registries. Use false to test the build | false | + +**Automated steps:** + +```mermaid +flowchart LR + workflow["release-runners.yaml"] -- workflow_dispatch* --> workflow_b["release-runners.yaml"] + subgraph repository: actions/actions-runner-controller + runner_updates_check["arc-update-runners-scheduled.yaml"] -- "polls (daily)" --> runner_releases["actions/runner/releases"] + runner_updates_check -- creates --> runner_update_pr["PR: update /runner/VERSION"]**** + runner_update_pr --> runner_update_pr_merge{{"merge"}} + runner_update_pr_merge -- triggers --> workflow["release-runners.yaml"] + end + subgraph repository: actions-runner-controller/releases + workflow_b["release-runners.yaml"] -- push --> A["GHCR: \n actions-runner-controller/actions-runner:* \n actions-runner-controller/actions-runner-dind:* \n actions-runner-controller/actions-runner-dind-rootless:*"] + workflow_b["release-runners.yaml"] -- push --> B["DockerHub: \n summerwind/actions-runner:* \n summerwind/actions-runner-dind:* \n summerwind/actions-runner-dind-rootless:*"] + event_b{{"workflow_dispatch"}} -- triggers --> workflow_b["release-runners.yaml"] + end +``` + +#### Release gha-runner-scale-set-controller image and helm charts + +1. Make sure the master branch is stable and all CI jobs are passing +1. Prepare a release PR (example: ) + 1. Bump up the version of the chart in: charts/gha-runner-scale-set-controller/Chart.yaml + 2. Bump up the version of the chart in: charts/gha-runner-scale-set/Chart.yaml + 1. Make sure that `version`, `appVersion` of both charts are always the same. These versions cannot diverge. + 3. Update the quickstart guide to reflect the latest versions: docs/preview/gha-runner-scale-set-controller/README.md + 4. Add changelog to the PR as well as the quickstart guide +1. Merge the release PR +1. Manually trigger the [(gha) Publish Helm Charts](https://github.com/actions/actions-runner-controller/actions/workflows/gha-publish-chart.yaml) workflow +1. Manually create a tag and release in [actions/actions-runner-controller](https://github.com/actions/actions-runner-controller/releases) with the format: `gha-runner-scale-set-x.x.x` where the version (x.x.x) matches that of the Helm chart + +| Parameter | Description | Default | +|-------------------------------------------------|--------------------------------------------------------------------------------------------------------|----------------| +| `ref` | The branch, tag or SHA to cut a release from. | default branch | +| `release_tag_name` | The tag of the controller image. This is not a git tag. | canary | +| `push_to_registries` | Push images to registries. Use false to test the build process. | false | +| `publish_gha_runner_scale_set_controller_chart` | Publish new helm chart for gha-runner-scale-set-controller. This will push the new OCI archive to GHCR | false | +| `publish_gha_runner_scale_set_chart` | Publish new helm chart for gha-runner-scale-set. This will push the new OCI archive to GHCR | false | + +#### Release actions/runner image + +A new runner image is built and published to whenever a new runner binary has been released. There's nothing to do here. + +#### Canary releases + +We publish canary images for both the legacy actions-runner-controller and gha-runner-scale-set-controller images. + +```mermaid +flowchart LR + subgraph org: actions + event_a{{"push: [master]"}} -- triggers --> workflow_a["publish-canary.yaml"] + end + subgraph org: actions-runner-controller + workflow_a["publish-canary.yaml"] -- triggers --> event_d{{"repository_dispatch"}} --> workflow_b["publish-canary.yaml"] + workflow_b["publish-canary.yaml"] -- push --> A["GHCR: \nactions-runner-controller/actions-runner-controller:canary"] + workflow_b["publish-canary.yaml"] -- push --> B["DockerHub: \nsummerwind/actions-runner-controller:canary"] + end +``` + +1. [actions-runner-controller canary image](https://github.com/actions-runner-controller/actions-runner-controller/pkgs/container/actions-runner-controller) +2. [gha-runner-scale-set-controller image](https://github.com/actions/actions-runner-controller/pkgs/container/gha-runner-scale-set-controller) + +These canary images are automatically built and released on each push to the master branch. diff --git a/docs/preview/gha-runner-scale-set-controller/README.md b/docs/preview/gha-runner-scale-set-controller/README.md index 6c7839ce..3c35e17b 100644 --- a/docs/preview/gha-runner-scale-set-controller/README.md +++ b/docs/preview/gha-runner-scale-set-controller/README.md @@ -16,7 +16,9 @@ In addition to the increased reliability of the automatic scaling, we have worke ### Demo -[![Watch the walkthrough](https://img.youtube.com/vi/wQ0k5k6KW5Y/hqdefault.jpg)](https://youtu.be/wQ0k5k6KW5Y) +[![Watch the walkthrough](./thumbnail.png)](https://youtu.be/wQ0k5k6KW5Y) + +> Will take you to Youtube for a short walkthrough of the Autoscaling Runner Scale Sets mode. ## Setup @@ -35,8 +37,7 @@ In addition to the increased reliability of the automatic scaling, we have worke helm install arc \ --namespace "${NAMESPACE}" \ --create-namespace \ - oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller \ - --version 0.4.0 + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller ``` 1. Generate a Personal Access Token (PAT) or create and install a GitHub App. See [Creating a personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) and [Creating a GitHub App](https://docs.github.com/en/developers/apps/creating-a-github-app). @@ -57,7 +58,7 @@ In addition to the increased reliability of the automatic scaling, we have worke --create-namespace \ --set githubConfigUrl="${GITHUB_CONFIG_URL}" \ --set githubConfigSecret.github_token="${GITHUB_PAT}" \ - oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set --version 0.4.0 + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set ``` ```bash @@ -75,7 +76,7 @@ In addition to the increased reliability of the automatic scaling, we have worke --set githubConfigSecret.github_app_id="${GITHUB_APP_ID}" \ --set githubConfigSecret.github_app_installation_id="${GITHUB_APP_INSTALLATION_ID}" \ --set githubConfigSecret.github_app_private_key="${GITHUB_APP_PRIVATE_KEY}" \ - oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set --version 0.4.0 + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set ``` 1. Check your installation. If everything went well, you should see the following: @@ -139,7 +140,6 @@ Upgrading actions-runner-controller requires a few extra steps because CRDs will ```bash helm pull oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller \ - --version 0.4.0 \ --untar && \ kubectl replace -f /gha-runner-scale-set-controller/crds/ ``` diff --git a/docs/preview/gha-runner-scale-set-controller/thumbnail.png b/docs/preview/gha-runner-scale-set-controller/thumbnail.png new file mode 100644 index 00000000..1b718e39 --- /dev/null +++ b/docs/preview/gha-runner-scale-set-controller/thumbnail.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ed81a93a5e62dee54a47fbe7274462a80d3d39deff8bd396cf4065e3cf5b93f +size 1556557