Skip to content

Commit d26ef68

Browse files
authored
Merge pull request #1991 from codalab/develop
Merge develop into master (1.21.0)
2 parents e6b85e8 + 78d369f commit d26ef68

File tree

306 files changed

+7300
-1053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+7300
-1053
lines changed

.env_sample

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,10 @@ ENABLE_SIGN_IN=True
104104
# GS_PUBLIC_BUCKET_NAME=public
105105
# GS_PRIVATE_BUCKET_NAME=private
106106
# GOOGLE_APPLICATION_CREDENTIALS=/app/certs/google-storage-api.json
107+
108+
109+
# -----------------------------------------------------------------------------
110+
# Logging (Serialized outputs the logs in JSON format)
111+
# -----------------------------------------------------------------------------
112+
LOG_LEVEL=info
113+
SERIALIZED=false

.github/workflows/ghPages-dev.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: github-pages-dev
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy-dev:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: documentation/
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
24+
- run: /home/runner/.local/bin/uv sync
25+
- run: git fetch origin gh-pages --depth=1 && PDF=1 /home/runner/.local/bin/uv run mike deploy -u dev --push

.github/workflows/ghPages-prod.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: github-pages-prod
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy-prod:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: documentation/
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
24+
- run: /home/runner/.local/bin/uv sync
25+
- run: git fetch origin gh-pages --depth=1 && PDF=1 /home/runner/.local/bin/uv run mike deploy -u ${{ github.ref_name }} latest --push
Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,34 @@
1-
FROM fedora:37
1+
FROM fedora:42
22

33
# Include deps
44
RUN 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
1814
COPY 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.
3024
RUN 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
4434
RUN 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
4737
ENV PYTHONUNBUFFERED 1
4838
ENV 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
5846
ENV PATH $PATH:/root/.local/bin
47+
5948
# Want poetry to use system python of docker container
6049
RUN poetry config virtualenvs.create false
6150
RUN poetry config virtualenvs.in-project false
51+
6252
# So we get 3.9
6353
RUN poetry config virtualenvs.prefer-active-python true
6454
COPY ./compute_worker/pyproject.toml ./
6555
COPY ./compute_worker/poetry.lock ./
6656
RUN poetry install
67-
57+
COPY ./src/settings/logs_loguru.py /usr/bin
6858
CMD celery -A compute_worker worker \
6959
-l info \
7060
-Q compute-worker \
7161
-n compute-worker@%n \
72-
--concurrency=1
62+
--concurrency=1
Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,8 @@
1-
FROM fedora:37
1+
FROM codalab/codabench_worker_podman:latest
22

33
# Include deps
4-
RUN curl -s -L https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo | tee /etc/yum.repos.d/cuda.repo && \
5-
curl -s -L https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo | tee /etc/yum.repos.d/nvidia-docker.repo && \
6-
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \
7-
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
4+
RUN dnf -y config-manager addrepo --from-repofile=https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo && \
85
dnf -y update && \
9-
dnf module install -y nvidia-driver:latest-dkms && \
10-
dnf -y install podman fuse-overlayfs python3.9 nvidia-container-runtime nvidia-container-toolkit \
11-
cuda --exclude container-selinux && \
6+
dnf -y install nvidia-container-runtime nvidia-container-toolkit --exclude container-selinux && \
127
dnf clean all && \
13-
rm -rf /var/cache /var/log/dnf* /var/log/yum.*
14-
15-
# Setup user
16-
RUN useradd worker; \
17-
echo -e "worker:1:999\nworker:1001:64535" > /etc/subuid; \
18-
echo -e "worker:1:999\nworker:1001:64535" > /etc/subgid;
19-
20-
# Copy over the podman container configuration
21-
COPY podman/containers.conf /etc/containers/containers.conf
22-
COPY podman/worker-containers.conf /home/worker/.config/containers/containers.conf
23-
24-
# Copy over the podman storage configuration
25-
COPY podman/worker-storage.conf /home/worker/.config/containers/storage.conf
26-
27-
RUN mkdir -p /home/worker/.local/share/containers && \
28-
chown worker:worker -R /home/worker && \
29-
chmod 644 /etc/containers/containers.conf
30-
31-
# Copy & modify the defaults to provide reference if runtime changes needed.
32-
# Changes here are required for running with fuse-overlay storage inside container.
33-
RUN sed -e 's|^#mount_program|mount_program|g' \
34-
-e '/additionalimage.*/a "/var/lib/shared",' \
35-
-e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
36-
/usr/share/containers/storage.conf \
37-
> /etc/containers/storage.conf; sed -i 's/^#no-cgroups = false/no-cgroups = true/;' /etc/nvidia-container-runtime/config.toml
38-
39-
40-
# Add volume for containers
41-
VOLUME /home/worker/.local/share/containers
42-
43-
# This makes output not buffer and return immediately, nice for seeing results in stdout
44-
ENV PYTHONUNBUFFERED 1
45-
ENV CONTAINER_ENGINE_EXECUTABLE podman
46-
47-
# Create directory for tmp space
48-
RUN mkdir /codabench && \
49-
chown worker:worker /codabench && \
50-
# Set up podman registry for dockerhub
51-
echo -e "[registries.search]\nregistries = ['docker.io']\n" > /etc/containers/registries.conf && \
52-
53-
WORKDIR /home/worker/compute_worker
54-
55-
ADD compute_worker/ /home/worker/compute_worker
56-
57-
RUN curl -sSL https://install.python-poetry.org | python3.9 -
58-
# Poetry location so future commands (below) work
59-
ENV PATH $PATH:/root/.local/bin
60-
# Want poetry to use system python of docker container
61-
RUN poetry config virtualenvs.create false
62-
RUN poetry config virtualenvs.in-project false
63-
# So we get 3.9
64-
RUN poetry config virtualenvs.prefer-active-python true
65-
COPY ./compute_worker/pyproject.toml ./
66-
COPY ./compute_worker/poetry.lock ./
67-
RUN poetry install
68-
69-
RUN chown worker:worker -R /home/worker/compute_worker
70-
71-
CMD nvidia-smi && celery -A compute_worker worker \
72-
-l info \
73-
-Q compute-worker \
74-
-n compute-worker@%n \
75-
--concurrency=1
8+
rm -rf /var/cache /var/log/dnf* /var/log/yum.*

Dockerfile.compute_worker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ COPY ./compute_worker/poetry.lock ./
2525
RUN poetry config virtualenvs.prefer-active-python true && poetry install
2626

2727
ADD compute_worker .
28+
COPY ./src/settings/logs_loguru.py /usr/bin
2829

2930
CMD celery -A compute_worker worker \
3031
-l info \

0 commit comments

Comments
 (0)