Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions ci-operator/step-registry/gather/proxy/gather-proxy-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@ set -o pipefail

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

export AWS_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"

if test ! -f "${SHARED_DIR}/proxyregion"
then
echo "No proxyregion, so unknown AWS region, so unable to tear down ."
exit 0
fi

REGION="$(cat "${SHARED_DIR}/proxyregion")"
PROXY_NAME="${NAMESPACE}-${JOB_NAME_HASH}"

# cleaning up after ourselves
if aws --region "${REGION}" s3api head-bucket --bucket "${PROXY_NAME}" > /dev/null 2>&1
then
aws --region "${REGION}" s3 rb "s3://${PROXY_NAME}" --force
fi

STACK_NAME="${PROXY_NAME}-proxy"

# collect logs from the proxy here
if [ -f "${SHARED_DIR}/proxyip" ]; then
proxy_ip="$(cat "${SHARED_DIR}/proxyip")"
Expand All @@ -36,10 +17,4 @@ if [ -f "${SHARED_DIR}/proxyip" ]; then
eval "$(ssh-agent)"
ssh-add "${CLUSTER_PROFILE_DIR}/ssh-privatekey"
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null "core@${proxy_ip}" 'journalctl -u squid' > "${ARTIFACT_DIR}/squid.service"
fi

aws --region "${REGION}" cloudformation delete-stack --stack-name "${STACK_NAME}" &
wait "$!"

aws --region "${REGION}" cloudformation wait stack-delete-complete --stack-name "${STACK_NAME}" &
wait "$!"
fi
7 changes: 2 additions & 5 deletions ci-operator/step-registry/gather/proxy/gather-proxy-ref.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
ref:
as: gather-proxy
from_image:
namespace: ocp
name: "4.5"
tag: upi-installer
from: upi-installer
commands: gather-proxy-commands.sh
resources:
requests:
cpu: 300m
memory: 300Mi
documentation: |-
The gather step collects journal logs from the proxy and deprovisions it.
The gather step collects journal logs from the proxy.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ chain:
steps:
- ref: gather-aws-console
- ref: gather-proxy
- ref: ipi-deprovision-proxy
- chain: ipi-deprovision
documentation: |-
The IPI cleanup step contains all steps that gather and deprovision an OpenShift cluster on AWS, provisioned by the `ipi-aws-pre-proxy` chain.
3 changes: 3 additions & 0 deletions ci-operator/step-registry/ipi/deprovision/proxy/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
approvers:
- wking
- ewolinetz
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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 AWS_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"

if test ! -f "${SHARED_DIR}/proxyregion"
then
echo "No proxyregion, so unknown AWS region, so unable to tear down."
exit 0
fi

REGION="$(cat "${SHARED_DIR}/proxyregion")"
PROXY_NAME="${NAMESPACE}-${JOB_NAME_HASH}"
STACK_NAME="${PROXY_NAME}-proxy"

# cleaning up after ourselves
if aws --region "${REGION}" s3api head-bucket --bucket "${PROXY_NAME}" > /dev/null 2>&1
then
aws --region "${REGION}" s3 rb "s3://${PROXY_NAME}" --force
fi

aws --region "${REGION}" cloudformation delete-stack --stack-name "${STACK_NAME}" &
wait "$!"

aws --region "${REGION}" cloudformation wait stack-delete-complete --stack-name "${STACK_NAME}" &
wait "$!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ref:
as: ipi-deprovision-proxy
from_image:
namespace: ocp
name: "4.5"
tag: upi-installer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we must be pinning this because of the aws client? Looks like yes: openshift/installer#3292. Can we call that out in the commit message? And maybe drop the 4.5-pinning for gather-proxy-ref.yaml now that it no longer uses aws?

commands: ipi-deprovision-proxy-commands.sh
resources:
requests:
cpu: 300m
memory: 300Mi
documentation: |-
The deprovision step tears down the proxy and removes its s3 ignition config.
9 changes: 9 additions & 0 deletions ci-operator/step-registry/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,15 @@
]
}
},
"ipi-deprovision-proxy-ref.yaml": {
"path": "ipi/deprovision/proxy/ipi-deprovision-proxy-ref.yaml",
"owners": {
"approvers": [
"wking",
"ewolinetz"
]
}
},
"ipi-deprovision-vsphere-dns-ref.yaml": {
"path": "ipi/deprovision/vsphere/dns/ipi-deprovision-vsphere-dns-ref.yaml",
"owners": {
Expand Down