Is it possible to hit endpoints hosted in SageMake

2019-08-24 00:45发布

Using the aws sagemaker cli tools it's possible to invoke endpoint that are hosted in sagemaker using a command like:

aws sagemaker-runtime invoke-endpoint --body file://container/local_test/payload.json \
--endpoint-name $(DEPLOYMENT_NAME)-staging \
--content-type application/json \
--accept application/json \
output.json

By default, this command goes to the /invocations endpoint. Is it possible to go to a different endpoint? For example, if I implemented a health-report endpoint? It's definately possible to make one as in the BYOM example. I'm just not sure how I'd access it.

Thanks!

2条回答
Deceive 欺骗
2楼-- · 2019-08-24 01:22

/invocations is not a SageMaker Endpoint, it's a HTTP request path where the prediction request is handled.

See documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html

Request syntax:
POST /endpoints/EndpointName/invocations HTTP/1.1
Content-Type: ContentType
Accept: Accept

To your endpoint, the request is like:
POST /endpoints/$(DEPLOYMENT_NAME)-staging/invocations HTTP/1.1
Content-Type: ContentType
Accept: Accept

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-08-24 01:28

Currently sagemaker-runtime has a single invoke-endpoint method.
Calling other REST resources is most likely doable if you'll call the endpoint URL yourself over HTTP (that is without using aws sagemaker-runtime), however, you'll probably need to take care of the required sigv4 authentication header.

查看更多
登录 后发表回答