40 lines
1.7 KiB
Docker
40 lines
1.7 KiB
Docker
# FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-training:1.13.1-gpu-py39-cu117-ubuntu20.04-sagemaker
|
|
# FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-training:2.0.0-gpu-py310-cu118-ubuntu20.04-sagemaker
|
|
# FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-training:2.0.1-gpu-py310-cu118-ubuntu20.04-sagemaker
|
|
# FROM 727897471807.dkr.ecr.cn-north-1.amazonaws.com.cn/pytorch-training:2.0.1-gpu-py310-cu118-ubuntu20.04-sagemaker
|
|
FROM 727897471807.dkr.ecr.cn-northwest-1.amazonaws.com.cn/pytorch-training:2.0.1-gpu-py310-cu118-ubuntu20.04-sagemaker
|
|
|
|
# update environment
|
|
RUN apt-get update -y
|
|
|
|
# install pkg lib for proprocess in controlnet
|
|
RUN apt-get install -y pkg-config
|
|
RUN apt-get install -y libcairo2-dev
|
|
|
|
COPY stable-diffusion-webui /opt/ml/code/
|
|
|
|
# install requirements for webui
|
|
# patch for opencv 4.7
|
|
# https://stackoverflow.com/questions/68886239/cannot-uninstall-numpy-1-21-2-record-file-not-found
|
|
RUN pip install trash-cli
|
|
RUN trash /opt/conda/lib/python3.10/site-packages/opencv_python*
|
|
|
|
RUN pip install -r /opt/ml/code/requirements.txt && \
|
|
pip install -r /opt/ml/code/extensions/sd_dreambooth_extension/requirements.txt && \
|
|
pip install -r /opt/ml/code/extensions/sd-webui-controlnet/requirements.txt && \
|
|
pip install torch==2.0.1 && \
|
|
pip uninstall -y torchvision && \
|
|
pip install torchvision && \
|
|
pip uninstall -y torchaudio && \
|
|
pip install torchaudio && \
|
|
pip install xformers && \
|
|
pip install tensorflow==2.10 && \
|
|
pip install pydantic && \
|
|
pip install safetensors && \
|
|
pip install omegaconf && \
|
|
rm /opt/ml/code/requirements.txt
|
|
|
|
WORKDIR /opt/ml/code
|
|
ENV TORCHDYNAMO_DISABLE 1
|
|
ENV SAGEMAKER_PROGRAM extensions/stable-diffusion-aws-extension/build_scripts/training/sagemaker_entrypoint.py
|