Skip to content

Commit edffb3b

Browse files
authored
Merge branch 'main' into chore/auto-libs
2 parents 067408d + b51b110 commit edffb3b

File tree

233 files changed

+14994
-4722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+14994
-4722
lines changed

.github/workflows/e2e_test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: End-to-End tests
22

33
on:
44
pull_request:
5-
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
69

710
jobs:
811
# test option values defined at test/conftest.py are passed on via repository secret
@@ -13,7 +16,7 @@ jobs:
1316
secrets: inherit
1417
with:
1518
juju-channel: 3.6/stable
16-
pre-run-script: scripts/setup-lxd.sh
19+
pre-run-script: scripts/setup-integration-tests.sh
1720
provider: lxd
1821
test-tox-env: integration-juju3.6
1922
modules: '["test_e2e"]'

.github/workflows/integration_test.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: integration-tests
33
on:
44
pull_request:
55

6-
# Disabled until we get more resources for the actions
7-
# schedule:
8-
# # Trigger at 6:00 AM and 6:00 PM UTC
9-
# - cron: "0 6,18 * * *"
6+
schedule:
7+
# Trigger at 6:00 AM and 6:00 PM UTC
8+
- cron: "0 6,18 * * *"
109

1110
concurrency:
1211
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -21,7 +20,7 @@ jobs:
2120
secrets: inherit
2221
with:
2322
juju-channel: 3.1/stable
24-
pre-run-script: scripts/setup-lxd.sh
23+
pre-run-script: scripts/setup-integration-tests.sh
2524
provider: lxd
2625
test-tox-env: integration-juju3.1
2726
modules: '["test_charm_scheduled_events", "test_debug_ssh", "test_charm_upgrade"]'
@@ -35,7 +34,7 @@ jobs:
3534
secrets: inherit
3635
with:
3736
juju-channel: 3.6/stable
38-
pre-run-script: scripts/setup-lxd.sh
37+
pre-run-script: scripts/setup-integration-tests.sh
3938
provider: lxd
4039
test-tox-env: integration-juju3.6
4140
modules: '["test_runner_manager_openstack"]'
@@ -48,10 +47,10 @@ jobs:
4847
secrets: inherit
4948
with:
5049
juju-channel: 3.6/stable
51-
pre-run-script: scripts/setup-lxd.sh
50+
pre-run-script: scripts/setup-integration-tests.sh
5251
provider: lxd
5352
test-tox-env: integration-juju3.6
54-
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_reactive"]'
53+
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_reactive", "test_jobmanager"]'
5554
extra-arguments: '-m openstack --log-format="%(asctime)s %(levelname)s %(message)s"'
5655
self-hosted-runner: true
5756
self-hosted-runner-label: stg-private-endpoint

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ jobs:
99
secrets: inherit
1010
with:
1111
self-hosted-runner: true
12+
self-hosted-runner-label: edge

.github/workflows/test_github_runner_manager.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ jobs:
99
secrets: inherit
1010
with:
1111
self-hosted-runner: true
12+
self-hosted-runner-label: edge
1213
working-directory: ./github-runner-manager/

.github/workflows/tics.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on: [pull_request]
2+
3+
jobs:
4+
TICS:
5+
name: TICS
6+
runs-on: [self-hosted, linux, amd64, tiobe, jammy]
7+
steps:
8+
- uses: actions/checkout@v4
9+
with:
10+
fetch-depth: 0
11+
- name: Run Unit Tests (manager app)
12+
run: |
13+
cd github-runner-manager
14+
pip install tox pylint flake8 -r ./requirements.txt
15+
tox -e unit,coverage-report
16+
rm -rf .tox
17+
- name: Run Unit Tests
18+
run: |
19+
pip install tox pylint flake8 -r ./requirements.txt -r ./github-runner-manager/requirements.txt
20+
tox -e unit,coverage-report
21+
rm -rf .tox
22+
- name: TICS GitHub Action
23+
uses: tiobe/tics-github-action@v3
24+
env:
25+
PYTHONPATH: "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/src:/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/lib:/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/github-runner-manager/src/github_runner_manager:/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/github-runner-manager/src"
26+
with:
27+
mode: qserver
28+
project: github-runner-operator
29+
branchdir: ${{ github.workspace }}
30+
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
31+
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
32+
installTics: true
33+
34+
concurrency:
35+
group: tics
36+
cancel-in-progress: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__/
44
placeholders/
55
*.charm
66
build/
7+
coverage
78
.coverage
89

910
# development artifacts

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ header:
2727
- '.woke.yaml'
2828
- 'lib/**'
2929
- 'github-runner-manager/**'
30+
- 'jobmanager/**'
3031
comment: on-failure

