MLA-C01 Practice Question 37: BYOC Endpoint Health Check
AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 4 · question 7 of 10
An engineer packages a custom model server as a Docker image, pushes it to Amazon ECR, and creates a SageMaker AI real-time endpoint from it. After several minutes the endpoint status changes to Failed, with a message that the primary container did not pass the ping health check. The container's logs in CloudWatch show that the model loaded in about 40 seconds, followed by Uvicorn running on http://0.0.0.0:5000 and Routes registered: POST /predict, GET /healthz.
The same image serves predictions correctly when the engineer runs it locally with docker run.
What must the engineer change for the endpoint to become InService?
Show answer and explanation
Answer:
A bring-your-own inference container must follow SageMaker AI's hosting contract: a web server listening on port 8080 that answers health checks on /ping and inference requests on /invocations. Soon after the container starts, SageMaker AI sends periodic GET requests to /ping. If the container does not respond with HTTP 200 consistently within 8 minutes of startup, the instance launch fails and so does the endpoint. This server listens on port 5000 and exposes /healthz and /predict, so every ping goes unanswered no matter how healthy the model is. That also explains why it works locally, where the engineer calls the routes directly (option D).
- A is wrong because the logs show the model loaded in 40 seconds, well within the startup window. More time does not help a server that is listening on the wrong port and path. - B is wrong for the same reason. Load time is not the problem, so faster hardware changes nothing about the missing /ping route. - C is wrong because the container clearly started: it wrote logs to CloudWatch after loading the model, which could not happen if the image pull or log delivery had been denied.
Reference: Custom Inference Code with Hosting Services