1- FROM fedora:37
1+ FROM fedora:42
22
33# Include deps
44RUN dnf -y update && \
5- # https://bugzilla.redhat.com/show_bug.cgi?id=1995337#c3
6- rpm --setcaps shadow-utils 2>/dev/null && \
75 dnf -y install podman fuse-overlayfs python3.9 \
86 --exclude container-selinux && \
97 dnf clean all && \
108 rm -rf /var/cache /var/log/dnf* /var/log/yum.*
119
12- # Setup user
13- RUN useradd worker; \
14- echo -e "worker:1:999\nworker:1001:64535" > /etc/subuid; \
15- echo -e "worker:1:999\nworker:1001:64535" > /etc/subgid;
10+ # Copy the podman-connections file to allow for podman inside the container to connect to podman on the host, running containers alongside podman instead of inside
11+ COPY podman/podman-connections.json /root/.config/containers/podman-connections.json
1612
1713# Copy over the podman container configuration
1814COPY podman/containers.conf /etc/containers/containers.conf
19- COPY podman/worker-containers.conf /home/worker /.config/containers/containers.conf
15+ COPY podman/worker-containers.conf /root /.config/containers/containers.conf
2016
2117# Copy over the podman storage configuration
22- COPY podman/worker-storage.conf /home/worker /.config/containers/storage.conf
18+ COPY podman/worker-storage.conf /root /.config/containers/storage.conf
2319
24- RUN mkdir -p /home/worker/.local/share/containers && \
25- chown worker:worker -R /home/worker && \
26- chmod 644 /etc/containers/containers.conf
20+ RUN mkdir -p /root/.local/share/containers
2721
2822# Copy & modify the defaults to provide reference if runtime changes needed.
2923# Changes here are required for running with fuse-overlay storage inside container.
3024RUN sed -e 's|^#mount_program|mount_program|g' \
31- -e '/additionalimage.*/a "/var/lib/shared",' \
32- -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
33- /usr/share/containers/storage.conf \
34- > /etc/containers/storage.conf
25+ -e '/additionalimage.*/a "/var/lib/shared",' \
26+ -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
27+ /usr/share/containers/storage.conf \
28+ > /etc/containers/storage.conf
3529
3630# Add volume for containers
37- VOLUME /home/worker/.local/share/containers
38-
39- # Create directory for tmp space
40- RUN mkdir /codabench && \
41- chown worker:worker /codabench
31+ VOLUME /root/.local/share/containers
4232
4333# Set up podman registry for dockerhub
4434RUN echo -e "[registries.search]\nregistries = ['docker.io']\n" > /etc/containers/registries.conf
@@ -47,26 +37,26 @@ RUN echo -e "[registries.search]\nregistries = ['docker.io']\n" > /etc/container
4737ENV PYTHONUNBUFFERED 1
4838ENV CONTAINER_ENGINE_EXECUTABLE podman
4939
50- WORKDIR /home/worker/compute_worker
51-
52- ADD compute_worker/ /home/worker/compute_worker
40+ WORKDIR /root/compute_worker
5341
54- RUN chown worker:worker -R /home/worker /compute_worker
42+ ADD compute_worker/ /root /compute_worker
5543
56- RUN curl -sSL https://install.python-poetry.org | python3.9 -
44+ RUN curl -sSL https://install.python-poetry.org | python3.9 - --version 1.8.3
5745# Poetry location so future commands (below) work
5846ENV PATH $PATH:/root/.local/bin
47+
5948# Want poetry to use system python of docker container
6049RUN poetry config virtualenvs.create false
6150RUN poetry config virtualenvs.in-project false
51+
6252# So we get 3.9
6353RUN poetry config virtualenvs.prefer-active-python true
6454COPY ./compute_worker/pyproject.toml ./
6555COPY ./compute_worker/poetry.lock ./
6656RUN poetry install
67-
57+ COPY ./src/settings/logs_loguru.py /usr/bin
6858CMD celery -A compute_worker worker \
6959 -l info \
7060 -Q compute-worker \
7161 -n compute-worker@%n \
72- --concurrency=1
62+ --concurrency=1
0 commit comments