Skip to content

Conversation

@aslonnie
Copy link
Collaborator

use awscli directly; stop installing extra dependencies

@aslonnie aslonnie force-pushed the lonnie-251020-credsfix branch from 86cac62 to 9d3479e Compare October 20, 2025 16:23
@aslonnie aslonnie requested review from a team and matthewdeng October 20, 2025 16:23
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to simplify CI test setup by using awscli directly instead of installing boto3. The changes in ci/env/setup_credentials.py correctly replace the boto3 dependency with a subprocess call to awscli. The corresponding pip install commands are removed from the Buildkite YAML files. I've found a critical issue where one of the CI steps is changed to use a setup_credentials.sh script that is not part of this PR, which will likely break the build. I've also suggested an improvement to the exception handling in the Python script to make it more robust. Overall, the changes are in the right direction, but the missing script needs to be addressed.

Comment on lines 49 to 54
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The exception handling here is very broad, catching Exception. While the previous code did this as well, the new implementation using subprocess can raise different types of exceptions like subprocess.CalledProcessError, FileNotFoundError (if aws isn't in PATH), json.JSONDecodeError, or KeyError. It would be more robust to handle these specific exceptions to provide more informative error messages and improve debuggability. Also, it's a good practice to print error messages to sys.stderr.

Suggested change
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)
try:
ray_air_secrets = get_ray_air_secrets()
except (subprocess.CalledProcessError, FileNotFoundError) as e:
print(f"Error executing aws-cli command: {e}", file=sys.stderr)
sys.exit(1)
except (json.JSONDecodeError, KeyError) as e:
print(f"Error parsing secrets from aws-cli output: {e}", file=sys.stderr)
sys.exit(1)

cursor[bot]

This comment was marked as outdated.

@aslonnie aslonnie force-pushed the lonnie-251020-credsfix branch from 9d3479e to 1f31bdd Compare October 20, 2025 16:35
@aslonnie aslonnie added the go add ONLY when ready to merge, run all tests label Oct 20, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
@aslonnie aslonnie force-pushed the lonnie-251020-credsfix branch from 1f31bdd to 729963d Compare October 20, 2025 17:08
"--secret-id",
AWS_AIR_SECRETS_ARN,
]
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing AWS CLI Causes Credential Setup Failure

The setup_credentials.py script now calls the aws CLI directly, but the CI configuration removed the awscli installation. This prevents the aws command from being found, causing the credential setup to fail and impacting tests that rely on these secrets.

Additional Locations (1)

Fix in Cursor Fix in Web

@ray-gardener ray-gardener bot added the devprod label Oct 20, 2025
@aslonnie aslonnie merged commit 034c54f into master Oct 20, 2025
6 checks passed
@aslonnie aslonnie deleted the lonnie-251020-credsfix branch October 20, 2025 21:42
kamil-kaczmarek pushed a commit that referenced this pull request Oct 20, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: Kamil Kaczmarek <[email protected]>
xinyuangui2 pushed a commit to xinyuangui2/ray that referenced this pull request Oct 22, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: xgui <[email protected]>
elliot-barn pushed a commit that referenced this pull request Oct 23, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
use awscli directly; stop installing extra dependencies

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: Aydin Abiar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devprod go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants