Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/auto_update_libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ on:
jobs:
auto-update-libs:
uses: canonical/operator-workflows/.github/workflows/auto_update_charm_libs.yaml@main
permissions:
contents: write
pull-requests: write
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ on:
jobs:
comment-on-pr:
uses: canonical/operator-workflows/.github/workflows/comment.yaml@main
permissions:
pull-requests: write
secrets: inherit
3 changes: 3 additions & 0 deletions .github/workflows/copilot-collections-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
check-update:
# Always pin to @main to get the latest logic, but the content version is controlled by your .yaml file
uses: canonical/copilot-collections/.github/workflows/auto_update_collections.yaml@main
permissions:
contents: write
pull-requests: write
with:
config_file: ".copilot-collections.yaml"
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ jobs:
- openstack-integration-tests-cross-controller-private-endpoint
- openstack-integration-tests-runner-bases
uses: canonical/operator-workflows/.github/workflows/allure_report.yaml@main
permissions:
contents: write
2 changes: 1 addition & 1 deletion base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PyGithub==2.8.1
jinja2==3.1.6
fabric==3.2.2
ops==3.5.2
pylxd @ git+https://github.com/canonical/pylxd
pylxd==2.4.2
requests==2.33.0
typing-extensions==4.15.0
cryptography==49.0.0
Expand Down
2 changes: 1 addition & 1 deletion github-runner-manager/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[project]
name = "github-runner-manager"
version = "0.18.3"
version = "0.18.4"
authors = [
{ name = "Canonical IS DevOps", email = "is-devops-team@canonical.com" },
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _desired_total_from_pressure(self, pressure: int) -> int:
The desired total number of runners.
"""
total = max(pressure, self._config.min_pressure, 0)
if self._config.max_pressure > 0 and total > self._config.max_pressure:
if 0 < self._config.max_pressure < total:
logger.info(
"Pressure %s exceeds max_pressure %s, clamping to %s",
pressure,
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/helpers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
)
from manager_service import _get_log_file_path

# Runner VMs on the CI cloud are sometimes slow to come online. Each poll waits 30 seconds, so this
# allows up to 30 minutes.
WAIT_FOR_RUNNER_ONLINE_ATTEMPTS = 60
DISPATCH_TEST_WORKFLOW_FILENAME = "workflow_dispatch_test.yaml"
DISPATCH_CRASH_TEST_WORKFLOW_FILENAME = "workflow_dispatch_crash_test.yaml"
DISPATCH_FAILURE_TEST_WORKFLOW_FILENAME = "workflow_dispatch_failure_test.yaml"
Expand Down Expand Up @@ -96,7 +99,7 @@ def wait_for_runner_ready(juju: jubilant.Juju, app_name: str, num_runners: int =
num_runners: The minimum number of runners expected online.
"""
unit_name = f"{app_name}/0"
for attempt in range(20):
for attempt in range(WAIT_FOR_RUNNER_ONLINE_ATTEMPTS):
try:
result = juju.run(unit_name, "check-runners")
except (jubilant.CLIError, TimeoutError):
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/test_prometheus_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from charm_state import BASE_VIRTUAL_MACHINES_CONFIG_NAME
from tests.integration.helpers.common import (
DISPATCH_TEST_WORKFLOW_FILENAME,
WAIT_FOR_RUNNER_ONLINE_ATTEMPTS,
dispatch_workflow,
)

Expand Down Expand Up @@ -183,7 +184,7 @@ def test_prometheus_metrics(
def _wait_for_runner_ready(juju: jubilant.Juju, app_name: str) -> None:
"""Poll check-runners action until at least one runner is online."""
unit = f"{app_name}/0"
for attempt in range(20):
for attempt in range(WAIT_FOR_RUNNER_ONLINE_ATTEMPTS):
try:
result = juju.run(unit, "check-runners")
except (jubilant.CLIError, TimeoutError):
Expand All @@ -194,7 +195,9 @@ def _wait_for_runner_ready(juju: jubilant.Juju, app_name: str) -> None:
return
logger.info("Waiting for runner (attempt %d): online=%s", attempt, result.results)
time.sleep(30)
raise TimeoutError(f"Runner on {unit} never came online after 20 attempts")
raise TimeoutError(
f"Runner on {unit} never came online after {WAIT_FOR_RUNNER_ONLINE_ATTEMPTS} attempts"
)


def _wait_for_no_runners(juju: jubilant.Juju, app_name: str) -> None:
Expand Down
Loading