From 4972b87df1d1c09983a72a99f72e9d93a2fda6ff Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 4 Dec 2019 15:25:30 -0800 Subject: [PATCH 1/2] ci-operator/templates/openshift/installer/cluster-launch-installer-upi*: Switch on BRANCH for RHCOS AMI As discussed in dc26075230 (ci-operator/templates/openshift/installer: Bump AWS UPI to RHCOS 43.81.201911221453.0, 2019-12-02, #6192), we want a way to switch on the z stream when selecting the RHCOS AMI. We amight also need this if other parts of the recommended user-provided-infrastructure flow diverge between z streams, although at the moment the AMI is the only divergence. In this commit, I'm sourcing my AMIs with: $ git cat-file -p origin/release-4.1:data/data/rhcos.json | jq -r '.amis["us-east-1"].hvm' ami-046fe691f52a953f9 $ git cat-file -p origin/release-4.2:data/data/rhcos.json | jq -r '.amis["us-east-1"].hvm' ami-01e7fdcb66157b224 $ git cat-file -p origin/release-4.3:data/data/rhcos.json | jq -r '.amis["us-east-1"].hvm' ami-014ce8846db8b463d $ git cat-file -p origin/master:data/data/rhcos.json | jq -r '.amis["us-east-1"].hvm' ami-014ce8846db8b463d as the installer stood at 2019-12-04T23:30Z. Comparing with the user-facing docs: $ git --no-pager grep -hA1 us-east-1 origin/enterprise-4.1:modules/installation-aws-user-infra-rhcos-ami.adoc |`us-east-1` |`ami-046fe691f52a953f9` $ git --no-pager grep -hA1 us-east-1 origin/enterprise-4.2:modules/installation-aws-user-infra-rhcos-ami.adoc |`us-east-1` |`ami-01e7fdcb66157b224` $ git --no-pager grep -hA1 us-east-1 origin/enterprise-4.3:modules/installation-aws-user-infra-rhcos-ami.adoc |`us-east-1` |`ami-01e7fdcb66157b224` $ git --no-pager grep -hA1 us-east-1 origin/enterprise-4.4:modules/installation-aws-user-infra-rhcos-ami.adoc fatal: Invalid object name 'origin/enterprise-4.4'. $ git --no-pager grep -hA1 us-east-1 origin/master:modules/installation-aws-user-infra-rhcos-ami.adoc |`us-east-1` |`ami-01e7fdcb66157b224` So we currently diverge for 4.3 and master, where I have [1,2] open to close the gaps. The BRANCH environment variable has been around since 22e30eac2b (The release promotion periodic can be conditional and no-op if no change, 2019-04-30, #3649). I added it to all jobs based on the UPI template where it was missing (it was already on a number of those jobs). [1]: https://github.com/openshift/openshift-docs/pull/18396 [2]: https://github.com/openshift/openshift-docs/pull/18395 --- .../openshift-installer-release-4.1-presubmits.yaml | 4 ++++ .../openshift-installer-release-4.2-presubmits.yaml | 4 ++++ .../openshift-installer-release-4.3-presubmits.yaml | 6 ++++++ .../openshift-installer-release-4.4-presubmits.yaml | 6 ++++++ .../openshift-installer-release-4.5-presubmits.yaml | 6 ++++++ ...t-machine-config-operator-release-4.3-presubmits.yaml | 2 ++ ...t-machine-config-operator-release-4.4-presubmits.yaml | 2 ++ ...t-machine-config-operator-release-4.5-presubmits.yaml | 2 ++ .../origin/openshift-origin-release-4.1-presubmits.yaml | 4 ++++ .../origin/openshift-origin-release-4.2-presubmits.yaml | 4 ++++ .../origin/openshift-origin-release-4.3-presubmits.yaml | 4 ++++ .../origin/openshift-origin-release-4.4-presubmits.yaml | 4 ++++ .../origin/openshift-origin-release-4.5-presubmits.yaml | 4 ++++ .../installer/cluster-launch-installer-upi-e2e.yaml | 9 ++++++++- .../installer/cluster-launch-installer-upi-src.yaml | 9 ++++++++- 15 files changed, 68 insertions(+), 2 deletions(-) diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.1-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.1-presubmits.yaml index 3dabb9a335e2a..12651ed99734c 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.1-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.1-presubmits.yaml @@ -236,6 +236,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.1" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC @@ -307,6 +309,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.1" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.2-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.2-presubmits.yaml index 4396a4b334947..a77b51b43634e 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.2-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.2-presubmits.yaml @@ -308,6 +308,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.2" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC @@ -702,6 +704,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.2" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.3-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.3-presubmits.yaml index de7ed80b90881..0458e95b20faa 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.3-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.3-presubmits.yaml @@ -308,6 +308,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC @@ -579,6 +581,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: gcp - name: CONFIG_SPEC @@ -652,6 +656,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.4-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.4-presubmits.yaml index 8a3fe5173a58b..d3816a7de5029 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.4-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.4-presubmits.yaml @@ -308,6 +308,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC @@ -581,6 +583,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: gcp - name: CONFIG_SPEC @@ -654,6 +658,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.5-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.5-presubmits.yaml index 0c3b7d1008818..08d4830426b64 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-release-4.5-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-release-4.5-presubmits.yaml @@ -304,6 +304,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC @@ -575,6 +577,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: gcp - name: CONFIG_SPEC @@ -647,6 +651,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.3-presubmits.yaml b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.3-presubmits.yaml index e5402d6e0db6f..d0f606691adf4 100644 --- a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.3-presubmits.yaml +++ b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.3-presubmits.yaml @@ -383,6 +383,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.4-presubmits.yaml b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.4-presubmits.yaml index 5cf5967dea1ad..ace9ebbb1c345 100644 --- a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.4-presubmits.yaml +++ b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.4-presubmits.yaml @@ -382,6 +382,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.5-presubmits.yaml b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.5-presubmits.yaml index 8f78ef42713e6..36c5c38d961a3 100644 --- a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.5-presubmits.yaml +++ b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-release-4.5-presubmits.yaml @@ -378,6 +378,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.1-presubmits.yaml b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.1-presubmits.yaml index 1aee137a6e014..ebdf1004677ef 100644 --- a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.1-presubmits.yaml +++ b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.1-presubmits.yaml @@ -561,6 +561,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.1" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC @@ -730,6 +732,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.1" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.2-presubmits.yaml b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.2-presubmits.yaml index 1150565ab3a07..bd42bb2806a6e 100644 --- a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.2-presubmits.yaml +++ b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.2-presubmits.yaml @@ -871,6 +871,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.2" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC @@ -1040,6 +1042,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.2" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.3-presubmits.yaml b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.3-presubmits.yaml index f49bbdfae1384..a605dc1572e43 100644 --- a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.3-presubmits.yaml +++ b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.3-presubmits.yaml @@ -873,6 +873,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC @@ -1042,6 +1044,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.3" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.4-presubmits.yaml b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.4-presubmits.yaml index c7748771aee92..d530e4143d5a5 100644 --- a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.4-presubmits.yaml +++ b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.4-presubmits.yaml @@ -875,6 +875,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC @@ -995,6 +997,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.4" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.5-presubmits.yaml b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.5-presubmits.yaml index a125fb57f226a..c0278a34b9b2c 100644 --- a/ci-operator/jobs/openshift/origin/openshift-origin-release-4.5-presubmits.yaml +++ b/ci-operator/jobs/openshift/origin/openshift-origin-release-4.5-presubmits.yaml @@ -868,6 +868,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC @@ -988,6 +990,8 @@ presubmits: command: - ci-operator env: + - name: BRANCH + value: "4.5" - name: CLUSTER_TYPE value: vsphere - name: CONFIG_SPEC diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml index 2c7886a8b8528..6e9163a4c6cca 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml @@ -2,6 +2,7 @@ kind: Template apiVersion: template.openshift.io/v1 parameters: +- name: BRANCH - name: JOB_NAME_SAFE required: true - name: JOB_NAME_HASH @@ -1265,7 +1266,13 @@ objects: # begin bootstrapping if [[ "${CLUSTER_TYPE}" == "aws" ]]; then - RHCOS_AMI=ami-014ce8846db8b463d # FIXME: assumes AWS_REGION is us-east-1 + case "${BRANCH}" in # FIXME: assumes AWS_REGION is us-east-1 + 4.1) RHCOS_AMI=ami-046fe691f52a953f9;; + 4.2) RHCOS_AMI=ami-01e7fdcb66157b224;; + 4.3) RHCOS_AMI=ami-014ce8846db8b463d;; + *) RHCOS_AMI=ami-014ce8846db8b463d;; + esac + echo "RHCOS AMI: ${RHCOS_AMI}" # FIXME: get epel-release or otherwise add awscli to our UPI image export PATH="${HOME}/.local/bin:${PATH}" diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml index a50677c743842..f3cd31fee3ed6 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml @@ -2,6 +2,7 @@ kind: Template apiVersion: template.openshift.io/v1 parameters: +- name: BRANCH - name: JOB_NAME_SAFE required: true - name: JOB_NAME_HASH @@ -575,7 +576,13 @@ objects: # begin bootstrapping if [[ "${CLUSTER_TYPE}" == "aws" ]]; then - RHCOS_AMI=ami-014ce8846db8b463d # FIXME: assumes AWS_REGION is us-east-1 + case "${BRANCH}" in # FIXME: assumes AWS_REGION is us-east-1 + 4.1) RHCOS_AMI=ami-046fe691f52a953f9;; + 4.2) RHCOS_AMI=ami-01e7fdcb66157b224;; + 4.3) RHCOS_AMI=ami-014ce8846db8b463d;; + *) RHCOS_AMI=ami-014ce8846db8b463d;; + esac + echo "RHCOS AMI: ${RHCOS_AMI}" # FIXME: get epel-release or otherwise add awscli to our UPI image export PATH="${HOME}/.local/bin:${PATH}" From 545d327e750b35978233cf70f2d60cdd4df90f89 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 4 Dec 2019 17:01:31 -0800 Subject: [PATCH 2/2] ci-operator/templates/openshift/installer/cluster-launch-installer-upi*: WorkerSubnet for 4.1 456f258d72 (ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e: WorkerSubnet -> Subnet, 2019-06-09, #4013) does not apply to 4.1. Switch on BRANCH to use the old WorkerSubnet for 4.1. --- .../installer/cluster-launch-installer-upi-e2e.yaml | 6 +++++- .../installer/cluster-launch-installer-upi-src.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml index 6e9163a4c6cca..330da8c2dc491 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml @@ -1511,6 +1511,10 @@ objects: for INDEX in 0 1 2 do SUBNET="PRIVATE_SUBNET_${INDEX}" + case "${BRANCH}" in + 4.1) SUBNET_KEY=WorkerSubnet;; + *) SUBNET_KEY=Subnet;; + esac aws cloudformation create-stack \ --stack-name "${CLUSTER_NAME}-compute-${INDEX}" \ --template-body "$(cat "/var/lib/openshift-install/upi/${CLUSTER_TYPE}/cloudformation/06_cluster_worker_node.yaml")" \ @@ -1518,7 +1522,7 @@ objects: --parameters \ ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \ ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \ - ParameterKey=Subnet,ParameterValue="${!SUBNET}" \ + ParameterKey="${SUBNET_KEY},ParameterValue=${!SUBNET}" \ ParameterKey=WorkerSecurityGroupId,ParameterValue="${WORKER_SECURITY_GROUP}" \ ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/worker" \ ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \ diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml index f3cd31fee3ed6..5acaf4f306a86 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml @@ -728,6 +728,10 @@ objects: for INDEX in 0 1 2 do SUBNET="PRIVATE_SUBNET_${INDEX}" + case "${BRANCH}" in + 4.1) SUBNET_KEY=WorkerSubnet;; + *) SUBNET_KEY=Subnet;; + esac aws cloudformation create-stack \ --stack-name "${CLUSTER_NAME}-compute-${INDEX}" \ --template-body "$(cat "/var/lib/openshift-install/upi/${CLUSTER_TYPE}/cloudformation/06_cluster_worker_node.yaml")" \ @@ -735,7 +739,7 @@ objects: --parameters \ ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \ ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \ - ParameterKey=Subnet,ParameterValue="${!SUBNET}" \ + ParameterKey="${SUBNET_KEY},ParameterValue=${!SUBNET}" \ ParameterKey=WorkerSecurityGroupId,ParameterValue="${WORKER_SECURITY_GROUP}" \ ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/worker" \ ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \