Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci-operator/templates/openshift/installer: Shared subnets for new regions #6845

Merged

Conversation

wking
Copy link
Member

@wking wking commented Jan 23, 2020

Catching up with b717933 (#6833), add shares subnets for the new regions. This is basically as described in 424a04a (#5550), although I've dropped the --stack-policy-body mentioned in that commit message (I dunno what it was about, since the commit message didn't give it the argument that --stack-policy-body expects). Generated using:

$ export AWS_PROFILE=ci  # or whatever you call it locally
$ git fetch origin
$ date --iso=m --utc
2020-01-23T20:41+0000
$ git checkout origin/release-4.3
$ git --no-pager log --oneline -1
2055609f9 (HEAD, origin/release-4.3) Merge pull request #2928 from ashcrow/4.3-signed-rhcos-bump

with:

for REGION in us-east-1 us-west-1 us-west-2
do
  COUNT=3
  if test us-west-1 = "${REGION}"
  then
    COUNT=2
  fi
  for INDEX in 1 2 3 4
  do
    NAME="do-not-delete-shared-vpc-${INDEX}"
    aws --region "${REGION}" cloudformation create-stack --stack-name "${NAME}" --template-body "$(cat upi/aws/cloudformation/01_vpc.yaml)" --parameters "ParameterKey=AvailabilityZoneCount,ParameterValue=${COUNT}" >/dev/null
    aws --region "${REGION}" cloudformation wait stack-create-complete --stack-name "${NAME}"
    SUBNETS="$(aws --region "${REGION}" cloudformation describe-stacks --stack-name "${NAME}" | jq -c '[.Stacks[].Outputs[] | select(.OutputKey | endswith("SubnetIds")).OutputValue | split(",")[]]' | sed "s/\"/'/g")"
    echo "${REGION}_$((INDEX - 1))) subnets=\"${SUBNETS}\";;"
  done
done

which spits out:

us-east-2_0) subnets="['subnet-0faf6d16c378ee7a7','subnet-0e104572db1b7d092','subnet-014ca96c04f36adec','subnet-0ea06057dceadfe8e','subnet-0689efe5e1f9f4212','subnet-0d36bb8edbcb3d916']";;
us-east-2_1) subnets="['subnet-085787cc4b80b84b2','subnet-09dfbf66e8f6e5b50','subnet-0db5d90ff3087444e','subnet-047f15f2a0210fbe0','subnet-0bf13f041c4233849','subnet-0e2a5320549e289d8']";;
...

The COUNT bit for us-west-1 is because our CI account only has access to two zones there:

$ aws --region us-west-1 ec2 describe-availability-zones --output text
AVAILABILITYZONES		 us-west-1					available												usw1-az3 us-west-1a
AVAILABILITYZONES		 us-west-1					available												usw1-az1 us-west-1b

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 23, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2020
@sdodson
Copy link
Member

sdodson commented Jan 23, 2020

/lgtm
/hold
don't know if you're hoping to see decent signal from rehearse or not

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jan 23, 2020
@smarterclayton
Copy link
Contributor

It didn't trigger a shared vpc test unfortunately.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@wking
Copy link
Member Author

wking commented Jan 23, 2020

It didn't trigger a shared vpc test unfortunately.

I've pushed 7e1c123c3 to try and trigger a shared-vpc rehearsal.

/hold

We can lift the hold if that works, after we drop the WIP commit back off.

…ions

