mirror of
https://github.com/balena-io/open-balena.git
synced 2024-12-30 10:38:51 +00:00
Merge pull request #263 from balena-io/ab77/patch-1
break from wait loops if EC2 instance is terminated
This commit is contained in:
commit
10e2908b4e
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
@ -470,8 +470,8 @@ jobs:
|
|||||||
echo "::warning::Still working..."
|
echo "::warning::Still working..."
|
||||||
sleep "$(( (RANDOM % 5) + 5 ))s"
|
sleep "$(( (RANDOM % 5) + 5 ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "key_id=${GITHUB_SHA}" >> "${GITHUB_OUTPUT}"
|
echo "key_id=${GITHUB_SHA}" >> "${GITHUB_OUTPUT}"
|
||||||
@ -509,8 +509,8 @@ jobs:
|
|||||||
echo "::warning::Still working..."
|
echo "::warning::Still working..."
|
||||||
sleep "$(( (RANDOM % 30) + 30 ))s"
|
sleep "$(( (RANDOM % 30) + 30 ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
# wait for Docker healthchecks
|
# wait for Docker healthchecks
|
||||||
@ -523,8 +523,8 @@ jobs:
|
|||||||
echo "::warning::Still working..."
|
echo "::warning::Still working..."
|
||||||
sleep "$(( (RANDOM % 30) + 30 ))s"
|
sleep "$(( (RANDOM % 30) + 30 ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
# (TBC) https://www.balena.io/docs/reference/supervisor/docker-compose/
|
# (TBC) https://www.balena.io/docs/reference/supervisor/docker-compose/
|
||||||
@ -563,8 +563,8 @@ jobs:
|
|||||||
echo "::warning::Still working..."
|
echo "::warning::Still working..."
|
||||||
sleep "$(( (RANDOM % 30) + 30 ))s"
|
sleep "$(( (RANDOM % 30) + 30 ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: SUT&DUT (balena)
|
- name: SUT&DUT (balena)
|
||||||
@ -609,8 +609,8 @@ jobs:
|
|||||||
echo "::warning::Still working..."
|
echo "::warning::Still working..."
|
||||||
sleep "$(( ( RANDOM % ${{ env.RETRY }} ) + ${{ env.RETRY }} ))s"
|
sleep "$(( ( RANDOM % ${{ env.RETRY }} ) + ${{ env.RETRY }} ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
# .. once the service exits with status == exited, it is assumed to be finished
|
# .. once the service exits with status == exited, it is assumed to be finished
|
||||||
@ -626,8 +626,8 @@ jobs:
|
|||||||
|
|
||||||
sleep "$(( ( RANDOM % ${{ env.RETRY }} ) + ${{ env.RETRY }} ))s"
|
sleep "$(( ( RANDOM % ${{ env.RETRY }} ) + ${{ env.RETRY }} ))s"
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.balena-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
# .. check its exit code
|
# .. check its exit code
|
||||||
@ -908,8 +908,8 @@ jobs:
|
|||||||
with_backoff docker compose ls
|
with_backoff docker compose ls
|
||||||
sleep $(((RANDOM%5) + 5))s
|
sleep $(((RANDOM%5) + 5))s
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
echo '::info::composition started'
|
echo '::info::composition started'
|
||||||
|
|
||||||
@ -920,8 +920,8 @@ jobs:
|
|||||||
with_backoff docker compose ps
|
with_backoff docker compose ps
|
||||||
sleep $(((RANDOM%5) + 5))s
|
sleep $(((RANDOM%5) + 5))s
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
echo "::info::${service} started"
|
echo "::info::${service} started"
|
||||||
done
|
done
|
||||||
@ -936,8 +936,8 @@ jobs:
|
|||||||
echo '::info::still running...'
|
echo '::info::still running...'
|
||||||
sleep $(((RANDOM%1) + 1))s
|
sleep $(((RANDOM%1) + 1))s
|
||||||
|
|
||||||
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-running --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }}
|
aws ec2 wait instance-status-ok --instance-ids ${{ steps.ubuntu-sut.outputs.instance_id }} || break
|
||||||
done
|
done
|
||||||
|
|
||||||
aws ssm wait command-executed --command-id "${cid}" --instance-id "${iid}"
|
aws ssm wait command-executed --command-id "${cid}" --instance-id "${iid}"
|
||||||
|
Loading…
Reference in New Issue
Block a user