forked from FZJ-IEK3-VSA/HiSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 1.29 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
36
37
38
39
40
41
FROM python:3.9-slim
WORKDIR /app
# Install HDF5, which is required to build h5py during the installation of the requirements
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get install libhdf5-serial-dev -y
# Copy relevant files
COPY setup.py setup.py
# These files are needed by setup.py
COPY requirements.txt requirements.txt
COPY README.md README.md
# Install hisim
RUN pip install -e .
# Copy source code to image
COPY hisim hisim
# Copy the examples folder containing the modular_household file
COPY examples examples
# Remove any previous simulation results
RUN rm -f -r examples/results
# Set an environment variable flag so HiSim can check whether it runs in a container or not
ENV HISIM_IN_DOCKER_CONTAINER true
# Create a folder for the input files
RUN mkdir /input
# Use the examples directory as working directory (required by HiSim)
WORKDIR /app/examples
# Temporary solution for the custom json interface for the WHY toolkit: always uses modular_household_explicit in modular_household.py
# delete any previous result folders (just to be sure)
ENTRYPOINT rm -rf results/modular_household_explicit* \
&& mv /input/request.json modular_example_config.json \
&& python3 ../hisim/hisim_main.py modular_example modular_household_explicit \
&& mv results/modular_household_explicit* /results