.woke.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ignore_files:
2+
# This is autogenerated code
3+
- jobmanager/**
14
rules:
25
# Ignore whitelist - we are using it to ignore pydantic in pyproject.toml and pylintrc
36
- name: whitelist

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ juju integrate github-runner-image-builder github-runner
5454
You can scale the amount of virtual machines using
5555

5656
```bash
57-
juju config github-runner virtual-machines=5
57+
juju config github-runner base-virtual-machines=5
5858
```
5959

6060
You can change the reconciliation interval, to e.g. 5 minutes, using
@@ -75,6 +75,60 @@ If you need to flush and replace the runners with a new set of runners, you can
7575
juju run github-runner/0 flush-runners
7676
```
7777

78+
## Overview of the GitHub runner ecosystem
79+
80+
The `github-runner` charm integrates with several other charms that work
81+
together to facilitate the deployment, management and debugging of
82+
self-hosted GitHub runners. Below is a high-level overview of the key
83+
charms and their interactions:
84+
85+
* [GitHub Runner](https://charmhub.io/github-runner-image): The central component that manages self-hosted GitHub runners. It interacts with OpenStack to spawn runner VMs and communicates with GitHub to register and manage runners.
86+
* [Image Builder](https://charmhub.io/github-runner-image-builder): Responsible for generating images. It builds images on the builder OpenStack project and uploads them to the GitHub Runner OpenStack project.
87+
* [MongoDB](https://charmhub.io/mongodb): Acts as a message queue to handle reactive runner requests. The [github-runner-webhook-router](https://charmhub.io/github-runner-webhook-router) charm will put events in MongoDB that will be consumed by the github-runner charm. Only for reactive runners.
88+
* [tmate-ssh-server](https://charmhub.io/tmate-ssh-server): Provides terminal-sharing capabilities to enable debugging of GitHub runners. Optional.
89+
* [COS lite stack](https://charmhub.io/topics/canonical-observability-stack/editions/lite): Provides observability to the Github runners ecosystem. Optional.
90+
91+
Below is a diagram representing these components and their relationships, excluding the [COS lite stack](https://charmhub.io/topics/canonical-observability-stack/editions/lite):
92+
93+
```mermaid
94+
C4Container
95+
title Container diagram for the github-runner Charm System
96+
Container_Boundary(c1, "Image Builder") {
97+
Container(imagebuilder, "Image Builder", "", "Provides images to all related charms")
98+
}
99+
System_Ext(osbuilding, "OpenStack", "OpenStack deployment used for building images")
100+
Container_Boundary(c2, "GitHub Runner"){
101+
Container(githubrunner, "GitHub Runner Charm", "", "Manages self-hosted runners")
102+
}
103+
Container_Boundary(c3, "monbodb"){
104+
Container(mongodb, "MongoDB", "", "Used as a message queue for reactive runner requests")
105+
}
106+
Container_Boundary(c4, "tmate-ssh-server"){
107+
Container(tmate_ssh, "tmate-ssh-server", "", "Terminal sharing capabilities to debug GitHub runners")
108+
}
109+
110+
Container_Boundary(c5, "github-runner-webhook-router"){
111+
Container(router, "github-runner-webhook-router", "", "Listens to GitHub webhooks")
112+
}
113+
114+
Rel(imagebuilder, osbuilding, "builds images")
115+
UpdateRelStyle(imagebuilder, osbuilding, $offsetY="-30", $offsetX="10")
116+
Rel(imagebuilder, osgithubrunner, "uploads images")
117+
UpdateRelStyle(imagebuilder, osgithubrunner, $offsetY="-30", $offsetX="-90")
118+
Rel(imagebuilder, githubrunner, "image ids")
119+
UpdateRelStyle(imagebuilder, githubrunner, $offsetY="-10", $offsetX="-30")
120+
System_Ext(osgithubrunner, "OpenStack", "OpenStack deployment used for spawning runner VMs")
121+
System_Ext(github, "GitHub", "GitHub API")
122+
Rel(githubrunner, osgithubrunner, "spawns VMs")
123+
UpdateRelStyle(githubrunner, osgithubrunner, $offsetY="-30", $offsetX="10")
124+
Rel(githubrunner, github, "Manage runners")
125+
Rel(githubrunner, imagebuilder, "OpenStack credentials")
126+
UpdateRelStyle(githubrunner, imagebuilder, $offsetY="10", $offsetX="-60")
127+
Rel(mongodb, githubrunner, "database credentials")
128+
Rel(tmate_ssh, githubrunner, "debug-ssh credentials")
129+
Rel(router, mongodb, "new runner requests")
130+
```
131+
78132

79133
## Integrations
80134
The charm supports [multiple integrations](https://charmhub.io/github-runner/integrations),

actions.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ reconcile-runners:
77
description: Remove offline runners and replace any missing runners
88
flush-runners:
99
description: Clear out all runners and start a new set
10-
update-dependencies:
11-
description: Update GitHub self-hosted runner binary and services used by the charm

0 commit comments

Comments
 (0)