-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_GPU_PY3
89 lines (72 loc) · 3.56 KB
/
Dockerfile_GPU_PY3
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM yangyangfu/jmodelica_py3
LABEL maintainer yangyangfu([email protected])
# arch
ENV NVARCH x86_64
# root
USER root
# install pyhton opengl - not necessary if no render
#RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# python-opengl
# Install pytorch gpu version
RUN conda update conda && \
conda config --add channels conda-forge && \
conda install pip \
scikit-learn \
seaborn \
tianshou=0.4.5 \
matplotlib=3.3.2 \
pvlib-python=0.9.1 \
setuptools=59.1.1 \
numpy=1.22.3 \
ray-tune=1.10.0 && \
conda clean -ya
RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
# Fix a broke link
RUN rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 && \
cp /opt/conda/lib/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/ && \
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
# Required for nvidia-docker v1
#RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \
# && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
#ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
#ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
## install casadi using pip
WORKDIR $HOME
RUN pip install casadi==3.5.5 pymoo==0.6.0
## install fmu-gym
WORKDIR $HOME
RUN git config --global url."https://github.com/".insteadOf git://github.com/ && \
pip install git+git://github.com/YangyangFu/modelicagym.git@master
### =======================================================================================
### intall customized gym environment into docker: install a building control environment
# install single zone damper control environment
WORKDIR $HOME
RUN mkdir github
COPY ./testcases/gym-environments/single-zone/gym_singlezone_jmodelica $HOME/github/testcases/gym-environments/single-zone/gym_singlezone_jmodelica
COPY ./testcases/gym-environments/single-zone/setup.py $HOME/github/testcases/gym-environments/single-zone/setup.py
RUN cd $HOME/github/testcases/gym-environments/single-zone && pip install -e .
# install five zone air system supervisory control environment
WORKDIR $HOME
COPY ./testcases/gym-environments/five-zones-air/gym_fivezoneair_jmodelica $HOME/github/testcases/gym-environments/five-zones-air/gym_fivezoneair_jmodelica
COPY ./testcases/gym-environments/five-zones-air/setup.py $HOME/github/testcases/gym-environments/five-zones-air/setup.py
RUN cd $HOME/github/testcases/gym-environments/five-zones-air && pip install -e .
# install five zone plant system supervisory control environment
WORKDIR $HOME
COPY ./testcases/gym-environments/five-zones-plant/gym_fivezoneplant_jmodelica $HOME/github/testcases/gym-environments/five-zones-plant/gym_fivezoneplant_jmodelica
COPY ./testcases/gym-environments/five-zones-plant/setup.py $HOME/github/testcases/gym-environments/five-zones-plant/setup.py
RUN cd $HOME/github/testcases/gym-environments/five-zones-plant && pip install -e .
### ===========================================================================================
### install testcase dependency
# install Modelica dependency
COPY ./library /usr/local/JModelica/ThirdParty/MSL
### =============================
USER developer
WORKDIR $HOME
# Avoid warning that Matplotlib is building the font cache using fc-list. This may take a moment.
# This needs to be towards the end of the script as the command writes data to
# /home/developer/.cache
RUN python -c "import matplotlib.pyplot"