Skip to content

Commit e10aa3d

Browse files
authored
feat: otel-collector snap (#195)
* feat: otel-collector snap * chore: application bump related changes * fix: call installation func
1 parent ca2d172 commit e10aa3d

5 files changed

Lines changed: 26 additions & 2 deletions

File tree

app/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[project]
55
name = "github-runner-image-builder"
6-
version = "0.12.0"
6+
version = "0.13.0"
77
authors = [
88
{ name = "Canonical IS DevOps", email = "is-devops-team@canonical.com" },
99
]
@@ -32,7 +32,7 @@ dependencies = { file = ["requirements.txt"] }
3232

3333
[tool.pydocstyle]
3434
match = "src/github_runner_image_builder/cli.py"
35-
ignore = ["D301"] # ignore backshlashes in docstring - click lib uses them.
35+
ignore = ["D301"] # ignore backshlashes in docstring - click lib uses them.
3636

3737

3838
[tool.bandit]

app/src/github_runner_image_builder/templates/cloud-init.sh.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ function install_yq() {
120120
/usr/bin/snap remove go
121121
}
122122

123+
function install_opentelemetry_collector_snap() {
124+
echo "Installing OpenTelemetry Collector snap"
125+
/usr/bin/sudo snap install opentelemetry-collector --stable
126+
/usr/bin/sudo snap disable opentelemetry-collector
127+
}
128+
123129
function install_github_runner() {
124130
version="$1"
125131
arch="$2"
@@ -172,6 +178,7 @@ if [ $RELEASE != "focal" ]; then
172178
install_yarn
173179
fi
174180
install_yq
181+
install_opentelemetry_collector_snap
175182
install_github_runner "$github_runner_version" "$github_runner_arch"
176183
chown_home
177184
configure_system_users

app/tests/integration/commands.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ class Commands:
3838
name="check aproxy",
3939
command="sudo snap info aproxy && sudo snap services aproxy",
4040
),
41+
Commands(
42+
name="check opentelemetry-collector snap installed and inactive",
43+
command=(
44+
"sudo snap services opentelemetry-collector | grep -q 'disabled' "
45+
"&& sudo snap services opentelemetry-collector | grep -q 'inactive'"
46+
),
47+
),
4148
Commands(name="update apt in docker", command="docker run python:3.10-slim apt-get update"),
4249
Commands(name="docker version", command="docker version"),
4350
Commands(name="check python3 alias", command="python --version"),

app/tests/unit/test_openstack_builder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,12 @@ def test__generate_cloud_init_script(
831831
/usr/bin/snap remove go
832832
}}
833833
834+
function install_opentelemetry_collector_snap() {{
835+
echo "Installing OpenTelemetry Collector snap"
836+
/usr/bin/sudo snap install opentelemetry-collector --stable
837+
/usr/bin/sudo snap disable opentelemetry-collector
838+
}}
839+
834840
function install_github_runner() {{
835841
version="$1"
836842
arch="$2"
@@ -884,6 +890,7 @@ def test__generate_cloud_init_script(
884890
install_yarn
885891
fi
886892
install_yq
893+
install_opentelemetry_collector_snap
887894
install_github_runner "$github_runner_version" "$github_runner_arch"
888895
chown_home
889896
configure_system_users\

docs/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
<!-- vale Canonical.007-Headings-sentence-case = NO -->
33

4+
## [#195 feat: otel-collector snap](https://github.com/canonical/github-runner-image-builder-operator/pull/195) (2026-02-11)
5+
* Install opentelemetry collector snap in the runner image.
6+
47
## [#172 feat: apt upgrade](https://github.com/canonical/github-runner-image-builder-operator/pull/172) (2025-11-26)
58
* Apply apt-update and apt-upgrade to GH runner images by applying them during cloud-init.
69

0 commit comments

Comments
 (0)