Skip to content

Commit efd441b

Browse files
authored
ci: unified-agent: export preset name (#8518)
1 parent 01c9738 commit efd441b

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

ydb/ci/gh-runner-controller/src/scaler/cloud_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import yaml
44

55

6-
def create_userdata(repo_url, gh_token, runner_name, runner_labels, ssh_keys, agent_mirror_url_prefix):
6+
def create_userdata(repo_url, gh_token, runner_name, runner_labels, ssh_keys, agent_mirror_url_prefix, preset_name):
77
runner_username = "runner"
88

99
install_script = pkgutil.get_data(__name__, "scripts/install_runner.sh")
@@ -17,6 +17,7 @@ def create_userdata(repo_url, gh_token, runner_name, runner_labels, ssh_keys, ag
1717
RUNNER_NAME="{runner_name}"
1818
RUNNER_LABELS="{runner_labels}"
1919
AGENT_MIRROR_URL_PREFIX="{agent_mirror_url_prefix}"
20+
PRESET_NAME="{preset_name}"
2021
""".strip().encode(
2122
"utf8"
2223
)

ydb/ci/gh-runner-controller/src/scaler/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def start_runner(self, preset_name: str):
190190

191191
vm_labels = {self.prefix: runner_name}
192192
user_data = create_userdata(self.gh.html_url, new_runner_token, runner_name, labels, self.cfg.ssh_keys,
193-
self.cfg.agent_mirror_url_prefix)
193+
self.cfg.agent_mirror_url_prefix, preset_name)
194194

195195
placement = random.choice(self.cfg.yc_zones)
196196
zone_id = placement['zone_id']

ydb/ci/gh-runner-controller/src/scaler/scripts/install_runner.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ systemctl daemon-reload || fail "failed to reload systemd"
5050
systemctl enable $SVC_NAME
5151
systemctl start $SVC_NAME
5252

53-
echo "GH_RUNNER_NAME=${RUNNER_NAME}"> /etc/default/unified_agent
53+
cat <<EOF > /etc/default/unified_agent
54+
GH_RUNNER_NAME=${RUNNER_NAME}
55+
GH_PRESET_NAME=${PRESET_NAME}
56+
EOF
57+
5458
systemctl restart unified-agent.service

ydb/ci/gh-runner-image/conf/unified-agent-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ channels:
1616
plugin: transform_metric_labels
1717
config:
1818
labels:
19-
- gh_runner_name: "{$env('GH_RUNNER_NAME')}"
19+
- gh_preset: "{$env('GH_PRESET_NAME')}"
2020
output:
2121
plugin: yc_metrics
2222
config:

0 commit comments

Comments
 (0)