-
Notifications
You must be signed in to change notification settings - Fork 76
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
Scripts out Deployment Validation #670
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iamkirkbater 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 |
Codecov Report
@@ Coverage Diff @@
## master #670 +/- ##
==========================================
- Coverage 31.64% 31.55% -0.10%
==========================================
Files 46 47 +1
Lines 4601 4649 +48
==========================================
+ Hits 1456 1467 +11
- Misses 3047 3084 +37
Partials 98 98
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good so far. few questions/asks
|
||
install_wait_loop $CLUSTER_ID $CREATE_TIMEOUT $CHECK_INTERVAL | ||
|
||
ocm delete cluster $CLUSTER_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how paranoid do we want to be about ensuring tests clean up after themselves? You may want to consider using a trap (https://www.linuxjournal.com/content/bash-trap-command) to ensure clean up happens even in script failure scenarios. That may require more engineering than is necessary though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking about that, but then like you mentioned the engineering into that started to yak-shave.
Like, I could add the trap, but then I'd need to know whether or not the clusters are initiating already or not and then clean it up. And then catch it in the subprocesses, and ignore it in the delete wait loop, so I just opted out of doing it at all.
It might be worth adding a simple trap though that just lets you know that depending on the state of each thread you might have to manually clean something up.
This script adds the ability to quickly validate an AWS Account Operator deployment to various environments using OCM, to validate the same steps a customer would take to request a cluster, but without using the UI or having to wait for a full cluster install. This script takes a multi-threaded approach in order to run the various scenarios in parallel.
00fad3c
to
fad759b
Compare
fi | ||
|
||
# get the cluster ID from the OCM output | ||
local CLUSTER_ID=$(echo $OCM_CREATE | grep '^ID:' | awk '{print $2}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created an ocm-cli issue to make this less janky openshift-online/ocm-cli#383
ACCOUNT=$(aws sts get-caller-identity | jq -r .Account) | ||
echo -e "$PENDING AWS Account $ACCOUNT info collected." | ||
|
||
OCM_CREATE=$(ocm create cluster --region us-east-1 --ccs --aws-access-key-id $AWS_ACCESS_KEY_ID --aws-secret-access-key $AWS_SECRET_ACCESS_KEY --aws-account-id $ACCOUNT $CLUSTER_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a very nice way to create a CCS cluster. I hope there is something similar to GCP as well @rafael-azevedo
TIMEOUT=$(( TIMEOUT - CHECK_INTERVAL )) | ||
local STATUS=$(ocm get /api/clusters_mgmt/v1/clusters/$CLUSTER_ID/status | jq -r .state) | ||
if [[ $STATUS == "installing" ]]; then | ||
echo -e "$SUCCESS $TEST_NAME has passed. Beginning Cleanup..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe split this into 2:
so the echo here will just note the test has passed
and the begin cleanup will be higher in the stack?
@iamkirkbater: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
@iamkirkbater is there anything blocking this PR? |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closed this PR. In response to this:
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. |
Currently tests both
non-ccs
andccs
cluster creation using OCM.This script assumes you're already logged into whatever OCM environment you are attempting to test.
This script also assumes you have a valid set of credentials for an IAM User:
osdCCSAdmin
in your~/.aws/credentials
file (you pass the profile name in as the parameter).Example:
Given the above file, you would call the script as such:
./hack/scripts/validate_deployment.sh -p osd-staging-2-ccsadmin
This script runs the creation in parallel, allowing you to run the script and just wait for the output to finish. The script also only waits for the cluster to move from
pending
toinstalling
as once the cluster isinstalling
the work of AWS Account Operator is complete.Future work: Script out STS creation.