diff --git a/github-runner-manager/src/github_runner_manager/metrics/runner.py b/github-runner-manager/src/github_runner_manager/metrics/runner.py index a8f8b9bd01..163ac95bad 100644 --- a/github-runner-manager/src/github_runner_manager/metrics/runner.py +++ b/github-runner-manager/src/github_runner_manager/metrics/runner.py @@ -39,32 +39,90 @@ logger = logging.getLogger(__name__) MAX_METRICS_FILE_SIZE = 1024 +MINUTE_IN_SECONDS = 60 +HOURS_IN_SECONDS = MINUTE_IN_SECONDS * 60 +DAYS_IN_SECONDS = HOURS_IN_SECONDS * 24 RUNNER_SPAWN_DURATION_SECONDS = Histogram( name="runner_spawn_duration_seconds", documentation="Time in seconds to initialize the VM and register the runner on GitHub.", labelnames=[labels.FLAVOR], - buckets=[5, 10, 15, 30, 60, 60 * 2, 60 * 3, 60 * 5, 60 * 10, float("inf")], + buckets=[ + 5, + 10, + 15, + 30, + MINUTE_IN_SECONDS, + MINUTE_IN_SECONDS * 2, + MINUTE_IN_SECONDS * 3, + MINUTE_IN_SECONDS * 5, + MINUTE_IN_SECONDS * 10, + float("inf"), + ], ) RUNNER_IDLE_DURATION_SECONDS = Histogram( name="runner_idle_duration_seconds", documentation="Time in seconds to runner waiting idle for the job to be picked up.", labelnames=[labels.FLAVOR], + buckets=[ + 5, + 10, + 15, + 30, + MINUTE_IN_SECONDS, + MINUTE_IN_SECONDS * 2, + MINUTE_IN_SECONDS * 3, + MINUTE_IN_SECONDS * 5, + MINUTE_IN_SECONDS * 10, + float("inf"), + ], ) RUNNER_QUEUE_DURATION_SECONDS = Histogram( name="runner_queue_duration_seconds", documentation="Time taken in seconds for the job to be started.", labelnames=[labels.FLAVOR], + buckets=[ + # seconds + 5, + 30, + MINUTE_IN_SECONDS, + MINUTE_IN_SECONDS * 5, + MINUTE_IN_SECONDS * 10, + MINUTE_IN_SECONDS * 20, + MINUTE_IN_SECONDS * 30, + HOURS_IN_SECONDS, + HOURS_IN_SECONDS * 2, + HOURS_IN_SECONDS * 5, + float("inf"), + ], ) EXTRACT_METRICS_DURATION_SECONDS = Histogram( name="extract_metrics_duration_seconds", documentation="Time taken in seconds for the metrics to be extracted.", labelnames=[labels.FLAVOR], + buckets=[5, 10, 15, 30, 60, 60 * 2, 60 * 3, 60 * 5, 60 * 10, float("inf")], ) JOB_DURATION_SECONDS = Histogram( name="job_duration_seconds", documentation="Time taken in seconds for the job to be completed.", labelnames=[labels.FLAVOR], + buckets=[ + MINUTE_IN_SECONDS, + MINUTE_IN_SECONDS * 5, + MINUTE_IN_SECONDS * 10, + MINUTE_IN_SECONDS * 20, + MINUTE_IN_SECONDS * 30, + MINUTE_IN_SECONDS * 60, + # hours + HOURS_IN_SECONDS * 2, + HOURS_IN_SECONDS * 4, + HOURS_IN_SECONDS * 6, + # days + DAYS_IN_SECONDS * 3, + # Limit of the run is 5 days: https://docs.github.com/en/actions/reference/limits + DAYS_IN_SECONDS * 5, + float("inf"), + ], ) JOB_REPOSITORY_COUNT = Gauge( name="job_repository_count", diff --git a/jobmanager/client/git_push.sh b/jobmanager/client/git_push.sh index f53a75d4fa..26b9737a9c 100644 --- a/jobmanager/client/git_push.sh +++ b/jobmanager/client/git_push.sh @@ -43,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi fi diff --git a/tests/integration/setup-integration-tests.sh b/tests/integration/setup-integration-tests.sh index c905cf305b..fcf5cf54c8 100755 --- a/tests/integration/setup-integration-tests.sh +++ b/tests/integration/setup-integration-tests.sh @@ -12,7 +12,7 @@ ORIGINAL_CONTROLLER=$(juju controllers --format json | jq -r '.controllers | keys | .[0]') echo "bootstrapping microk8s juju controller" -sudo snap install microk8s --channel=1.32-strict/stable +sudo snap install microk8s --channel=1.34-strict/stable GROUP=snap_microk8s sudo usermod -a -G "$GROUP" "$USER" if [ "$(id -gn)" != "$GROUP" ]; then