-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for creating arm machine on GCP
- Loading branch information
1 parent
2c07017
commit 59c874d
Showing
24 changed files
with
481 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ci-operator/step-registry/code-ready/snc/microshift-arm/OWNERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
approvers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad | ||
reviewers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad |
15 changes: 15 additions & 0 deletions
15
...gistry/code-ready/snc/microshift-arm/code-ready-snc-microshift-arm-workflow.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"path": "code-ready/snc/microshift-arm/code-ready-snc-microshift-arm-workflow.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
], | ||
"reviewers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
] | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...r/step-registry/code-ready/snc/microshift-arm/code-ready-snc-microshift-arm-workflow.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
workflow: | ||
as: code-ready-snc-microshift-arm | ||
steps: | ||
pre: | ||
- chain: upi-gcp-arm-pre | ||
- ref: code-ready-snc-subscription | ||
test: | ||
- ref: code-ready-snc-microshift-arm-test | ||
post: | ||
- ref: gather-snc | ||
- chain: upi-gcp-arm-post | ||
documentation: |- | ||
The snc E2E workflow executes the common end-to-end test suite for snc with a GCP arm cluster configuration. |
8 changes: 8 additions & 0 deletions
8
ci-operator/step-registry/code-ready/snc/microshift-arm/test/OWNERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
approvers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad | ||
reviewers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad |
80 changes: 80 additions & 0 deletions
80
...egistry/code-ready/snc/microshift-arm/test/code-ready-snc-microshift-arm-test-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM | ||
|
||
GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)" | ||
GOOGLE_COMPUTE_REGION="${LEASED_RESOURCE}" | ||
GOOGLE_COMPUTE_ZONE="$(< ${SHARED_DIR}/openshift_gcp_compute_zone)" | ||
if [[ -z "${GOOGLE_COMPUTE_ZONE}" ]]; then | ||
echo "Expected \${SHARED_DIR}/openshift_gcp_compute_zone to contain the GCP zone" | ||
exit 1 | ||
fi | ||
|
||
INSTANCE_PREFIX="${NAMESPACE}"-"${JOB_NAME_HASH}" | ||
|
||
mkdir -p "${HOME}"/.ssh | ||
mock-nss.sh | ||
|
||
# gcloud compute will use this key rather than create a new one | ||
cp "${CLUSTER_PROFILE_DIR}"/ssh-privatekey "${HOME}"/.ssh/google_compute_engine | ||
chmod 0600 "${HOME}"/.ssh/google_compute_engine | ||
cp "${CLUSTER_PROFILE_DIR}"/ssh-publickey "${HOME}"/.ssh/google_compute_engine.pub | ||
echo 'ServerAliveInterval 30' | tee -a "${HOME}"/.ssh/config | ||
echo 'ServerAliveCountMax 1200' | tee -a "${HOME}"/.ssh/config | ||
chmod 0600 "${HOME}"/.ssh/config | ||
|
||
# Copy pull secret to user home | ||
cp "${CLUSTER_PROFILE_DIR}"/pull-secret "${HOME}"/pull-secret | ||
|
||
gcloud auth activate-service-account --quiet --key-file "${CLUSTER_PROFILE_DIR}"/gce.json | ||
gcloud --quiet config set project "${GOOGLE_PROJECT_ID}" | ||
gcloud --quiet config set compute/zone "${GOOGLE_COMPUTE_ZONE}" | ||
gcloud --quiet config set compute/region "${GOOGLE_COMPUTE_REGION}" | ||
|
||
cat > "${HOME}"/run-tests.sh << 'EOF' | ||
#!/bin/bash | ||
set -euo pipefail | ||
export PATH=/home/packer:$PATH | ||
function run-tests() { | ||
pushd snc | ||
set -e | ||
export OPENSHIFT_PULL_SECRET_PATH="${HOME}"/pull-secret | ||
./ci_microshift.sh | ||
popd | ||
} | ||
run-tests | ||
EOF | ||
|
||
chmod +x "${HOME}"/run-tests.sh | ||
|
||
LD_PRELOAD=/usr/lib64/libnss_wrapper.so gcloud compute scp \ | ||
--quiet \ | ||
--project "${GOOGLE_PROJECT_ID}" \ | ||
--zone "${GOOGLE_COMPUTE_ZONE}" \ | ||
--recurse "${HOME}"/run-tests.sh packer@"${INSTANCE_PREFIX}":~/run-tests.sh | ||
|
||
LD_PRELOAD=/usr/lib64/libnss_wrapper.so gcloud compute scp \ | ||
--quiet \ | ||
--project "${GOOGLE_PROJECT_ID}" \ | ||
--zone "${GOOGLE_COMPUTE_ZONE}" \ | ||
--recurse "${HOME}"/pull-secret packer@"${INSTANCE_PREFIX}":~/pull-secret | ||
|
||
LD_PRELOAD=/usr/lib64/libnss_wrapper.so gcloud compute scp \ | ||
--quiet \ | ||
--project "${GOOGLE_PROJECT_ID}" \ | ||
--zone "${GOOGLE_COMPUTE_ZONE}" \ | ||
--recurse /opt/snc packer@"${INSTANCE_PREFIX}":~/snc | ||
|
||
LD_PRELOAD=/usr/lib64/libnss_wrapper.so gcloud compute --project "${GOOGLE_PROJECT_ID}" ssh \ | ||
--zone "${GOOGLE_COMPUTE_ZONE}" \ | ||
packer@"${INSTANCE_PREFIX}" \ | ||
--command 'sudo yum install -y unzip' | ||
|
||
LD_PRELOAD=/usr/lib64/libnss_wrapper.so gcloud compute --project "${GOOGLE_PROJECT_ID}" ssh \ | ||
--zone "${GOOGLE_COMPUTE_ZONE}" \ | ||
packer@"${INSTANCE_PREFIX}" \ | ||
--command "export PULL_NUMBER=${PULL_NUMBER} && timeout 360m bash -ce \"/home/packer/run-tests.sh\"" |
15 changes: 15 additions & 0 deletions
15
...y/code-ready/snc/microshift-arm/test/code-ready-snc-microshift-arm-test-ref.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"path": "code-ready/snc/microshift-arm/test/code-ready-snc-microshift-arm-test-ref.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
], | ||
"reviewers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
] | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...p-registry/code-ready/snc/microshift-arm/test/code-ready-snc-microshift-arm-test-ref.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ref: | ||
as: code-ready-snc-microshift-arm-test | ||
from: snc | ||
grace_period: 10m | ||
commands: code-ready-snc-microshift-arm-test-commands.sh | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 100Mi | ||
timeout: 4h0m0s | ||
env: | ||
- name: HOME | ||
default: /tmp/secret | ||
- name: NSS_WRAPPER_PASSWD | ||
default: /tmp/secret/passwd | ||
- name: NSS_WRAPPER_GROUP | ||
default: /tmp/secret/group | ||
- name: NSS_USERNAME | ||
default: packer | ||
- name: NSS_GROUPNAME | ||
default: packer | ||
documentation: >- | ||
This step provision the snc deployments created by upi-install-gcp-arm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
approvers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad | ||
reviewers: | ||
- praveenkumar | ||
- cfergeau | ||
- gbraad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../OWNERS |
15 changes: 15 additions & 0 deletions
15
ci-operator/step-registry/upi/gcp/arm/post/upi-gcp-arm-post-chain.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"path": "upi/gcp/arm/post/upi-gcp-arm-post-chain.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
], | ||
"reviewers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
] | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
ci-operator/step-registry/upi/gcp/arm/post/upi-gcp-arm-post-chain.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
chain: | ||
as: upi-gcp-arm-post | ||
steps: | ||
- ref: upi-gcp-arm-post | ||
documentation: >- | ||
This chain deprovisions all the components created by the upi-gcp-pre chain. |
34 changes: 34 additions & 0 deletions
34
ci-operator/step-registry/upi/gcp/arm/post/upi-gcp-arm-post-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
INSTANCE_PREFIX="${NAMESPACE}-${UNIQUE_HASH}" | ||
GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)" | ||
GOOGLE_COMPUTE_REGION="${LEASED_RESOURCE}" | ||
GOOGLE_COMPUTE_ZONE="$(< ${SHARED_DIR}/openshift_gcp_compute_zone)" | ||
if [[ -z "${GOOGLE_COMPUTE_ZONE}" ]]; then | ||
echo "Expected \${SHARED_DIR}/openshift_gcp_compute_zone to contain the GCP zone" | ||
exit 1 | ||
fi | ||
|
||
function teardown() { | ||
# This is for running the gcloud commands | ||
mock-nss.sh | ||
gcloud auth activate-service-account \ | ||
--quiet --key-file "${CLUSTER_PROFILE_DIR}/gce.json" | ||
gcloud --quiet config set project "${GOOGLE_PROJECT_ID}" | ||
gcloud --quiet config set compute/zone "${GOOGLE_COMPUTE_ZONE}" | ||
gcloud --quiet config set compute/region "${GOOGLE_COMPUTE_REGION}" | ||
|
||
set -x | ||
set +e | ||
|
||
echo "Deprovisioning cluster ..." | ||
gcloud compute instances delete "${INSTANCE_PREFIX}" --quiet | ||
gcloud compute firewall-rules delete "${INSTANCE_PREFIX}" --quiet | ||
gcloud compute networks subnets delete "${INSTANCE_PREFIX}" --quiet | ||
gcloud compute networks delete "${INSTANCE_PREFIX}" --quiet | ||
} | ||
|
||
trap 'teardown' EXIT | ||
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM |
15 changes: 15 additions & 0 deletions
15
ci-operator/step-registry/upi/gcp/arm/post/upi-gcp-arm-post-ref.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"path": "upi/gcp/arm/post/upi-gcp-arm-post-ref.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
], | ||
"reviewers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
] | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
ci-operator/step-registry/upi/gcp/arm/post/upi-gcp-arm-post-ref.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ref: | ||
as: upi-gcp-arm-post | ||
from: libvirt-installer | ||
grace_period: 10m | ||
commands: upi-gcp-arm-post-commands.sh | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 100Mi | ||
env: | ||
- name: HOME | ||
default: /tmp/secret | ||
- name: NSS_WRAPPER_PASSWD | ||
default: /tmp/secret/passwd | ||
- name: NSS_WRAPPER_GROUP | ||
default: /tmp/secret/group | ||
- name: NSS_USERNAME | ||
default: packer | ||
- name: NSS_GROUPNAME | ||
default: packer | ||
documentation: >- | ||
This step deprovisions the gcloud deployments created by upi-install-gcp-arm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../OWNERS |
15 changes: 15 additions & 0 deletions
15
ci-operator/step-registry/upi/gcp/arm/pre/upi-gcp-arm-pre-chain.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"path": "upi/gcp/arm/pre/upi-gcp-arm-pre-chain.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
], | ||
"reviewers": [ | ||
"praveenkumar", | ||
"cfergeau", | ||
"gbraad" | ||
] | ||
} | ||
} |
Oops, something went wrong.