-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile.model_worker_debian
64 lines (55 loc) · 2.27 KB
/
Dockerfile.model_worker_debian
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
FROM python:3.11
RUN apt-get update && apt-get install -y --no-install-recommends git vim libspatialindex-dev && rm -rf /var/lib/apt/lists/*
RUN adduser --home /home/worker --shell /bin/bash --disabled-password --gecos "" worker
# Add required directories (As root)
WORKDIR /home/worker
RUN mkdir -p /var/oasis && \
mkdir -p /home/worker/model && \
mkdir -p /var/log/oasis/tasks && \
mkdir -p /shared-fs && \
touch /var/log/oasis/worker.log && \
chmod 777 /var/log/oasis/worker.log
RUN chown -R worker:worker /home/worker \
/var/oasis \
/var \
/shared-fs
# User enviroment setup
COPY ./VERSION ./
USER worker
ENV OASIS_MEDIA_ROOT=/shared-fs
ENV OASIS_ENV_OVERRIDE=true
ENV PATH=/home/worker/.local/bin:$PATH
# Install requirements
COPY ./requirements-worker.txt ./requirements.txt
RUN pip install -r ./requirements.txt
# Install MDK from git branch (Optional) 'docker build --build-arg oasislmf_branch=develop'
ARG oasislmf_branch
RUN if [ ! -z "$oasislmf_branch" ] ; then \
apt update && apt install -y git; \
pip uninstall oasislmf -y; \
pip install -v git+https://[email protected]/OasisLMF/OasisLMF.git@${oasislmf_branch}#egg=oasislmf[extra]; \
fi
# Install ODS-Tools from git branch (Optional) 'docker build --build-arg ods_tools_branch=develop'
ARG ods_tools_branch
RUN if [ ! -z "$ods_tools_branch" ] ; then \
apt update && apt install -y git; \
pip uninstall ods-tools -y; \
pip install -v git+https://[email protected]/OasisLMF/ODS_Tools.git@${ods_tools_branch}#egg=ods-tools; \
fi
# Install Oasis-Data-Manager from git branch (Optional) 'docker build --build-arg odm_branch=develop'
ARG odm_branch
RUN if [ ! -z "$odm_branch" ] ; then \
apt update && apt install -y git; \
pip uninstall oasis-data-manager -y; \
pip install --user --no-warn-script-location -v git+https://[email protected]/OasisLMF/OasisDataManager.git@${odm_branch}#egg=oasis-data-manager; \
fi
# Copy startup script + server config
COPY ./src/startup_worker.sh ./startup.sh
COPY ./conf.ini ./
COPY ./src/__init__.py ./src/
COPY ./src/common ./src/common/
COPY ./src/conf ./src/conf/
COPY ./src/model_execution_worker/ ./src/model_execution_worker/
COPY ./src/utils/ ./src/utils/
COPY ./src/utils/worker_bashrc /home/worker/.bashrc
ENTRYPOINT ./startup.sh