-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
35 lines (28 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ARG PARENT_IMAGE
FROM $PARENT_IMAGE
ARG PYTORCH_DEPS=cpuonly
ARG PYTHON_VERSION=3.10
ARG MAMBA_DOCKERFILE_ACTIVATE=1 # (otherwise python will not be found)
# Install OpenCV to encode video
#USER root
#RUN apt-get update && apt-get install -y ffmpeg
#USER $MAMBA_USER
# Install micromamba env and dependencies
RUN micromamba install -n base -y python=$PYTHON_VERSION \
pytorch $PYTORCH_DEPS opencv -c conda-forge -c pytorch -c nvidia && \
micromamba clean --all --yes
ENV CODE_DIR /home/$MAMBA_USER
# Copy setup file only to install dependencies
COPY --chown=$MAMBA_USER:$MAMBA_USER ./setup.py ${CODE_DIR}/rlhfblender/setup.py
COPY --chown=$MAMBA_USER:$MAMBA_USER ./rlhfblender/version.txt ${CODE_DIR}/rlhfblender/rlhfblender/version.txt
COPY --chown=$MAMBA_USER:$MAMBA_USER ./rlhfblender/ ${CODE_DIR}/rlhfblender/rlhfblender/
COPY --chown=$MAMBA_USER:$MAMBA_USER ./configs/ ${CODE_DIR}/rlhfblender/configs/
COPY --chown=$MAMBA_USER:$MAMBA_USER ./rlhfblender_model/ ${CODE_DIR}/rlhfblender/rlhfblender_model/
RUN cd ${CODE_DIR}/rlhfblender && \
pip install -e .[tests,docs] && \
# Use headless version for docker
#pip uninstall -y opencv-python && \
pip install opencv-python-headless && \
pip cache purge
WORKDIR ${CODE_DIR}/rlhfblender
CMD python rlhfblender/app.py