-
Notifications
You must be signed in to change notification settings - Fork 1
fix: drain the runner before replacing its container mid-job #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| # Internal computed values shared by the plan (check-mode) and deploy passes in | ||
| # tasks/main.yml. Not intended for consumer override — tune the github_runner_* | ||
| # variables in defaults/main.yml instead. | ||
|
|
||
| # ports: is invalid together with network_mode: host, so omit it in host mode. | ||
| github_runner_ports: >- | ||
| {{ | ||
| [github_runner_adb_port | string ~ ':5037'] | ||
| if (github_runner_android and github_runner_android_expose_adb_ports | ||
| and github_runner_network_mode != 'host') | ||
| else omit | ||
| }} | ||
| github_runner_volumes: >- | ||
| {{ | ||
| ['/var/run/docker.sock:/var/run/docker.sock'] + | ||
| (['/root/.android:/root/.android'] if github_runner_android else []) + | ||
| ([github_runner_name ~ '-runner-data:/runner-data'] if github_runner_persist_config else []) | ||
| }} | ||
| github_runner_env: >- | ||
| {{ | ||
| { | ||
| 'ACCESS_TOKEN': github_runner_personal_access_token, | ||
| 'DISABLE_AUTO_UPDATE': 'true', | ||
| 'DISABLE_AUTOMATIC_DEREGISTRATION': 'true', | ||
| 'RUNNER_NAME_PREFIX': github_runner_name, | ||
| 'LABELS': github_runner_labels, | ||
| 'HOST_NAME': inventory_hostname, | ||
| 'GITHUB_HOST': github_runner_github_host | ||
| } | combine( | ||
| {'REPO_URL': 'https://' ~ github_runner_github_host ~ '/' ~ github_runner_repo} | ||
| if not github_runner_org else {} | ||
| ) | combine( | ||
| {'RUNNER_SCOPE': 'org', 'ORG_NAME': github_runner_org_name} | ||
| if github_runner_org else {} | ||
| ) | combine( | ||
| {'CONFIGURED_ACTIONS_RUNNER_FILES_DIR': '/runner-data'} | ||
| if github_runner_persist_config else {} | ||
| ) | ||
| }} | ||
|
|
||
| # Runners API endpoint for the drain busy-check: org runners or repo runners | ||
| # depending on scope. The runners register as "<github_runner_name>-<random>" | ||
| # (RUNNER_NAME_PREFIX), so the busy-check matches that prefix — and a bare | ||
| # "<github_runner_name>" too, in case a future image drops the suffix. | ||
| github_runner_api_runners_url: >- | ||
| {{ | ||
| github_runner_api_base ~ '/' ~ | ||
| ('orgs/' ~ github_runner_org_name if github_runner_org else 'repos/' ~ github_runner_repo) ~ | ||
| '/actions/runners?per_page=100' | ||
| }} | ||
| github_runner_name_match: "^{{ github_runner_name | regex_escape }}(-|$)" | ||
|
|
||
| # Poll interval clamped to >=1s so a consumer setting 0 (or a value that casts | ||
| # to 0) can't divide the retry computation by zero or spin the API. | ||
| github_runner_drain_poll_seconds_clamped: "{{ [github_runner_drain_poll_seconds | int, 1] | max }}" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.