MLS-C01 Question 276
Select 4You are developing a machine learning workflow using Amazon SageMaker and need to package your custom machine learning model along with its dependencies for deployment. You decide to use Docker containers for this purpose. Which steps should you take to ensure the Docker container is compatible with SageMaker deployment?
- A
Ensure the Docker container exposes the model endpoint on port 8080.
- B
Include a Dockerfile that defines the environment and dependencies for the model.
- C
Use the SageMaker Inference Toolkit to handle model loading and inference requests.
- D
Configure an IAM role in the Docker container to access SageMaker APIs directly.
- E
Ensure the Docker container includes an entry point script to handle HTTP requests for predictions.
Show answer and explanation
Correct answers: A, B, C, E
Explanation
To deploy a custom machine learning model in SageMaker using Docker, you must ensure the container is properly configured. SageMaker requires the container to expose port 8080 for inference requests. The Dockerfile defines the container environment, including dependencies. The SageMaker Inference Toolkit simplifies model serving tasks, but you must also include an entry point script to manage HTTP requests. IAM roles are handled outside the container, typically at the SageMaker instance level.
- A. Correct.
Correct. SageMaker expects the Docker container to expose the default endpoint on port 8080 for inference requests.
- B. Correct.
Correct. A Dockerfile is needed to define how the container environment is created, including model dependencies.
- C. Correct.
Correct. The SageMaker Inference Toolkit simplifies the process of loading the model and serving inference requests.
- D. Incorrect.
Incorrect. IAM roles should be associated with the SageMaker service or instances, not configured within the Docker container.
- E. Correct.
Correct. The Docker container should include an entry point script to manage HTTP requests for predictions, such as loading the model and processing input.