Skip to content

Commit c7fd93c

Browse files
(MAINT) add retries to provision step
1 parent bdc0cd4 commit c7fd93c

File tree

2 files changed

+59
-51
lines changed

2 files changed

+59
-51
lines changed

.github/workflows/test-add-compiler-matrix.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,32 @@ jobs:
5555
bundle env
5656
echo ::endgroup::
5757
- name: Provision test cluster
58-
timeout-minutes: 15
59-
run: |
60-
echo ::group::prepare
61-
mkdir -p $HOME/.ssh
62-
echo 'Host *' > $HOME/.ssh/config
63-
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
64-
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
65-
bundle exec rake spec_prep
66-
echo ::endgroup::
67-
echo ::group::provision
68-
bundle exec bolt plan run peadm_spec::provision_test_cluster \
69-
--modulepath spec/fixtures/modules \
70-
provider=provision_service \
71-
image=${{ matrix.image }} \
72-
architecture=${{ matrix.architecture }}-with-extra-compiler
73-
echo ::endgroup::
74-
echo ::group::info:request
75-
cat request.json || true; echo
76-
echo ::endgroup::
77-
echo ::group::info:inventory
78-
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
79-
echo ::endgroup::
58+
uses: nick-fields/retry@v3
59+
with:
60+
max_attempts: 3
61+
retry_wait_seconds: 40
62+
timeout_minutes: 15
63+
command: |
64+
echo ::group::prepare
65+
mkdir -p $HOME/.ssh
66+
echo 'Host *' > $HOME/.ssh/config
67+
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
68+
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
69+
bundle exec rake spec_prep
70+
echo ::endgroup::
71+
echo ::group::provision
72+
bundle exec bolt plan run peadm_spec::provision_test_cluster \
73+
--modulepath spec/fixtures/modules \
74+
provider=provision_service \
75+
image=${{ matrix.image }} \
76+
architecture=${{ matrix.architecture }}-with-extra-compiler
77+
echo ::endgroup::
78+
echo ::group::info:request
79+
cat request.json || true; echo
80+
echo ::endgroup::
81+
echo ::group::info:inventory
82+
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
83+
echo ::endgroup::
8084
- name: Install PE on test cluster
8185
timeout-minutes: 120
8286
run: |

.github/workflows/test-migration.yaml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,40 @@ jobs:
8585
bundle env
8686
echo ::endgroup::
8787
- name: Provision test cluster
88-
timeout-minutes: 15
89-
run: |
90-
echo ::group::prepare
91-
mkdir -p $HOME/.ssh
92-
echo 'Host *' > $HOME/.ssh/config
93-
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
94-
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
95-
bundle exec rake spec_prep
96-
echo ::endgroup::
97-
echo ::group::provision
98-
bundle exec bolt plan run peadm_spec::provision_test_cluster \
88+
uses: nick-fields/retry@v3
89+
with:
90+
max_attempts: 3
91+
retry_wait_seconds: 40
92+
timeout_minutes: 15
93+
command: |
94+
echo ::group::prepare
95+
mkdir -p $HOME/.ssh
96+
echo 'Host *' > $HOME/.ssh/config
97+
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
98+
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
99+
bundle exec rake spec_prep
100+
echo ::endgroup::
101+
echo ::group::provision
102+
bundle exec bolt plan run peadm_spec::provision_test_cluster \
103+
--modulepath spec/fixtures/modules \
104+
provider=provision_service \
105+
image=${{ matrix.image }} \
106+
architecture=${{ matrix.architecture }}-migration \
107+
--log-level trace
108+
echo ::endgroup::
109+
echo ::group::info:request
110+
cat request.json || true; echo
111+
echo ::endgroup::
112+
echo ::group::info:inventory
113+
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
114+
echo ::endgroup::
115+
echo ::group::certnames
116+
bundle exec bolt plan run peadm_spec::add_inventory_hostnames \
117+
--inventory spec/fixtures/litmus_inventory.yaml \
99118
--modulepath spec/fixtures/modules \
100-
provider=provision_service \
101-
image=${{ matrix.image }} \
102-
architecture=${{ matrix.architecture }}-migration \
103-
--log-level trace
104-
echo ::endgroup::
105-
echo ::group::info:request
106-
cat request.json || true; echo
107-
echo ::endgroup::
108-
echo ::group::info:inventory
109-
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
110-
echo ::endgroup::
111-
echo ::group::certnames
112-
bundle exec bolt plan run peadm_spec::add_inventory_hostnames \
113-
--inventory spec/fixtures/litmus_inventory.yaml \
114-
--modulepath spec/fixtures/modules \
115-
--no-host-key-check \
116-
inventory_file=spec/fixtures/litmus_inventory.yaml
117-
echo ::endgroup::
119+
--no-host-key-check \
120+
inventory_file=spec/fixtures/litmus_inventory.yaml
121+
echo ::endgroup::
118122
- name: Output contents of litmus_inventory.yaml
119123
run: |
120124
cat spec/fixtures/litmus_inventory.yaml

0 commit comments

Comments
 (0)