Step: upi-deprovision-ibmz-eco

This step deprovisions a UPI cluster on the IBM Z Ecosystem Cloud.

Container image used for this step: ibmz-eco/ibmz-eco-openshift-deployer:latest

ibmz-eco/ibmz-eco-openshift-deployer:latest resolves to an image imported from the specified imagestream tag on the build farm (documentation).

Environment

Step exposes no environmental variables except the defaults.

Source Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM

export http_proxy="http://204.90.115.172:8080"
export https_proxy="http://204.90.115.172:8080"

ibmz_eco_cloud_auth=/var/run/secrets/openstack/clouds.yaml
cluster_name=$(<"${SHARED_DIR}"/clustername.txt)
installer_dir=/deploy
cluster_dir=${installer_dir}/ocp_clusters/${cluster_name}

echo "$(date -u --rfc-3339=seconds) - Copying config from shared dir..."

mkdir -p ${cluster_dir}
pushd ${installer_dir}

cp -t "${installer_dir}" \
    "${SHARED_DIR}/terraform.tfvars" \
    ${ibmz_eco_cloud_auth}

cp -t "${cluster_dir}" \
    "${SHARED_DIR}/cluster_dir.tgz"

cd ${cluster_dir} && tar -xv -f cluster_dir.tgz
gzip -d "${cluster_dir}/terraform.tfstate.gz"
touch "${cluster_dir}/ocp_install/bootstrap.ign"
cd ${installer_dir}

ocp_version=$(cat ${installer_dir}/terraform.tfvars | grep openshift_version | cut -d= -f2 | sed -e 's/"//' -e 's/"$//')

echo "$(date +%s)" > "${SHARED_DIR}/TEST_TIME_DEPROVISION_START"

echo "$(date -u --rfc-3339=seconds) - Destroying cluster on IBM Z Ecosystem Cloud... OpenShift ${ocp_version}"
/entrypoint.sh destroy &

set +e
wait "$!"
ret="$?"
set -e

if [ $ret -ne 0 ]; then
  set +e
  # Attempt to gather tfstate file and logs.
  echo "$(date -u --rfc-3339=seconds) - Destroy failed, gathering tfstate file and logs..."
  gzip "${cluster_dir}/terraform.tfstate"
  cp -t "${SHARED_DIR}" \
      "${cluster_dir}/terraform.tfstate.gz"
  set -e
  exit "$ret"
fi

echo "$(date +%s)" > "${SHARED_DIR}/TEST_TIME_DEPROVISION_END"

touch /tmp/deprovision-complete

exit "$ret"

Properties

Property Value Description
Termination grace period[?] 10m0s Period of time until SIGKILL signal is sent to the test pod (after SIGTERM signal is sent).
Resource requests (cpu) 10m Used in .resources.requests of the pod running this step.
Resource requests (memory) 100Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/upi/deprovision/ibmz-eco/upi-deprovision-ibmz-eco-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub