Skip to content

Commit

Permalink
Go back to having a cloudcopasi user, and installing condor here.
Browse files Browse the repository at this point in the history
(We at least need it for the submit and bosco clients)
  • Loading branch information
bdklahn committed May 10, 2024
1 parent b3d2aec commit 1399408
Showing 1 changed file with 32 additions and 15 deletions.
47 changes: 32 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,51 @@ ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

# run this out of a special user account
RUN useradd --create-home --shell /bin/bash cloudcopasi
USER cloudcopasi

WORKDIR /home/cloudcopasi

# Get and install HTCondor
RUN mkdir -p /home/cloudcopasi/condor/local/fs_auth
# "stable" LTS version, which seems to be getting updates with critical bug fixes
ENV condor_version="9.0"
RUN cd condor && \
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 && \
echo "FS_LOCAL_DIR=/home/cloudcopasi/condor/local/fs_auth" > local/config.d/condor_config.local && \
cd && echo '#/usr/bin/env bash' >> entrypoint.sh && \
cat condor/condor.sh >> entrypoint.sh && \
echo 'exec "$@"' >> entrypoint.sh && \
chmod +x entrypoint.sh

# Download the CopasiSE Linux64 binary.
RUN mkdir -p /cloud-copasi/copasi/bin
RUN mkdir -p copasi/bin
ENV copasi_version="4.34" copasi_build="251"
RUN cd /cloud-copasi/copasi/bin && \
RUN cd copasi/bin && \
curl -L https://github.com/copasi/COPASI/releases/download/Build-${copasi_build}/COPASI-${copasi_version}.${copasi_build}-AllSE.tar.gz | \
tar -xvz --strip-components=2 COPASI-${copasi_version}.${copasi_build}-AllSE/Linux64/CopasiSE && \
chmod +x CopasiSE
# copy over the test model file
COPY brusselator_scan_test.cps /cloud-copasi/copasi/brusselator_scan_test.cps
COPY --chown=cloudcopasi:cloudcopasi brusselator_scan_test.cps copasi/brusselator_scan_test.cps

WORKDIR /cloud-copasi
RUN mkdir log user-files instance_keypairs

WORKDIR /home/cloudcopasi/cloud-copasi
# Install the Python dependencies
COPY requirements.txt /cloud-copasi/requirements.txt
RUN pip install -r /cloud-copasi/requirements.txt
COPY --chown=cloudcopasi:cloudcopasi requirements.txt cloud-copasi/requirements.txt
RUN pip install -r cloud-copasi/requirements.txt
# Copy over the relevant webserver stuff.
# (placing this near the bottom, assuming these may be more likely to change
# during development, vs. stuff above.)
COPY README.txt LICENSE.txt manage.py cloud-copasi-daemon.sh start_service.sh ./
COPY client_scripts client_scripts
COPY cloud_copasi cloud_copasi
COPY web_interface web_interface
COPY cloud_copasi/settings_EXAMPLE.py cloud_copasi/settings.py

# Note: The CMD override scripts are handling setting up the
# condor env and using the venv
ENTRYPOINT ["/tini", "--"]
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_EXAMPLE.py cloud_copasi/settings.py

ENTRYPOINT ["/tini", "--", "/home/cloudcopasi/entrypoint.sh"]

CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
# CMD ["gunicorn", "django_kubernetes_tutorial.wsgi:application", "--bind", "0.0.0.0:8000"]
Expand Down

0 comments on commit 1399408

Please sign in to comment.