juliasilge / juliasilge.com

My blog, built with blogdown and Hugo :link:
https://juliasilge.com/
40 stars 27 forks source link

Deploy a model on AWS SageMaker with vetiver | Julia Silge #89

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Deploy a model on AWS SageMaker with vetiver | Julia Silge

A data science blog

https://juliasilge.com/blog/vetiver-sagemaker/

jrosell commented 1 year ago

That's cool, but I currently use Google Cloud and Digital Ocean for my projects instead of AWS. Is any similar flow for other cloud vendors planned?

juliasilge commented 1 year ago

@jrosell We do have an integration with Vertex AI from GCP planned. If that's not what you mean, you might want to check out the general workflows that are possible with vetiver_prepare_docker(). Depending on where you keep your model (GCS?) and where you want to serve it from (Digital Ocean?) you could use a workflow like:

library(vetiver)
library(pins)
b <- board_gcs()
vetiver_prepare_docker(b, "your-model-name")

Then you would need to build the Docker image, push it to the Digital Ocean registry, and serve it. It might take some work to make sure the Docker image can authenticate to GCS. If you have more specific ideas, feel free to open an issue so we can track interest!

chadallison commented 1 year ago

Hi Julia, I'm trying to work through this as I want to learn how to deploy models. When I get to the deployment step, I am calling the board_s3() function on my bucket but am receiving the error "Error: No compatible credentials provided." I have an AWS account and created the S3 bucket, but am unsure what other steps I need to take. After diving into the details of the error, I am being told the following info:

What steps should I take to get myself properly set up so that I can continue through the demo? Thanks!

juliasilge commented 1 year ago

@chadallison Are you working from SageMaker or locally? If you are working from within SageMaker, then the credentials should be automatically available in your environment. If you are working locally, then you'll need to see how your particular AWS environment is set up. I outlined how I work with pins on AWS from my local computer in this gist.

chadallison commented 1 year ago

I am working locally. Now it is making sense why my RStudio doesn't magically know everything about my AWS account, lol. Will try to troubleshoot and see if I can figure it out.

aminadibi commented 1 year ago

@chadallison you need specify your AWS credentials in the AWS shared credential file, ⁠~/.aws/credentials⁠

The file's content should be something like this:

[default]
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_ACCESS_SECRET

If you don't have an access key, you need to create a new user with proper permissions for S3 and other services under Identity and Access Management (IAM) console and then create an access key for it.

Hope this helps!

AkanimohOD19A commented 8 months ago

Hi Julia, Thank you for sharing this, any updates and documentation on deployment to Vertex ai - would love your response.

juliasilge commented 8 months ago

@AkanimohOD19A Ah, no updates right now, no. If you'd like to see this added to vetiver, I suggest you open an issue describing your use case so I can track interest in this new feature. Thanks!