Skip to content

Commit

Permalink
Updating runner names by removing "-v2-" part.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Zakaznikov committed Mar 17, 2024
1 parent 72910c9 commit d9db68b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions testflows/github/hetzner/runners/scale_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
standby_runner_name_prefix = standby_server_name_prefix
recycle_server_name_prefix = f"{server_name_prefix}recycle-"
server_ssh_key_label = "github-hetzner-runner-ssh-key"
runner_name_v2 = "-v2-"


@dataclass
Expand Down Expand Up @@ -89,18 +88,16 @@ def uid():

def get_runner_server_name(runner_name: str) -> str:
"""Determine runner's server name."""
return runner_name.split(runner_name_v2, 1)[0]
return "-".join(runner_name.split("-")[:5])


def get_runner_server_type_and_location(runner_name: str):
"""Determine runner's server type, and location."""
server_type, server_location = None, None

if runner_name.startswith(runner_name_prefix):
if runner_name_v2 in runner_name:
server_type, server_location = runner_name.split(runner_name_v2, 1)[
-1
].split("-")
if len(runner_name.split("-")) == 8:
server_type, server_location = runner_name.split("-")[5:]

return server_type, server_location

Expand Down
2 changes: 1 addition & 1 deletion testflows/github/hetzner/runners/scripts/startup-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "842a9046af8439aa9bcabfe096aacd998fc3af82b9afe2434ddd77b96f872a83 actions-
tar xzf ./actions-runner-linux-arm64-2.306.0.tar.gz

echo "Configure runner"
./config.sh --unattended --replace --url https://github.com/${GITHUB_REPOSITORY} --token ${GITHUB_RUNNER_TOKEN} --name "$(hostname)-v2-${SERVER_TYPE_NAME}-${SERVER_LOCATION_NAME}" --runnergroup "${GITHUB_RUNNER_GROUP}" --labels "${GITHUB_RUNNER_LABELS}" --work _work --ephemeral
./config.sh --unattended --replace --url https://github.com/${GITHUB_REPOSITORY} --token ${GITHUB_RUNNER_TOKEN} --name "$(hostname)-${SERVER_TYPE_NAME}-${SERVER_LOCATION_NAME}" --runnergroup "${GITHUB_RUNNER_GROUP}" --labels "${GITHUB_RUNNER_LABELS}" --work _work --ephemeral

echo "Start runner"
bash -c "screen -d -m bash -c './run.sh; sudo poweroff'"
2 changes: 1 addition & 1 deletion testflows/github/hetzner/runners/scripts/startup-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "b0a090336f0d0a439dac7505475a1fb822f61bbb36420c7b3b3fe6b1bdc4dbaa actions-
tar xzf ./actions-runner-linux-x64-2.306.0.tar.gz

echo "Configure runner"
./config.sh --unattended --replace --url https://github.com/${GITHUB_REPOSITORY} --token ${GITHUB_RUNNER_TOKEN} --name "$(hostname)-v2-${SERVER_TYPE_NAME}-${SERVER_LOCATION_NAME}" --runnergroup "${GITHUB_RUNNER_GROUP}" --labels "${GITHUB_RUNNER_LABELS}" --work _work --ephemeral
./config.sh --unattended --replace --url https://github.com/${GITHUB_REPOSITORY} --token ${GITHUB_RUNNER_TOKEN} --name "$(hostname)-${SERVER_TYPE_NAME}-${SERVER_LOCATION_NAME}" --runnergroup "${GITHUB_RUNNER_GROUP}" --labels "${GITHUB_RUNNER_LABELS}" --work _work --ephemeral

echo "Start runner"
bash -c "screen -d -m bash -c './run.sh; sudo poweroff'"

0 comments on commit d9db68b

Please sign in to comment.