AIAP: Cause AIAP to fail faster

Currently, when a container in AIAP fails, the container continues to
run in the backgroud. This causes the container to be marked as failed
so that the deployment will fail faster.

Closes: #626

Change-Id: I34de366390b6ddc0ef434f7e642e73797a790edf
This commit is contained in:
Ian Howell 2021-09-02 10:16:28 -05:00
parent b32e9b669b
commit cde9648718
4 changed files with 68 additions and 13 deletions

View File

@ -14,6 +14,18 @@
set -ex
# Create the "canary" file, indicating that the container is healthy
mkdir -p /tmp/healthy
touch /tmp/healthy/artifact-setup
success=false
function cleanup() {
if [[ "$success" == "false" ]]; then
rm /tmp/healthy/artifact-setup
fi
}
trap cleanup EXIT
function cloneRepo() {
repo_dir=$1
repo_url=$2
@ -44,4 +56,5 @@ else
cp "$(command -v airshipctl)" bin
fi
success=true
/signal_complete artifact-setup

View File

@ -121,9 +121,7 @@ spec:
--interface 10.23.25.1 \
--port 8443 \
--ssl-key /airship_gate_redfish_auth.key \
--ssl-certificate /airship_gate_redfish_auth.pem || true
tail -f /dev/null
--ssl-certificate /airship_gate_redfish_auth.pem
volumeMounts:
- name: var-run-libvirt
mountPath: /var/run/libvirt
@ -200,15 +198,21 @@ spec:
command:
- bash
- -cex
- |
/entrypoint.sh || true
tail -f /dev/null
- /entrypoint.sh
readinessProbe:
exec:
command:
- test
- -e
- /tmp/completed/artifact-setup
livenessProbe:
exec:
command:
- test
- -e
- /tmp/healthy/artifact-setup
initialDelaySeconds: 5
periodSeconds: 5
env:
- name: CACHE_DIR
value: /opt/aiap-cache
@ -249,15 +253,21 @@ spec:
command:
- bash
- -cex
- |
/entrypoint.sh || true
tail -f /dev/null
- /entrypoint.sh
readinessProbe:
exec:
command:
- test
- -e
- /tmp/completed/infra-builder
livenessProbe:
exec:
command:
- test
- -e
- /tmp/healthy/infra-builder
initialDelaySeconds: 5
periodSeconds: 5
env:
- name: CACHE_DIR
value: /opt/aiap-cache
@ -298,9 +308,7 @@ spec:
command:
- bash
- -cex
- |
/entrypoint.sh || true
tail -f /dev/null
- /entrypoint.sh
readinessProbe:
exec:
command:
@ -309,6 +317,14 @@ spec:
- /tmp/completed/runner
initialDelaySeconds: 600
periodSeconds: 30
livenessProbe:
exec:
command:
- test
- -e
- /tmp/healthy/runner
initialDelaySeconds: 5
periodSeconds: 5
env:
- name: CACHE_DIR
value: /opt/aiap-cache

View File

@ -14,10 +14,23 @@
set -ex
# Create the "canary" file, indicating that the container is healthy
mkdir -p /tmp/healthy
touch /tmp/healthy/infra-builder
success=false
function cleanup() {
if [[ "$success" == "false" ]]; then
rm /tmp/healthy/infra-builder
fi
}
trap cleanup EXIT
printf "Waiting 30 seconds for the libvirt and docker services to be ready\n"
sleep 30
ansible-playbook -v /opt/ansible/playbooks/build-infra.yaml \
-e local_src_dir="$(pwd)"
success=true
/signal_complete infra-builder

View File

@ -14,6 +14,18 @@
set -ex
# Create the "canary" file, indicating that the container is healthy
mkdir -p /tmp/healthy
touch /tmp/healthy/runner
success=false
function cleanup() {
if [[ "$success" == "false" ]]; then
rm /tmp/healthy/runner
fi
}
trap cleanup EXIT
# Wait until artifact-setup and libvirt infrastructure has been built
/wait_for artifact-setup
/wait_for infra-builder
@ -67,4 +79,5 @@ fi
./tools/deployment/25_deploy_gating.sh
success=true
/signal_complete runner