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

Add support for AWS profiles in SSHProcessorWrapper #65

Open
ignacio-amaya-rovio opened this issue Aug 5, 2024 · 0 comments
Open

Add support for AWS profiles in SSHProcessorWrapper #65

ignacio-amaya-rovio opened this issue Aug 5, 2024 · 0 comments

Comments

@ignacio-amaya-rovio
Copy link

Hi,

I am using https://github.com/aws-samples/sagemaker-ssh-helper to connect to a Processing Sagemaker job to help with debugging.

I got it working with some some hacks to use my AWS role profile as the code does not accept roles at the moment. Could it be possible to improve that functionality to support profile roles in an easier way?

For example in my code I had to do this (using a boto3 session previously initialised with my profile):

sts = session.client("sts")
local_user_id = sts.get_caller_identity()["UserId"]

ssh_wrapper = SSHProcessorWrapper(
processor=script_processor,
connection_wait_time_seconds=connection_wait_time_seconds,
)
ssh_wrapper.local_user_id = local_user_id
ssh_wrapper._augment()

Is there an easier way to get that working? Unfortunately the create method here does not accept local_user_id as argument, or any boto3 session or profile to use:

def create(cls, processor: sagemaker.processing.Processor,

Ideally I would like to pass to the create method my AWS profile instead. Even passing the local_user_id would be an improvements, but not as nice.

Also, another problem I have with the hack above is that even though I got the solution working, the methods get_instance_ids and print_ssh_info fail with: " ERROR: NoCredentialsError calling ssm". Is there a way to get these working with some other workaround?

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

1 participant