-
Notifications
You must be signed in to change notification settings - Fork 534
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
[Core][AWS] Allow specification of IAM roles for resources. #3488
Conversation
Due note the quotes required around e.g. aws:
remote_identity:
"*": skypilot-default-fake |
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.
Thanks for implementing this @JGSweets! The code looks good to me. Could you help add the new schema in our docs as well: https://skypilot.readthedocs.io/en/latest/reference/config.html
i.e., the following code path:
skypilot/docs/source/reference/config.rst
Line 134 in 2ff95bb
remote_identity: LOCAL_CREDENTIALS |
sky/backends/backend_utils.py
Outdated
if remote_identity == 'SERVICE_ACCOUNT': | ||
if remote_identity is not None and not isinstance(remote_identity, str): | ||
for profile in remote_identity: | ||
if fnmatch.fnmatchcase(cluster_name_on_cloud, profile): |
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.
Would be nice to match cluster_name
instead cluster_name_on_cloud
as the former is user-facing and should be more intuitive to stay the same as the one specified in ~/.sky/config.yaml
.
if fnmatch.fnmatchcase(cluster_name_on_cloud, profile): | |
if fnmatch.fnmatchcase(cluster_name, profile): |
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.
fixed!
}, { | ||
'type': 'object', | ||
'required': [], | ||
'additionalProperties': { | ||
'type': 'string', | ||
}, | ||
}] |
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.
Seems we only added the support for AWS at the moment, we should limit this ability to aws
cloud only, i.e. in L664, we can only apply this additional support for aws
only.
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.
Should be fixed
docs/source/reference/config.rst
Outdated
# User Specified SERVICE_ACCOUNT (IAM role): The name of the remote identity | ||
# to give the launched resouce. |
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.
Not sure how we wanted to reference this specifically as an example. Open to suggestion here.
docs/source/reference/config.rst
Outdated
### Format 1 ### | ||
# A string; the same remote identity is applied to all launched resources. | ||
remote_identity: LOCAL_CREDENTIALS | ||
### Format 2 ### | ||
# A dict mapping wildcard expression of cloud names to the resources to the | ||
# resource identity. | ||
# NOTE: If not a wildcard expression in the dict mapping does not match a | ||
# cloud name for a resouce being deployed, the default remote identity is used. | ||
# To specify your own default, utilize "*" as the wildcard expression. | ||
remote_identity: | ||
sky-serve-controller-*: my-controller-specific-identity | ||
"*": SERVICE_ACCOUNT |
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.
First attempt at how we represent multiple formats.
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.
Thanks for adding these! I reorganized the comments a little bit in the comment above, can we remove Format 1 and Format 2 here and use the comments above?
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.
Thanks for the quick fix @JGSweets! This PR should be good to go with the comments fixed. : )
docs/source/reference/config.rst
Outdated
### Format 1 ### | ||
# A string; the same remote identity is applied to all launched resources. | ||
remote_identity: LOCAL_CREDENTIALS | ||
### Format 2 ### | ||
# A dict mapping wildcard expression of cloud names to the resources to the | ||
# resource identity. | ||
# NOTE: If not a wildcard expression in the dict mapping does not match a | ||
# cloud name for a resouce being deployed, the default remote identity is used. | ||
# To specify your own default, utilize "*" as the wildcard expression. | ||
remote_identity: | ||
sky-serve-controller-*: my-controller-specific-identity | ||
"*": SERVICE_ACCOUNT |
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.
Thanks for adding these! I reorganized the comments a little bit in the comment above, can we remove Format 1 and Format 2 here and use the comments above?
refactor: config description Co-authored-by: Zhanghao Wu <[email protected]>
refactor: config example Co-authored-by: Zhanghao Wu <[email protected]>
@Michaelvll Fixed as suggested. Thanks for the improvements! |
This PR updates the schema config to allow specification of IAM roles for resources based on the skypilot naming conventions.
Address: #3487
In
~/.sky/config.yaml
:default
)remote_identity
via stringTested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
bash tests/backward_comaptibility_tests.sh