Catching up with b717933
(ci-operator/templates/openshift/installer/cluster-launch-installer-*:
Random AWS regions for IPI, 2020-01-23, openshift#6833), add shares subnets for
the new regions.  This is basically as described in 424a04a (Add
shared vpc CI job for installer repo and informing periodics,
2019-08-22, openshift#5550), although I've dropped the --stack-policy-body
mentioned in that commit message (I dunno what it was about, since the
commit message didn't give it the argument that --stack-policy-body
expects).  Generated using:

  $ export AWS_PROFILE=ci  # or whatever you call it locally
  $ git fetch origin
  $ date --iso=m --utc
  2020-01-23T20:41+0000
  $ git checkout origin/release-4.3
  $ git --no-pager log --oneline -1
  2055609f9 (HEAD, origin/release-4.3) Merge pull request openshift#2928 from ashcrow/4.3-signed-rhcos-bump

with:

  for REGION in us-east-1 us-west-1 us-west-2
  do
    COUNT=3
    if test us-west-1 = "${REGION}"
    then
      COUNT=2
    fi
    for INDEX in 1 2 3 4
    do
      NAME="do-not-delete-shared-vpc-${INDEX}"
      aws --region "${REGION}" cloudformation create-stack --stack-name "${NAME}" --template-body "$(cat upi/aws/cloudformation/01_vpc.yaml)" --parameters "ParameterKey=AvailabilityZoneCount,ParameterValue=${COUNT}" >/dev/null
      aws --region "${REGION}" cloudformation wait stack-create-complete --stack-name "${NAME}"
      SUBNETS="$(aws --region "${REGION}" cloudformation describe-stacks --stack-name "${NAME}" | jq -c '[.Stacks[].Outputs[] | select(.OutputKey | endswith("SubnetIds")).OutputValue | split(",")[]]' | sed "s/\"/'/g")"
      echo "${REGION}_$((INDEX - 1))) subnets=\"${SUBNETS}\";;"
    done
  done

which spits out:

  us-east-2_0) subnets="['subnet-0faf6d16c378ee7a7','subnet-0e104572db1b7d092','subnet-014ca96c04f36adec','subnet-0ea06057dceadfe8e','subnet-0689efe5e1f9f4212','subnet-0d36bb8edbcb3d916']";;
  us-east-2_1) subnets="['subnet-085787cc4b80b84b2','subnet-09dfbf66e8f6e5b50','subnet-0db5d90ff3087444e','subnet-047f15f2a0210fbe0','subnet-0bf13f041c4233849','subnet-0e2a5320549e289d8']";;
  ...

The COUNT bit for us-west-1 is because our CI account only has access
to two zones there:

  $ aws --region us-west-1 ec2 describe-availability-zones --output text
  AVAILABILITYZONES		 us-west-1					available												usw1-az3 us-west-1a
  AVAILABILITYZONES		 us-west-1					available												usw1-az1 us-west-1b
@wking wking force-pushed the shared-subnets-for-other-regions branch from 7e1c123 to c1dc247 Compare January 23, 2020 22:50
@wking
Copy link
Member Author

wking commented Jan 23, 2020

Hooray for rehearsals:

