-
Notifications
You must be signed in to change notification settings - Fork 6
add test script for aws bedrock access #43
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
Conversation
@cat5inthecradle , any thoughts on how we'll want to go about getting AWS access to work within the aiproxy service? |
7e724b2
to
4505630
Compare
Yep. The ECS task (docker container) has an Execution Role assigned to it, so any AWS CLI/SDK actions it performs will be run with that role. It's defined here:
So, we'll just need to add a policy to that role with the appropriate IAM permissions. |
The AWS authentication here doesn't work for me:
iirc, this should work if the temporary credentials from running code in the cdo repo (where aws-google is included and can run) are still valid |
I see what you are saying. you may need to run |
@cat5inthecradle copy that on ECS setup. regarding local setup, we're running into some ruby dependency problems because where we want to be able to pin the Lines 4 to 5 in 4505630
can you please provide more context around why we can't set the local ruby version here? as an alternative, I'm considering adding |
print(f"AWS access configured: {result.stdout}") | ||
except subprocess.CalledProcessError as e: | ||
print(f"AWS access not configured: {e} {e.stderr}Please see README.md and make sure you ran `gem install aws-google` and `bin/aws_access`") | ||
exit(1) |
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.
validated as follows:
(.venv) Dave-MBP:~/src/aiproxy (aws-bedrock-llama *)$ ./bin/aws_llama_test.py
AWS access configured: {
"UserId": "xxx:xxx@code.org",
"Account": "xxx",
"Arn": "arn:aws:sts::xxx:assumed-role/xxx/xxx@code.org"
}
Sure, I'd be happy to help! Black holes are really cool and kind of mind-blowing, so let's dive in.
(.venv) Dave-MBP:~/src/aiproxy (aws-bedrock-llama *)$ gem uninstall aws-google
Successfully uninstalled aws-google-0.2.0
(.venv) Dave-MBP:~/src/aiproxy (aws-bedrock-llama *)$ ./bin/aws_llama_test.py
AWS access not configured: Command 'aws sts get-caller-identity' returned non-zero exit status 255.
Error when retrieving credentials from custom-process: rbenv: aws-google: command not found
The `aws-google' command exists in these Ruby versions:
2.5.0
2.6.6
2.7.5
Please see README.md and make sure you ran `gem install aws-google` and `bin/aws_access`
What other dependencies did you have to install? |
@cearachew @cat5inthecradle please have another look |
This looks good to me now that we have confirmation from Mark that it's working, I'd like to get question about the |
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.
aws_llama_test.py
run this script to verify that your AWS authentication is working properly in the aiproxy repo, by sending a sample request to the llama2 model in AWS bedrock. the script contents is adapted from:
According to https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration, this will pull AWS authentication info from
~/.aws/config
.sample output: