Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
yhaliaw committed Sep 1, 2024
1 parent 8fa1fd5 commit d531297
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: End-to-End tests

on:
pull_request:
# TODO: debug
workflow_dispatch:
# pull_request:


jobs:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/manual_test_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Manual test env

on:
pull_request:

jobs:
manual-test-env:
name: manual-test-env
runs-on: ["self-hosted", "stg-private-endpoint", "x64"]
steps:
- run: sudo apt update -yq
- run: sudo apt install pipx -yq
- run: pipx ensurepath
- run: pipx install tox
- uses: actions/checkout@v4
- uses: charmed-kubernetes/actions-operator@main
- run: sudo snap install charmcraft --classic
- run: lxd init --auto
- run: charmcraft pack
- name: Tmate debugging session (self-hosted)
uses: canonical/action-tmate@main
timeout-minutes: 300
5 changes: 2 additions & 3 deletions src/manager/runner_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ def reconcile(self, quantity: int) -> int:
if runner.github_state == GitHubRunnerState.OFFLINE
and runner.health == HealthState.HEALTHY
]
unhealthy_runners = [
runner for runner in runner_list if runner.health == HealthState.UNHEALTHY or runner.health == HealthState.UNKNOWN
]
unhealthy_states = set(HealthState.UNHEALTHY, HealthState.UNKNOWN)
unhealthy_runners = [runner for runner in runner_list if runner.health in unhealthy_states]
logger.info("Found %s busy runners: %s", len(busy_runners), busy_runners)
logger.info("Found %s idle runners: %s", len(idle_runners), idle_runners)
logger.info(
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/helpers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ async def expose_to_instance(
break
assert ip, f"Failed to get IP address for OpenStack server {runner.name}"

# TODO: debug
import pytest

pytest.set_trace()

ssh_cmd = f'ssh -fNT -R {port}:localhost:{port} -i /home/ubuntu/.ssh/runner-{runner.name}.key -o "StrictHostKeyChecking no" -o "ControlPersist yes" ubuntu@{ip} &'
exit_code, _, stderr = await run_in_unit(unit, ssh_cmd)
assert exit_code == 0, f"Error in SSH remote forwarding of port {port}: {stderr}"
Expand Down

0 comments on commit d531297

Please sign in to comment.