/bin/bash: -c: line 69: syntax error near unexpected token `)'

Should be fixed with 7e1c123c3 -> c1dc24782, but I guess we'll see ;).

@sdodson
Copy link
Member

sdodson commented Jan 23, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@wking
Copy link
Member Author

wking commented Jan 23, 2020

rehearsal:

2020/01/23 23:40:09 Container setup in pod e2e-aws-shared-vpc completed successfully

I'll let the job finish out, because I want to get all the gathered artifacts and I forget how that works with aborted jobs.

@wking wking force-pushed the shared-subnets-for-other-regions branch from c1dc247 to 7e38260 Compare January 24, 2020 00:33
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2020
@wking
Copy link
Member Author

wking commented Jan 24, 2020

shared-VPC test was green with:

AWS region: us-east-1 (zones: us-east-1b us-east-1c)
Subnets : ['subnet-047f6294332aa3c1c','subnet-0c3bce80bbc2c8f1c','subnet-038c38c7d96364d7f','subnet-027a025e9d9db95ce','subnet-04d9008469025b101','subnet-02f75024b00b20a75']

would have been nice if it was run in another region, but whatever ;). I've dropped the WIP test commit with c1dc24782 -> 7e38260, and we're good to go here.

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2020
@sdodson
Copy link
Member

sdodson commented Jan 24, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2020
@fabianofranz
Copy link
Member

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabianofranz, sdodson, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit c64d5d7 into openshift:master Jan 24, 2020
@openshift-ci-robot
Copy link
Contributor

@wking: Updated the following 6 configmaps:

  • prow-job-cluster-launch-installer-e2e configmap in namespace ci at cluster default using the following files:
    • key cluster-launch-installer-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml
  • prow-job-cluster-launch-installer-e2e configmap in namespace ci-stg at cluster default using the following files:
    • key cluster-launch-installer-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml
  • prow-job-cluster-launch-installer-e2e configmap in namespace ci at cluster ci/api-build01-ci-devcluster-openshift-com:6443 using the following files:
    • key cluster-launch-installer-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml
  • prow-job-cluster-launch-installer-src configmap in namespace ci at cluster ci/api-build01-ci-devcluster-openshift-com:6443 using the following files:
    • key cluster-launch-installer-src.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml
  • prow-job-cluster-launch-installer-src configmap in namespace ci at cluster default using the following files:
    • key cluster-launch-installer-src.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml
  • prow-job-cluster-launch-installer-src configmap in namespace ci-stg at cluster default using the following files:
    • key cluster-launch-installer-src.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml

In response to this:

Catching up with b717933 (#6833), add shares subnets for the new regions. This is basically as described in 424a04a (#5550), although I've dropped the --stack-policy-body mentioned in that commit message (I dunno what it was about, since the commit message didn't give it the argument that --stack-policy-body expects). Generated using:

$ export AWS_PROFILE=ci  # or whatever you call it locally
$ git fetch origin
$ date --iso=m --utc
2020-01-23T20:41+0000
$ git checkout origin/release-4.3
$ git --no-pager log --oneline -1
2055609f9 (HEAD, origin/release-4.3) Merge pull request #2928 from ashcrow/4.3-signed-rhcos-bump

with:

for REGION in us-east-1 us-west-1 us-west-2
do
 COUNT=3
 if test us-west-1 = "${REGION}"
 then
   COUNT=2
 fi
 for INDEX in 1 2 3 4
 do
   NAME="do-not-delete-shared-vpc-${INDEX}"
   aws --region "${REGION}" cloudformation create-stack --stack-name "${NAME}" --template-body "$(cat upi/aws/cloudformation/01_vpc.yaml)" --parameters "ParameterKey=AvailabilityZoneCount,ParameterValue=${COUNT}" >/dev/null
   aws --region "${REGION}" cloudformation wait stack-create-complete --stack-name "${NAME}"
   SUBNETS="$(aws --region "${REGION}" cloudformation describe-stacks --stack-name "${NAME}" | jq -c '[.Stacks[].Outputs[] | select(.OutputKey | endswith("SubnetIds")).OutputValue | split(",")[]]' | sed "s/\"/'/g")"
   echo "${REGION}_$((INDEX - 1))) subnets=\"${SUBNETS}\";;"
 done
done

which spits out:

us-east-2_0) subnets="['subnet-0faf6d16c378ee7a7','subnet-0e104572db1b7d092','subnet-014ca96c04f36adec','subnet-0ea06057dceadfe8e','subnet-0689efe5e1f9f4212','subnet-0d36bb8edbcb3d916']";;
us-east-2_1) subnets="['subnet-085787cc4b80b84b2','subnet-09dfbf66e8f6e5b50','subnet-0db5d90ff3087444e','subnet-047f15f2a0210fbe0','subnet-0bf13f041c4233849','subnet-0e2a5320549e289d8']";;
...

The COUNT bit for us-west-1 is because our CI account only has access to two zones there:

$ aws --region us-west-1 ec2 describe-availability-zones --output text
AVAILABILITYZONES		 us-west-1					available												usw1-az3 us-west-1a
AVAILABILITYZONES		 us-west-1					available												usw1-az1 us-west-1b

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wking wking deleted the shared-subnets-for-other-regions branch January 24, 2020 00:41
wking added a commit to wking/ci-tools that referenced this pull request Jan 24, 2020
Bringing over a number of changes which have landed in
ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml
as of openshift/release@c64d5d7d8f (Merge pull request #6845 from
wking/shared-subnets-for-other-regions, 2020-01-23).

One series was AWS region sharding:

* openshift/release@b7179335a3
  (ci-operator/templates/openshift/installer/cluster-launch-installer-*:
  Random AWS regions for IPI, 2020-01-23, openshift/release#6833).
* openshift/release@7e38260d25
  (ci-operator/templates/openshift/installer: Shared subnets for new
  regions, 2020-01-23, openshift/release#6845).

Another series was the password removal followed by a bunch of
pipefail fumbling ;)

* openshift/release@4847cb5477 (clean up install log output,
  2020-01-13, openshift/release#6692).
* openshift/release@5c6ca8a506 (templates: Use 'pipefail' so that grep
  doesn't mask install failures, 2020-01-15, openshift/release#6718).
* openshift/release@bee15b9fa8 (add -eou pipefail to remaining job
  templates, 2020-01-16, openshift/release#6738)
* openshift/release@07bd61d677 (Revert "add -eou pipefail to remaining
  job templates", 2020-01-17, openshift/release#6748).
* openshift/release@ca655477ca (Revert "Revert "add -eou pipefail to
  remaining job templates"", 2020-01-17, openshift/release#6750).
* openshift/release@9d7453156b (tolerate undefined env vars in
  teardown, 2020-01-17, openshift/release#6750).

And there was also:

* openshift/release@c6c2efb3fc (templates: Add ipv6 variant that
  triggers azure singlestack, 2020-01-22, openshift/release#6809).
* openshift/release@752455a47f (templates: fix check for unset
  variable, 2020-01-16, openshift/release#6723).
wking added a commit to wking/openshift-release that referenced this pull request Jan 31, 2020
ci-operator/templates/openshift/installer: Replacement shared subnets for new regions

I'd created the previous subnets in
7e38260 (ci-operator/templates/openshift/installer: Shared
subnets for new regions, 2020-01-23, openshift#6845), but forgot to add
them to the reaper whitelist [1].  So the reaper just removed my
old subnets.  Recreating them here:

  $ export AWS_PROFILE=ci  # or whatever you call it locally
  $ git fetch origin
  $ date --iso=m --utc
  2020-01-30T17:09+0000
  $ git checkout origin/release-4.3
  $ git --no-pager log --oneline -1
  2055609f9 (HEAD, origin/release-4.3) Merge pull request openshift#2928 from ashcrow/4.3-signed-rhcos-bump

Clear out the old stacks:

  for REGION in us-east-2 us-west-1 us-west-2
  do
    COUNT=3
    if test us-west-1 = "${REGION}"
    then
      COUNT=2
    fi
    for INDEX in 1 2 3 4
    do
      NAME="do-not-delete-shared-vpc-${INDEX}"
      aws --region "${REGION}" cloudformation delete-stack --stack-name "${NAME}"
      aws --region "${REGION}" cloudformation wait stack-delete-complete --stack-name "${NAME}"
    done
  done

I had to lean in manually and delete some instances in us-west-2's
do-not-delete-shared-vpc-4 to unstick it.  Then create the new
subnets:

  for REGION in us-east-2 us-west-1 us-west-2
  do
    COUNT=3
    if test us-west-1 = "${REGION}"
    then
      COUNT=2
    fi
    for INDEX in 1 2 3 4
    do
      NAME="do-not-delete-shared-vpc-${INDEX}"
      aws --region "${REGION}" cloudformation create-stack --stack-name "${NAME}" --template-body "$(cat upi/aws/cloudformation/01_vpc.yaml)" --parameters "ParameterKey=AvailabilityZoneCount,ParameterValue=${COUNT}" >/dev/null
      aws --region "${REGION}" cloudformation wait stack-create-complete --stack-name "${NAME}"
      SUBNETS="$(aws --region "${REGION}" cloudformation describe-stacks --stack-name "${NAME}" | jq -c '[.Stacks[].Outputs[] | select(.OutputKey | endswith("SubnetIds")).OutputValue | split(",")[]]' | sed "s/\"/'/g")"
      echo "${REGION}_$((INDEX - 1))) subnets=\"${SUBNETS}\";;"
    done
  done

7e38260 had a us-east-1 typo in the commit message, fixed
here.  I actually used us-east-2 in that commit as well, and just
fumbled the copy into the old commit message.  Creation spit out:

  us-east-2_0) subnets="['subnet-0a568760cd74bf1d7','subnet-0320ee5b3bb78863e','subnet-015658a21d26e55b7','subnet-0c3ce64c4066f37c7','subnet-0d57b6b056e1ee8f6','subnet-0b118b86d1517483a']";;
  ...
  us-west-2_3) subnets="['subnet-072d00dcf02ad90a6','subnet-0ad913e4bd6ff53fa','subnet-09f90e069238e4105','subnet-064ecb1b01098ff35','subnet-068d9cdd93c0c66e6','subnet-0b7d1a5a6ae1d9adf']";;

To generate the reaper whitelist [1], I used:

  for REGION in us-east-1 us-east-2 us-west-1 us-west-2
  do
    for INDEX in 1 2 3 4
    do
      NAME="do-not-delete-shared-vpc-${INDEX}"
      aws --region "${REGION}" resourcegroupstaggingapi get-resources --tag-filters "Key=aws:cloudformation:stack-name,Values=${NAME}" --query 'ResourceTagMappingList[].ResourceARN' | jq -r ".[] | split(\":\")[-1] | \"                '\" + . + \"',  # CI exclusion per DPP-4108, ${REGION} ${NAME}\""
    done
  done | sort

followed by some whitespace shuffling to get the comments aligned.

[1]: openshift/li#3634
     Private repository, sorry external folks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants