amazon-sagemaker-examples
amazon-sagemaker-examples copied to clipboard
Sagemaker runtime_client.invoke_endpoint not handling redirect
Got a custom inference container on sagemaker. Addresses sagemaker /ping and /invocations on port 8080 as per spec.
However internally custom container redirects URI /invocations to a different /original_predict_uri.
===================================
response = runtime_client.invoke_endpoint(
EndpointName=endpoint_name, ContentType="application/json", Body=payload
)
result = response["Body"].read().decode("ascii")
'\nRedirecting... \nRedirecting...
\n
You should be redirected automatically to target URL: http://localhost:9090/sunallscrtree1. If not click the link.'
When I make a curl request to this container (outside sagemaker runtime) for this it addresses by passing --location to CURL /clients to follow HTTP redirects by default.
Can sagameker runtime address this redirects?
Sudhir