Skip to content

Commit

Permalink
ci-operator/templates/openshift/installer/cluster-launch-installer-up…
Browse files Browse the repository at this point in the history
…i*: Switch on BRANCH for RHCOS AMI

As discussed in dc26075 (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 22e30ea (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]: openshift/openshift-docs#18396
[2]: openshift/openshift-docs#18395
  • Loading branch information
wking committed Dec 5, 2019
1 parent 2e67a85 commit 4972b87
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.1"
- name: CLUSTER_TYPE
value: aws
- name: CONFIG_SPEC
Expand Down Expand Up @@ -307,6 +309,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.1"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.2"
- name: CLUSTER_TYPE
value: aws
- name: CONFIG_SPEC
Expand Down Expand Up @@ -702,6 +704,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.2"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: aws
- name: CONFIG_SPEC
Expand Down Expand Up @@ -579,6 +581,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: gcp
- name: CONFIG_SPEC
Expand Down Expand Up @@ -652,6 +656,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: aws
- name: CONFIG_SPEC
Expand Down Expand Up @@ -581,6 +583,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: gcp
- name: CONFIG_SPEC
Expand Down Expand Up @@ -654,6 +658,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: aws
- name: CONFIG_SPEC
Expand Down Expand Up @@ -575,6 +577,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: gcp
- name: CONFIG_SPEC
Expand Down Expand Up @@ -647,6 +651,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.1"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down Expand Up @@ -730,6 +732,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.1"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.2"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down Expand Up @@ -1040,6 +1042,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.2"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down Expand Up @@ -1042,6 +1044,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.3"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down Expand Up @@ -995,6 +997,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.4"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down Expand Up @@ -988,6 +990,8 @@ presubmits:
command:
- ci-operator
env:
- name: BRANCH
value: "4.5"
- name: CLUSTER_TYPE
value: vsphere
- name: CONFIG_SPEC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: Template
apiVersion: template.openshift.io/v1

parameters:
- name: BRANCH
- name: JOB_NAME_SAFE
required: true
- name: JOB_NAME_HASH
Expand Down Expand Up @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: Template
apiVersion: template.openshift.io/v1

parameters:
- name: BRANCH
- name: JOB_NAME_SAFE
required: true
- name: JOB_NAME_HASH
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 4972b87

Please sign in to comment.