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?
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
boto3session previously initialised with my profile):Is there an easier way to get that working? Unfortunately the create method here does not accept
local_user_idas argument, or anyboto3session or profile to use:sagemaker-ssh-helper/sagemaker_ssh_helper/wrapper.py
Line 554 in 1a45feb
Ideally I would like to pass to the create method my AWS profile instead. Even passing the
local_user_idwould 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_idsandprint_ssh_infofail with: " ERROR: NoCredentialsError calling ssm". Is there a way to get these working with some other workaround?