forked from codalab/codabench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.compute_worker
More file actions
34 lines (24 loc) · 1.14 KB
/
Dockerfile.compute_worker
File metadata and controls
34 lines (24 loc) · 1.14 KB
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
FROM --platform=linux/amd64 fedora:43
# This makes output not buffer and return immediately, nice for seeing results in stdout
ENV PYTHONUNBUFFERED=1
# Install Python
RUN dnf -y update && \
dnf install -y python3.9 && \
dnf clean all && \
rm -rf /var/cache /var/log/dnf* /var/log/yum.*
RUN curl -sSL https://install.python-poetry.org | python3.9 - --version 1.8.3
# Poetry location so future commands (below) work
ENV PATH=$PATH:/root/.local/bin
# Want poetry to use system python of docker container
RUN poetry config virtualenvs.create false
RUN poetry config virtualenvs.in-project false
COPY ./compute_worker/pyproject.toml ./
COPY ./compute_worker/poetry.lock ./
# To use python3.9 instead of system python
RUN poetry config virtualenvs.prefer-active-python true && poetry install
ADD compute_worker .
COPY ./src/settings/logs_loguru.py /usr/bin
# Uninstall Poetry since we don't need it anymore and it can introduce CVEs
RUN curl -sSL https://install.python-poetry.org | python3.9 - --uninstall
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["celery -A compute_worker worker -l info -Q compute-worker -n compute-worker@$HOSTNAME --concurrency=1"]