-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_CPU_PY3
75 lines (63 loc) · 3.16 KB
/
Dockerfile_CPU_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
FROM yangyangfu/jmodelica_py3
LABEL maintainer yangyangfu([email protected])
# root
USER root
# update: for pytorch cpu/gpu - no need if no render
# RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# python-opengl
### ====================================================================================
## install env for OPC: optimizer, nonlinear system identifier
# Tianshou will install torch if not installed
# Downgrade setuptools for pytprch. This is a known bug which has been patched: https://github.com/pytorch/pytorch/pull/69904.
# Ray: hyperparameter tuning
RUN conda update conda && \
conda config --add channels conda-forge && \
conda install pip \
scikit-learn \
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
## 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
## BuildingSpy
WORKDIR $HOME
RUN pip install buildingspy
### =======================================================================================
### 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"