使用Boto3在SageMaker中创建模型时,如何指定证书授权
我们尝试根据私人文物保存的图像在SageMaker中使用BOTO3创建模型。我们找到了一种设置基本凭证词的方式“ nofollow noreferrer”> https://docs.amazonaws.cn/en_us/sagemaker/sagemaker/latest/dg/your-algorithms-containers-containers-inference-inference-private.html ,但我无法找到通过证书授权的解决方案。
我们用来创建模型的代码是
import boto3
client = boto3.client('sagemaker')
response = client.create_model(
ModelName='model-name',
PrimaryContainer={
'Image': 'local-repo.my_artifactory_endpoint/train:latest',
'ImageConfig': {
'RepositoryAccessMode': 'Vpc',
},
'Environment': {
'SAGEMAKER_PROGRAM': 'train.py',
"SAGEMAKER_SUBMIT_DIRECTORY": "/opt/ml/model/code",
"SAGEMAKER_CONTAINER_LOG_LEVEL": "20",
"SAGEMAKER_REGION": <my-region>,
"MMS_DEFAULT_RESPONSE_TIMEOUT": "500"
}
},
ExecutionRoleArn=<my-role>,
VpcConfig={
'SecurityGroupIds': [
...
],
'Subnets': [
...
]
},
EnableNetworkIsolation=False
)
在此之后的,当我们尝试基于该模型创建端点时,我们以错误的方式结束了:
Attempt to pull model image local-repo.my_artifactory_endpoint/train:latest failed due to error constructing client to call registry: constructing authentication challenge manager: Get "https://local-repo.my_artifactory_endpoint/v2/": x509: certificate signed by unknown authority.
我们找不到传递此证书或忽略SSL选项的方法。
We try to create a model in Sagemaker with boto3 based on an image we saved in a private artifactory. We found a way to setup the basic credentials acording to the doc https://docs.amazonaws.cn/en_us/sagemaker/latest/dg/your-algorithms-containers-inference-private.html but I cant find a solution to pass the certificate authority.
The code we use to create the model is
import boto3
client = boto3.client('sagemaker')
response = client.create_model(
ModelName='model-name',
PrimaryContainer={
'Image': 'local-repo.my_artifactory_endpoint/train:latest',
'ImageConfig': {
'RepositoryAccessMode': 'Vpc',
},
'Environment': {
'SAGEMAKER_PROGRAM': 'train.py',
"SAGEMAKER_SUBMIT_DIRECTORY": "/opt/ml/model/code",
"SAGEMAKER_CONTAINER_LOG_LEVEL": "20",
"SAGEMAKER_REGION": <my-region>,
"MMS_DEFAULT_RESPONSE_TIMEOUT": "500"
}
},
ExecutionRoleArn=<my-role>,
VpcConfig={
'SecurityGroupIds': [
...
],
'Subnets': [
...
]
},
EnableNetworkIsolation=False
)
After, when we try to create an endpoint based on that model we endup with ther error:
Attempt to pull model image local-repo.my_artifactory_endpoint/train:latest failed due to error constructing client to call registry: constructing authentication challenge manager: Get "https://local-repo.my_artifactory_endpoint/v2/": x509: certificate signed by unknown authority.
We don't find a way to pass this certificate or to ignore ssl option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论