Skip to content

Commit

Permalink
Leverage async for devscripts role feedback
Browse files Browse the repository at this point in the history
Long running tasks such as the deploy will now have:
- a timeout via async
- display a feedback while still running

The timeout is needed since, under some circumstances, devscripts itself
doesn't seem to timeout, leading to never-ending run.

The deploy will show an ASYNC POLL every 30 seconds, while the cleaning
will show the message every 10 seconds.
The "timeout" for the deployment is set to 2h by default.
  • Loading branch information
cjeanner authored and openshift-merge-bot[bot] committed Jun 18, 2024
1 parent 73170de commit 7846a08
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/devscripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ networks.
for overriding the default configuration. Refer to
[section](#supported-keys-in-cifmw_devscripts_config_overrides) for more
information.
* `cifmw_devscripts_installer_timeout`: (int) number of second before deployment timeout.
Defaults to 7200, 2 hours.
* `cifmw_devscripts_dry_run` (bool) If enabled, the workflow is evaluated.
* `cifmw_devscripts_src_dir` (str) The parent folder of dev-scripts repository.
* `cifmw_devscripts_remove_libvirt_net_default` (bool) Remove the default
Expand Down
1 change: 1 addition & 0 deletions roles/devscripts/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ cifmw_devscripts_cinder_volume_pvs:
- /dev/vda

cifmw_devscripts_config_overrides: {}
cifmw_devscripts_installer_timeout: 7200 # 2 hours
2 changes: 2 additions & 0 deletions roles/devscripts/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
community.general.make:
chdir: "{{ cifmw_devscripts_repo_dir }}"
target: clean
async: 600 # 10 minutes should be more than enough
poll: 10

- name: Remove the SSH key generated for accessing the platform
ansible.builtin.file:
Expand Down
2 changes: 2 additions & 0 deletions roles/devscripts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
community.general.make:
chdir: "{{ cifmw_devscripts_repo_dir }}"
target: "all"
async: "{{ cifmw_devscripts_installer_timeout }}"
poll: 30

- name: Executing dev-scripts post-install tasks.
when:
Expand Down

0 comments on commit 7846a08

Please sign in to comment.