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

Make AMI Name retrieval automatic #266

Open
ZainRizvi opened this issue Aug 21, 2024 · 1 comment
Open

Make AMI Name retrieval automatic #266

ZainRizvi opened this issue Aug 21, 2024 · 1 comment

Comments

@ZainRizvi
Copy link
Contributor

ZainRizvi commented Aug 21, 2024

JIRA: https://lf-pytorch.atlassian.net/browse/PC-31

Today, we tell users which AMI their job is running on by hard coding the list of known AMI IDs to AMI names. This of course will break every time the AMI is updated.

Instead, there's a command that can pull the AMI name from AWS, but it requires certain permissions to be set. Here's the command an the error it gets today:

[root@ip-10-0-19-56 runner-scripts]# AMI_ID="ami-0ce0c36d7a00b20e2"
[root@ip-10-0-19-56 runner-scripts]# AMI_NAME=$(aws ec2 describe-images --image-ids $AMI_ID --query 'Images[0].Name' --output text)

An error occurred (UnauthorizedOperation) when calling the DescribeImages operation: You are not authorized to perform this operation. User: arn:aws:sts::308535385114:assumed-role/gh-ci-github-action-runners-runner-role/i-076101f9e5b2c54e3 is not authorized to perform: ec2:DescribeImages because no identity-based policy allows the ec2:DescribeImages action

The ask:

  1. Grant runners the permission needed to invoke the above command
  2. Modify the setup script to actually use the above command
@zxiiro
Copy link
Collaborator

zxiiro commented Aug 26, 2024

Since we're also using JIRA now https://lf-pytorch.atlassian.net/browse/PC-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants