[英]Schedule the deployment of a sagemaker model
I'm trying out SageMaker and I've created a model using autopilot.我正在试用 SageMaker,并使用自动驾驶仪创建了一个模型。 The point is that SageMaker only allows you to deploy directly to an endpoint.
关键是 SageMaker 只允许您直接部署到端点。 But since I'll only be using the model a couple of times a day, what is the most direct way to schedule deployments by events (for example when loading new csv's into an s3 directory or when I see a queue in sqs) or at least periodically?
但是由于我每天只会使用该模型几次,所以按事件安排部署的最直接方法是什么(例如,将新的 csv 加载到 s3 目录中或当我在 sqs 中看到队列时)或在至少定期?
The answer above is incorrect.上面的答案是错误的。 Boto3 is part of the Lambda Python environment, so all you need to do is create a SageMaker client and invoke the appropriate API.
Boto3 是 Lambda Python 环境的一部分,因此您需要做的就是创建一个 SageMaker 客户端并调用适当的 API。
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html
You can use a trigger (eg Cloudwatch Events/EventBridge, S3 event, etc.) to run a Lambda function that deploys your SageMaker model.您可以使用触发器(例如 Cloudwatch Events/EventBridge、S3 事件等)来运行部署 SageMaker 模型的 Lambda 函数。 The Lambda function, however, requires a runtime that can call SageMaker APIs.
但是,Lambda 函数需要可以调用 SageMaker API 的运行时。 You will have to create a custom runtime (via Layers) for that.
您必须为此创建一个自定义运行时(通过层)。 If you're using Python, use this as reference: https://dev.to/vealkind/getting-started-with-aws-lambda-layers-4ipk .
如果您使用 Python,请将其用作参考: https : //dev.to/vealkind/getting-started-with-aws-lambda-layers-4ipk 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.