简体   繁体   English

如何使用 CDK、sagemaker 部署 AWS?

[英]How to deploy AWS using CDK, sagemaker?

I want to use this repo and I have created and activated a virtualenv and installed the required dependencies.我想使用这个repo ,我已经创建并激活了一个 virtualenv 并安装了所需的依赖项。

I get an error when I run pytest.运行 pytest 时出现错误。

And under the file binance_cdk/app.py it describes the following tasks:在 binance_cdk/app.py 文件下,它描述了以下任务:

App (PSVM method) entry point of the program. App(PSVM方法)程序的入口点。

Note:笔记:

Steps tp setup CDK:步骤 tp 设置 CDK:

  1. install npm安装 npm
  2. cdk -init (creates an empty project) cdk -init(创建一个空项目)
  3. Add in your infrastructure code.添加您的基础架构代码。
  4. Run CDK synth运行 CDK 合成器
  5. CDK bootstrap <aws_account>/ CDK 引导 <aws_account>/
  6. Run CDK deploy ---> This creates a cloudformation .yml file and the aws resources will be created as per the mentioned stack.运行 CDK deploy ---> 这将创建一个 cloudformation .yml 文件,并且将根据提到的堆栈创建 aws 资源。

I'm stuck on step 3, what do I add in this infrastructure code, and if I want to use this on amazon sagemaker which I am not familiar with, do I even bother doing this on my local terminal, or do I do the whole process regardless on sagemaker?我被困在第 3 步,我在这个基础设施代码中添加了什么,如果我想在我不熟悉的 amazon sagemaker 上使用它,我什至会在我的本地终端上做这个,还是我做整个过程不管sagemaker?

Thank you in advance for your time and answers !提前感谢您的时间和答案!

The infrastructure code is the Python code that you want to write for the resources you want to provision with SageMaker.基础架构代码是您要为要使用 SageMaker 预配的资源编写的 Python 代码。 In the example you provided for example the infra code they have is creating a Lambda function.在您提供的示例中,例如他们拥有的基础代码正在创建一个 Lambda 函数。 You can do this locally on your machine, the question is what do you want to achieve with SageMaker?您可以在您的机器上本地执行此操作,问题是您想用 SageMaker 实现什么? If you want to create an endpoint then following the CDK Python docs with SageMaker to identify the steps for creating an endpoint.如果您想创建端点,请按照 CDK Python 文档和 SageMaker 确定创建端点的步骤。 Here's two guides, the first is an introduction to the AWS CDK and getting started.这里有两个指南,第一个是 AWS CDK 的介绍和入门。 The second is an example of using the CDK with SageMaker to create an endpoint for inference.第二个是使用 CDK 和 SageMaker 创建推理端点的示例。

CDK Python Starter: https://towardsdatascience.com/build-your-first-aws-cdk-project-18b1fee2ed2d CDK SageMaker Example: https://github.com/philschmid/cdk-samples/tree/master/sagemaker-serverless-huggingface-endpoint CDK Python 入门: https ://towardsdatascience.com/build-your-first-aws-cdk-project-18b1fee2ed2d CDK SageMaker 示例: https ://github.com/philschmid/cdk-samples/tree/master/sagemaker-serverless -拥抱脸端点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 CDK 部署 aws EventBridge - Python 示例 - How to deploy aws EventBridge with CDK - Python example 如何使用 aws CDK 和 Python 将层部署和附加到 aws lambda 函数 - How to deploy and attach a layer to aws lambda function using aws CDK and Python 如何使用 Javascript AWS CDK 部署 Python AWS Lambda 及其依赖项? - How to deploy Python AWS Lambda with its dependencies using Javascript AWS CDK? 如何在 AWS-CDK 应用程序中形成没有 cdk synt 和 cdk deploy 的云形成模板? - How to form cloud formation template without cdk synt and cdk deploy in AWS-CDK app? 使用 AWS CDK Python 创建/部署多个 Lambda 函数 - Create/Deploy multiple Lambda functions using AWS CDK Python 如何使用 CDK 使用 Chalice 分阶段部署 - How to deploy by stage with Chalice using CDK 如何在 SageMaker 上运行和部署 AWS 的 XGBoost MNIST 示例笔记本? - How to run and deploy AWS's XGBoost MNIST sample notebook on SageMaker? 借助 AWS SageMaker,是否可以使用 sagemaker SDK 部署预训练模型? - With AWS SageMaker, is it possible to deploy a pre-trained model using the sagemaker SDK? AWS Sagemaker - PCA Model 未部署 - AWS Sagemaker - PCA Model doesn't deploy 如何使用 sagemaker 管道部署最佳调整模型? - How to deploy the best tuned model using sagemaker pipelines?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM