Why is an IAM role required for fully local use? #2451
Replies: 3 comments 1 reply
-
AWS credentials are required so you can download the inference image used in LocalMode. - https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/local/image.py#L150 As for SAGEMAKER_SUBMIT_DIRECTORY, the model shouldn't upload the code to S3 in localmode - https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/model.py#L1114. I will do more digging. |
Beta Was this translation helpful? Give feedback.
-
@icywang86rui I just tried the same code again, but with a much larger mordel, completely local again, but I got the exception shown below which indicates the there was an attempt to upload the model to S3 although that would be completely useless and unnecessary (probably the deepest stack trace I ever got). I double checked my S3 console and found that there is a bucked I do not remember creating with the name schema The other issue of course is, if I would instead not want to deploy the image locally, but instead use an AWS instance by specifying the instance type with the Finally, even when running on SageMaker, why would every deploy invocation save the model into a separate new directory, even when the model does not change? A simple approach of fingerprinting the tar.gz file could prevent this.
|
Beta Was this translation helpful? Give feedback.
-
I have updated the bug report, the upload clearly happens because the PyTorchModel overrides the |
Beta Was this translation helpful? Give feedback.
-
I tried to test code for deploying a PyTorchModel on SageMaker fully locally doing something like:
I have also created the file
~/.sagemaker/config.yaml
as described in https://sagemaker.readthedocs.io/en/stable/overview.html#local-modeThis fails, unless SOMEROLE is a proper IAM Role, but why is this needed? I do not see why the code would have to connect to AWS and even use my credentials at all if I just run EVERYTHING locally.
When I inspect the docker-compose config file that is created I notice that the SAGEMAKER_SUBMIT_DIRECTORY variable is set to a S3 bucket - why? I just use my local file system!
When running fully locally like this, which actions are actually using AWS access and how can this be prevented??
Beta Was this translation helpful? Give feedback.
All reactions