Newer
Older
# This is nrao:workflow
ARG LOCAL_OR_SERVER_PEX=local-pex
FROM python:3.10-slim-buster as base
ARG WS_VERSION=unknown-version
# Environment variables
ENV PIP_NO_CACHE_DIR false
ENV CAPO_PROFILE docker
ENV CAPO_PATH /home/ssa/capo
# Get postgres/mysql development stuff in the image
RUN apt update \
&& apt install -y --no-install-recommends \
gcc \
libmariadb-dev-compat \
libpq-dev \
&& rm -rf /var/lib/apt/lists
# Create vlapipe group and create vlapipe user placed in vlapipe group
RUN addgroup --gid 6000 vlapipe && \
useradd --create-home --comment "" --gid 6000 --uid 6000 vlapipe
# Create almapipe group and create almapipe user placed in almapipe group
RUN addgroup --gid 9233 almapipe && \
useradd --create-home --comment "" --gid 9233 --uid 9233 almapipe
# needed for unit tests
USER vlapipe
WORKDIR /home/ssa/capo
COPY --chown=vlapipe:vlapipe docker.properties docker.properties
WORKDIR /code/
RUN chown vlapipe . && chgrp vlapipe .
# Switch to appuser and set ownership of docker.properties to vlapipe and the vlapipe group
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH "${PATH}:/home/vlapipe/.local/bin"
COPY --chown=vlapipe:vlapipe ./shared ./shared
COPY --chown=vlapipe:vlapipe ./apps/cli ./apps/cli
RUN pip install --upgrade pip
COPY --chown=vlapipe:vlapipe ./services/workflow/requirements.txt ./requirements.txt
COPY --chown=vlapipe:vlapipe ./test-requirements.txt ./test-requirements.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r requirements.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r test-requirements.txt
FROM base as server-pex
COPY --chown=vlapipe:vlapipe ./services/workflow/gitlab-requirements.txt ./requirements.txt
COPY --chown=vlapipe:vlapipe ./test-requirements.txt ./test-requirements.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r requirements.txt --extra-index-url https://${API_TOKEN}@gitlab.nrao.edu/api/v4/projects/621/packages/pypi/simple
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r test-requirements.txt
#COPY --chown=vlapipe:vlapipe ./services/workflow/bin/install-pexes.sh ./install-pexes.sh
#RUN . ./install-pexes.sh
FROM ${LOCAL_OR_SERVER_PEX} as pex-base
RUN apt update && apt install -y curl gnupg apt-transport-https
RUN curl -fsSL https://research.cs.wisc.edu/htcondor/repo/keys/HTCondor-9.0-Key | apt-key add -
RUN echo "deb [arch=amd64] https://research.cs.wisc.edu/htcondor/repo/debian/9.0 buster main" > /etc/apt/sources.list.d/htcondor.list
RUN echo "deb-src https://research.cs.wisc.edu/htcondor/repo/debian/9.0 buster main" >> /etc/apt/sources.list.d/htcondor.list
RUN apt update && apt install -y procps htcondor nano
# HTCondor setup
# Copy over HTCondor submit node config
# 00-htcondor-9.0.config is environment specific, copy handled later

Brittany Faciane
committed
COPY /config/htcondor/submit/99-workspaces-submit.${DEPLOY_ENV}.conf /etc/condor/config.d/99-workspaces-submit.${DEPLOY_ENV}.conf
COPY /config/htcondor/submit/nrao-nofile.conf /etc/security/limits.d/nrao-nofile.conf

Andrew Kapuscinski
committed
# set ownership of /code directory to vlapipe:vlapipe

Andrew Kapuscinski
committed
RUN chown vlapipe . && chgrp vlapipe .

Andrew Kapuscinski
committed

Andrew Kapuscinski
committed
# Copy service directory to /code in the image
# set ownership of content to vlapipe and the vlapipe group
COPY --chown=vlapipe:vlapipe ./services/workflow ./services/workflow
WORKDIR /code/services/workflow
RUN poetry install

Andrew Kapuscinski
committed

Nathan Bockisch
committed
# Needed for nraorsync to work with the RADIAL cluster
COPY /config/htcondor/submit/condor_ssh_config /home/vlapipe/.ssh/condor_ssh_config
ARG WS_VERSION=unknown-version
ENV PYTHONPATH "${PYTHONPATH}:/home/vlapipe/.local"
ENV PATH "${PATH}:/home/vlapipe/.local/bin"
COPY /config/htcondor/00-htcondor-9.0.config /etc/condor/config.d/00-htcondor-9.0.config
CMD /code/services/workflow/bin/boot-condor-and-workflow.sh
ARG WS_VERSION=unknown-version
ENV PYTHONPATH "${PYTHONPATH}:/home/vlapipe/.local"
ENV PATH "${PATH}:/home/vlapipe/.local/bin"
ENV PATH $PATH:/lustre/aoc/pipeline/$CAPO_PROFILE/workflow
USER root
COPY /config/htcondor/00-htcondor-9.0.local.config /etc/condor/config.d/00-htcondor-9.0.config
CMD /code/services/workflow/bin/boot-condor-and-workflow.sh