File size: 1,028 Bytes
7f50cd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.12-slim-bookworm@sha256:34386ef0cb081344d7ec1c103ba398e6e9f64e9ab3a1509accc92a4e24a07258
RUN apt-get update && apt-get install -y --no-install-recommends g++ time && rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1

# ---- the toolchain both sides carry ----
# A compiled method must build where it is graded, not only where it was written.
RUN apt-get update \
    && apt-get install -y --no-install-recommends gcc g++ make \
    && rm -rf /var/lib/apt/lists/*

# ---- the package's layers ----
USER root
ENV OMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 MKL_NUM_THREADS=4 NUMEXPR_NUM_THREADS=4 PYTHONDONTWRITEBYTECODE=1 CORE_DIR=/app/core
WORKDIR /app
COPY core/ /app/core/
COPY package_common.py runner.py selfcheck.py /app/
COPY data/ /app/data/
COPY methods/ /app/methods/
RUN chmod -R a+rX /app && chmod +x /app/methods/main/run.sh

# The unprivileged account: the rehearsal runs the method under it, as grading does.
RUN groupadd -g 4242 solver && useradd -u 4242 -g 4242 -M -s /usr/sbin/nologin solver