aws / aws/amazon-sagemaker-examples

Sagemaker runtime_client.invoke_endpoint not handling redirect

Open
#3,238 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

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...\n

Redirecting...

\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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the runtime_client.invoke_endpoint call against the custom inference container, then compare its response with the curl --location behavior described in the issue. The issue names no repository file or test; work is complete only when redirect handling has a confirmed implementation or documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
api, cloud, machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.