I'm following along to this blog however I'm using palmer penguins for my model development and I'm at the stage of generating and building a Docker image on SageMaker for a vetiver model in R.
When I run the following:
new_image_uri <-
vetiver_sm_build(
bucket = "ml-bucket-my-name",
name = "penguin_model",
board = board
)
I get the following error:
* Lockfile written to 'vetiver_renv.lock'.
WARN [2023-08-09 23:19:06.410]: Couldn't call 'get_role' to get Role ARN from role name my-name to get Role path.
Error: The current AWS identity is not a role: arn:aws:iam::123456789:user/my-name, therefore it cannot be used as a SageMaker execution role
When setting up my AWS environment I followed along to this blog where the author suggests setting up an IAM user and then granting full s3 access which I've done as shown below.
Is there some other step I'm missing to allow me to pin my model to my board in the S3 bucket?
You might find it helpful to take a look at this code and see what happens when you call smdocker::sagemaker_get_execution_role()
in your environment.
If I call this locally, I get errors about not having credentials, etc.
If I log into our SageMaker instance (i.e. I am in the RStudio IDE in my browser at a URL that ends with sagemaker.aws
), I see a real execution role, something like "arn:aws:iam::992233668866:role/vetiver-test-role"
. You will have a default SageMaker execution role if you are working from SageMaker itself.
If you are working locally but interacting with AWS and SageMaker resources, then you will need to explicitly pass the role
arg to vetiver_sm_build()
. Take a look at this discussion to see steps you'll need to take.