-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
84 lines (71 loc) · 3.34 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
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
# syntax=docker/dockerfile:1
FROM python:3.8
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# just some niceties . . .
RUN apt-get update --assume-yes && \
apt-get install --assume-yes \
less \
nano \
vim \
htop \
&& rm -rf /var/lib/apt/lists/*
# Add Tini to deal with any orphaned processes
# CMD override scripts might create.
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN useradd --create-home --shell /bin/bash cloudcopasi
USER cloudcopasi
# Install the Python dependencies similar to the current Deployment guide
# (to drop-in re-use cloud-copasi-daemon.sh for now).
COPY --chown=cloudcopasi:cloudcopasi requirements.txt /home/cloudcopasi/requirements.txt
RUN mkdir /home/cloudcopasi/cloud-copasi && \
cd /home/cloudcopasi/cloud-copasi && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -r /home/cloudcopasi/requirements.txt
# Note: The modified PATH from that activated
# venv will not persist past this build stage. It
# is only used so the 'pip' path for the install
# implicitly installs things in the venv, vs. system.
# Download the CopasiSE binaries.
RUN mkdir /home/cloudcopasi/copasi
WORKDIR /home/cloudcopasi/copasi
ENV copasi_version="4.34" copasi_build="251"
RUN curl -L https://github.com/copasi/COPASI/releases/download/Build-${copasi_build}/COPASI-${copasi_version}.${copasi_build}-AllSE.tar.gz | \
tar -xvz --strip-components=1 && chmod +x */CopasiSE && \
mkdir bin && ln -s ../Linux64/CopasiSE bin/CopasiSE
# Get and install HTCondor
RUN mkdir /home/cloudcopasi/condor
WORKDIR /home/cloudcopasi/condor
# "stable" LTS version, which seems to be getting updates with critical bug fixes
ENV condor_version="9.0"
RUN curl -L "https://research.cs.wisc.edu/htcondor/tarball/${condor_version}/current/condor-x86_64_Ubuntu20-stripped.tar.gz" | \
tar -xzv --strip-components=1 && ./bin/make-personal-from-tarball
WORKDIR /home/cloudcopasi
# Make our local modifications to the condor installation.
COPY --chown=cloudcopasi:cloudcopasi condor_overlay/bin/bosco_cluster condor/bin/bosco_cluster
COPY --chown=cloudcopasi:cloudcopasi condor_overlay/local condor/local
COPY --chown=cloudcopasi:cloudcopasi brusselator_scan_test.cps copasi/brusselator_scan_test.cps
RUN mkdir log user-files instance_keypairs
# Copy over the relevant webserver stuff.
# (placing this near the bottom, assuming these may be more likely to change
# during development, vs. stuff above.)
WORKDIR /home/cloudcopasi/cloud-copasi
COPY --chown=cloudcopasi:cloudcopasi README.txt LICENSE.txt manage.py cloud-copasi-daemon.sh start_service.sh ./
COPY --chown=cloudcopasi:cloudcopasi client_scripts client_scripts
COPY --chown=cloudcopasi:cloudcopasi cloud_copasi cloud_copasi
COPY --chown=cloudcopasi:cloudcopasi web_interface web_interface
COPY --chown=cloudcopasi:cloudcopasi cloud_copasi/settings.py.EXAMPLE cloud_copasi/settings.py
# Set up Django
RUN . venv/bin/activate && \
python manage.py collectstatic --noinput && \
python manage.py makemigrations web_interface --noinput
# Note: The CMD override scripts are handling setting up the
# condor env and using the venv
ENTRYPOINT ["/tini", "--"]
# maybe a logical place to end up if attaching interactively?
WORKDIR /home/cloudcopasi
CMD ["/bin/bash"]