custom containers for training in sagemaker?

0

some of the containers listed here , https://github.com/aws/deep-learning-containers/blob/master/available_images.md , have few security vunerabilities, are there any examples to build similar container from scratch. for example - this one - 763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:2.0.1-cpu-py310-ubuntu20.04-sagemaker

examples of building custom images, or Dockerfile to see what components are being installed for this image.

1개 답변
0

Hello Fam!

Kindly go through the documentation below https://docs.aws.amazon.com/sagemaker/latest/dg/docker-containers.html and follow the notebook for the solution here -> https://github.com/aws/amazon-sagemaker-examples/tree/main/advanced_functionality/scikit_bring_your_own.

Dockerfile for training
# Set the environment variables
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PATH="/opt/program:${PATH}"

# Copy the model and inference code
COPY train / opt/program

# Set the working directory
WORKDIR /opt/program

RUN chmod +x /opt/program/serve 

RUN chmod +x /opt/program/train
# Set the default command to run when the container starts

ENTRYPOINT [ "python3" ]

Test locally docker run -v your path to folder/local_test:/opt/ml --rm training_container:latest train

You can then scan with trivy or Amazon Inspector for vulnerability fixes and patch them accordingly

Hope it helps!

Cheers & Best Regards, Ashlin Gabriel

답변함 8달 전
  • do you know, if i can build similar container , instead of using the provided ones. i'm guessing yes, are there any examples to do so, to make life easier.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