-
Notifications
You must be signed in to change notification settings - Fork 7k
[ci] fix postmerge tests that require credentials #57915
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,19 +8,30 @@ | |||||||||||||||||||||||||||||||
| export COMET_API_KEY=efgh | ||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||
| import json | ||||||||||||||||||||||||||||||||
| import subprocess | ||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import boto3 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| AWS_AIR_SECRETS_ARN = ( | ||||||||||||||||||||||||||||||||
| "arn:aws:secretsmanager:us-west-2:029272617770:secret:" | ||||||||||||||||||||||||||||||||
| "oss-ci/ray-air-test-secrets20221014164754935800000002-UONblX" | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| def get_ray_air_secrets(client): | ||||||||||||||||||||||||||||||||
| raw_string = client.get_secret_value(SecretId=AWS_AIR_SECRETS_ARN)["SecretString"] | ||||||||||||||||||||||||||||||||
| return json.loads(raw_string) | ||||||||||||||||||||||||||||||||
| def get_ray_air_secrets(): | ||||||||||||||||||||||||||||||||
| output = subprocess.check_output( | ||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||
| "aws", | ||||||||||||||||||||||||||||||||
| "secretsmanager", | ||||||||||||||||||||||||||||||||
| "get-secret-value", | ||||||||||||||||||||||||||||||||
| "--region", | ||||||||||||||||||||||||||||||||
| "us-west-2", | ||||||||||||||||||||||||||||||||
| "--secret-id", | ||||||||||||||||||||||||||||||||
| AWS_AIR_SECRETS_ARN, | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Missing AWS CLI Causes Credential Setup FailureThe Additional Locations (1) |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| parsed_output = json.loads(output) | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| return json.loads(parsed_output["SecretString"]) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| SERVICES = { | ||||||||||||||||||||||||||||||||
|
|
@@ -36,10 +47,8 @@ def get_ray_air_secrets(client): | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| def main(): | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||
| client = boto3.client("secretsmanager", region_name="us-west-2") | ||||||||||||||||||||||||||||||||
| ray_air_secrets = get_ray_air_secrets(client) | ||||||||||||||||||||||||||||||||
| ray_air_secrets = get_ray_air_secrets() | ||||||||||||||||||||||||||||||||
| except Exception as e: | ||||||||||||||||||||||||||||||||
| print(f"Could not get Ray AIR secrets: {e}") | ||||||||||||||||||||||||||||||||
| sys.exit(1) | ||||||||||||||||||||||||||||||||
|
Comment on lines
50
to
54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception handling here is very broad, catching
Suggested change
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.