Skip to content
Draft

cromper #1671

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6376629
cleanup (still failing the test but it's somethin)
ethteck Sep 15, 2025
6bb7303
more progz
ethteck Sep 19, 2025
8d7bb0a
more
ethteck Sep 19, 2025
85c54c9
progz
ethteck Sep 19, 2025
9e51c82
cromper is grood
ethteck Sep 21, 2025
8d1b72f
more changin
ethteck Sep 21, 2025
9b9da97
line
ethteck Sep 21, 2025
ffcd1f1
Merge branch 'main' into cromper-2
ethteck Sep 21, 2025
ac2301e
more stuff
ethteck Sep 21, 2025
ee2cd63
biome
ethteck Sep 21, 2025
2836a52
attempt to fix crud
ethteck Sep 21, 2025
d62c16a
fixes
ethteck Sep 21, 2025
f88be26
changes
ethteck Sep 22, 2025
c1627fd
Merge branch 'main' into cromper-2
ethteck Sep 22, 2025
1bd9364
PR comments
ethteck Sep 22, 2025
f811bc0
smores
ethteck Sep 22, 2025
6264904
changes
ethteck Sep 22, 2025
1ab376c
some biome stuff
ethteck Sep 22, 2025
1caf1f6
aah
ethteck Sep 22, 2025
aca7efa
agh
ethteck Sep 22, 2025
4a2766c
right
ethteck Sep 22, 2025
7f367ca
fixes
ethteck Sep 22, 2025
1311b3e
.
ethteck Sep 22, 2025
66a299e
nuke frontend changes (#1679)
mkst Sep 25, 2025
21586ba
Merge branch 'main' of github.com:decompme/decomp.me into cromper-2
mkst Sep 25, 2025
5ba705d
Some progress.. (#1680)
mkst Sep 25, 2025
4681ec0
singular endpoints, fix tests
ethteck Sep 26, 2025
22fe408
fixules
ethteck Sep 26, 2025
55c3cae
import fixes
ethteck Sep 26, 2025
f26866e
ruff check
ethteck Sep 26, 2025
8ecd379
a little cleanup
ethteck Sep 26, 2025
8c40b56
remove more routes from django
ethteck Sep 26, 2025
cfb0421
couple of tweaks (#1682)
mkst Sep 29, 2025
0d2430d
Cromper mkst (#1690)
mkst Oct 21, 2025
51e3823
Merge branch 'main' into cromper-2
ethteck Nov 3, 2025
133d54e
merge main & lints
ethteck Nov 3, 2025
8cbfef6
fix Dockerfile casing
ethteck Nov 3, 2025
0a204cc
whoopz
ethteck Nov 3, 2025
0883c19
whoopz2
ethteck Nov 3, 2025
e7920d2
try to fix
ethteck Nov 4, 2025
053bdb7
Merge branch 'main' into cromper-2
ethteck Dec 3, 2025
3a3689e
more
ethteck Dec 3, 2025
1882035
cromper grood
ethteck Dec 3, 2025
3b2f7fc
format backend
ethteck Dec 3, 2025
7066dea
integration test project
ethteck Dec 13, 2025
3a6a61a
stuff
ethteck Dec 13, 2025
7685d74
goods and services
ethteck Dec 13, 2025
4d0ba9a
progress
ethteck Dec 13, 2025
f3ddeef
Down to 2 tests that pass on their own but not when running with othe…
ethteck Dec 14, 2025
d0af449
some PR comments
ethteck Dec 14, 2025
6bea649
stop doing manual cromper initialization
ethteck Dec 15, 2025
992dc90
Integration tests passing
ethteck Dec 16, 2025
71b937f
Organization and stuff
ethteck Dec 16, 2025
6217420
Merge branch 'main' into cromper-2
ethteck Dec 18, 2025
64d4ba6
simplify django tests in ci
mkst Dec 18, 2025
e3c6d80
d'oh
mkst Dec 18, 2025
c25f712
fix
mkst Dec 18, 2025
cfdd239
try this..
mkst Dec 18, 2025
3240008
add timeouts to all ci tasks
mkst Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DEBUG=on
DUMMY_COMPILER=on
SECRET_KEY=django-insecure-nm#!8%zhc0wwi#m_*l9l)=m*6gs4&o_^-e5b5vj*k05&yaqc1
DATABASE_URL=sqlite:///dev.db
API_BASE=http://127.0.0.1:8000/api
Expand Down
101 changes: 32 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,15 @@ jobs:
docker build backend -t decompme_backend
- name: Run tests
run: |-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
# NOTE: CI does not run as 'ubuntu' user
export USER_1000=$(getent passwd 1000 | cut -d: -f1)
for dir in backend/.venv sandbox local_files compilers libraries; do
mkdir -p "$dir"
sudo chown "${USER_1000}:${USER_1000}" "$dir"
done
sudo chown -R "${USER_1000}:${USER_1000}" .
docker run \
-v $(pwd):/decomp.me \
-v $(pwd)/local_files:/local_files \
-v $(pwd)/compilers:/compilers \
-v $(pwd)/libraries:/libraries \
--security-opt apparmor=unconfined \
--security-opt seccomp=unconfined \
--cap-drop all \
--cap-add setuid \
--cap-add setgid \
--cap-add setfcap \
--tmpfs /sandbox/tmp:exec,uid=1000,gid=1000,size=64M,mode=0700 \
--entrypoint /bin/bash \
-e COMPILER_BASE_PATH=/compilers \
-e LIBRARY_BASE_PATH=/libraries \
-e WINEPREFIX=/tmp/wine \
-e LOCAL_FILE_DIR=/local_files \
-e USE_SANDBOX_JAIL=on \
-e SANDBOX_DISABLE_PROC=true \
-e TIMEOUT_SCALE_FACTOR=10 \
decompme_backend \
-c 'cd /decomp.me/backend && \
uv sync && \
uv run compilers/download.py --compilers-dir ${COMPILER_BASE_PATH} && \
uv run libraries/download.py --libraries-dir ${LIBRARY_BASE_PATH} && \
for r in wine/*.reg; do regedit $r; done && \
uv run python manage.py test'

backend_test_docker_prod:
Expand All @@ -61,45 +36,19 @@ jobs:
- name: Build decompme_backend image
run: |-
docker build backend --target prod -t decompme_backend
- name: Fetch compilers and libraries
run: |-
python3 -m pip install requests
python3 backend/compilers/download.py
python3 backend/libraries/download.py
export USER_1000=$(getent passwd 1000 | cut -d: -f1)
sudo chown -R ${USER_1000}:${USER_1000} backend/compilers
sudo chown -R ${USER_1000}:${USER_1000} backend/libraries
- name: Run tests
run: |-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
export USER_1000=$(getent passwd 1000 | cut -d: -f1)
mkdir -p local_files && sudo chown ${USER_1000}:${USER_1000} local_files
docker run \
-v $(pwd)/local_files:/local_files \
-v $(pwd)/backend/compilers:/compilers \
-v $(pwd)/backend/libraries:/libraries \
--security-opt apparmor=unconfined \
--security-opt seccomp=unconfined \
--cap-drop all \
--cap-add setuid \
--cap-add setgid \
--cap-add setfcap \
--tmpfs /sandbox/tmp:exec,uid=1000,gid=1000,size=64M,mode=0700 \
--entrypoint /bin/bash \
-e LOCAL_FILE_DIR=/local_files \
-e COMPILER_BASE_PATH=/compilers \
-e LIBRARY_BASE_PATH=/libraries \
-e USE_SANDBOX_JAIL=on \
-e SANDBOX_DISABLE_PROC=true \
-e TIMEOUT_SCALE_FACTOR=10 \
-e DATABASE_URL=sqlite:///:memory: \
-e DUMMY_COMPILER=1 \
-e SECRET_KEY=secret-key-secret-key-secret-key-secret-key-secret-key-secret-key \
decompme_backend \
-c '\
for r in wine/*.reg; do regedit $r; done && \
uv run python manage.py test'
-c 'uv run python manage.py test'

# TODO: run cromper unit tests

docker_compose_test:
name: test docker compose
Expand All @@ -112,11 +61,11 @@ jobs:
- name: Fetch compilers and libraries
run: |
python3 -m pip install requests
python3 backend/compilers/download.py
python3 backend/libraries/download.py
python3 cromper/compilers/download.py
python3 cromper/libraries/download.py
export USER_1000=$(getent passwd 1000 | cut -d: -f1)
sudo chown -R ${USER_1000}:${USER_1000} backend/compilers
sudo chown -R ${USER_1000}:${USER_1000} backend/libraries
sudo chown -R ${USER_1000}:${USER_1000} cromper/compilers
sudo chown -R ${USER_1000}:${USER_1000} cromper/libraries

- name: Setup dummy docker.prod.dev
run: |
Expand All @@ -129,6 +78,7 @@ jobs:
echo 'SANDBOX_DISABLE_PROC="true"' >> docker.prod.env
echo 'ALLOWED_HOSTS="backend,localhost,127.0.0.1"' >> docker.prod.env
echo 'USE_SANDBOX_JAIL="on"' >> docker.prod.env
echo 'CROMPER_URL=http://cromper:8888' >> docker.prod.env
echo 'CI=true' >> docker.prod.env

- name: Comment out SSL server configuration from nginx
Expand All @@ -142,6 +92,12 @@ jobs:
docker compose logs nginx | grep "ready for start up"
! docker compose logs nginx | grep -q "nginx-1 exited with code"

- name: Build and bring up cromper container
run: |
docker compose -f docker-compose.prod.yaml build cromper
docker compose -f docker-compose.prod.yaml up -d cromper
timeout 15s docker compose -f docker-compose.prod.yaml logs -f || true

- name: Build and bring up up backend container
run: |
docker compose -f docker-compose.prod.yaml build backend
Expand All @@ -158,6 +114,7 @@ jobs:
run: |
curl --silent http://localhost:8080/ | head -c 256
curl --silent http://localhost:8000/api/ | jq
curl --silent http://localhost:8000/api/platform | jq

- name: Shut everything down
run: |
Expand All @@ -170,6 +127,7 @@ jobs:
frontend_lint:
name: biome
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Node.js 24
Expand All @@ -187,9 +145,10 @@ jobs:
cd frontend
yarn lint

mypy:
name: mypy
backend_lint:
name: backend lint and type check
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install uv
Expand All @@ -202,12 +161,15 @@ jobs:
python-version: "3.12"
- run: |-
cd backend
uv sync
uv run mypy
uv sync --all-extras
uv run mypy .
uv run ruff check
uv run ruff format --check

ruff:
name: ruff
cromper_lint:
name: cromper lint and type check
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install uv
Expand All @@ -219,7 +181,8 @@ jobs:
with:
python-version: "3.12"
- run: |-
cd backend
uv sync
uv run ruff check .
uv run ruff format --check .
cd cromper
uv sync --all-extras
uv run mypy .
uv run ruff check
uv run ruff format --check
9 changes: 3 additions & 6 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ __pycache__/
Dockerfile*
docker.*.env

# compilers
compilers/*/**
!compilers/download.py

# libraries
libraries/*/**
!libraries/download.py
# TEMPORARY: because i'm switching between main/cromper branches
compilers/**
libraries/**
3 changes: 3 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TEMPORARY: because i'm switching between main/cromper branches
compilers/**
libraries/**
144 changes: 6 additions & 138 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ FROM --platform=linux/amd64 ubuntu:24.04 AS base

ENV DEBIAN_FRONTEND=noninteractive


FROM base AS dependencies

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
netcat-traditional \
python-is-python3 \
python3 \
python3-pip \
Expand All @@ -17,150 +21,17 @@ RUN apt-get update \

COPY --from=ghcr.io/astral-sh/uv:0.9.11 /uv /bin/uv

FROM base AS nsjail

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
bison \
flex \
g++ \
gcc \
libnl-route-3-dev \
libprotobuf-dev \
libtool \
make \
pkg-config \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*

RUN git clone "https://github.com/google/nsjail" \
--recursive --branch 3.4 /nsjail \
&& cd /nsjail \
&& make


FROM base AS dependencies

RUN dpkg --add-architecture i386 \
&& add-apt-repository -y ppa:dosemu2/ppa \
&& add-apt-repository -y ppa:stsp-0/dj64 \
&& apt-get update \
&& apt-get install -y -o APT::Immediate-Configure=false --no-install-recommends \
binutils-aarch64-linux-gnu \
binutils-arm-none-eabi \
binutils-djgpp \
binutils-mingw-w64-i686 \
binutils-mips-linux-gnu \
binutils-mipsel-linux-gnu \
binutils-powerpc-linux-gnu \
binutils-sh-elf \
cpp \
dj64 \
dos2unix \
dosemu2 \
gcc-mips-linux-gnu \
iptables \
libarchive-tools \
libc6-dev-i386 \
libdevmapper1.02.1 \
libgpgme11 \
libnl-route-3-200 \
libprotobuf-dev \
libtinfo6 \
netcat-traditional \
unzip \
wget \
wine \
wine32:i386 \
&& rm -rf /var/lib/apt/lists/*

RUN wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb \
&& apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb \
&& rm libtinfo5_6.3-2ubuntu0.1_amd64.deb

COPY --from=nsjail /nsjail/nsjail /bin/nsjail

COPY --from=ghcr.io/decompals/wibo:1.0.0-beta.5 /usr/local/bin/wibo /usr/bin/

# Patched mips binutils
RUN wget "https://github.com/decompals/binutils-mips-ps2-decompals/releases/download/v0.4/binutils-mips-ps2-decompals-linux-x86-64.tar.gz" \
&& tar xvzf binutils-mips-ps2-decompals-linux-x86-64.tar.gz -C /usr/bin mips-ps2-decompals-as mips-ps2-decompals-nm mips-ps2-decompals-objdump \
&& rm binutils-mips-ps2-decompals-linux-x86-64.tar.gz \
&& chmod +x /usr/bin/mips-ps2-decompals-*

# Patched PowerPC binutils
RUN curl -sSL "https://github.com/encounter/gc-wii-binutils/releases/download/2.42-1/linux-x86_64.zip" | \
bsdtar -xvf- -C /usr/bin \
&& chmod +x /usr/bin/powerpc-eabi-*

# MSDOS specific
RUN wget "https://github.com/OmniBlade/binutils-gdb/releases/download/omf-build/omftools.tar.gz" \
&& tar xvzf omftools.tar.gz -C /usr/bin jwasm \
&& rm omftools.tar.gz \
&& wget "https://github.com/decompals/binutils-omf/releases/download/v0.4/omftools-linux-x86_64.tar.gz" \
&& tar xvzf omftools-linux-x86_64.tar.gz -C /usr/bin omf-nm omf-objdump \
&& rm omftools-linux-x86_64.tar.gz

RUN mkdir -p /etc/fonts

ENV WINEPREFIX=/tmp/wine

# Ensure /sandbox and wine dirs have correct ownership
RUN mkdir -p /sandbox \
&& chown -R ubuntu:ubuntu /sandbox \
&& mkdir -p "${WINEPREFIX}" \
&& chown ubuntu:ubuntu "${WINEPREFIX}"

# Switch to non-root user
USER ubuntu

# Initialize wine files to /home/ubuntu/.wine
RUN wineboot --init

WORKDIR /backend


FROM dependencies AS dev

ARG ENABLE_DREAMCAST_SUPPORT
ARG ENABLE_GBA_SUPPORT
ARG ENABLE_GC_WII_SUPPORT
ARG ENABLE_MACOSX_SUPPORT
ARG ENABLE_MSDOS_SUPPORT
ARG ENABLE_N3DS_SUPPORT
ARG ENABLE_N64_SUPPORT
ARG ENABLE_NDS_ARM9_SUPPORT
ARG ENABLE_PS1_SUPPORT
ARG ENABLE_PS2_SUPPORT
ARG ENABLE_PSP_SUPPORT
ARG ENABLE_SATURN_SUPPORT
ARG ENABLE_SWITCH_SUPPORT
ARG ENABLE_WIN32_SUPPORT

ENV ENABLE_DREAMCAST_SUPPORT=${ENABLE_DREAMCAST_SUPPORT} \
ENABLE_GBA_SUPPORT=${ENABLE_GBA_SUPPORT} \
ENABLE_GC_WII_SUPPORT=${ENABLE_GC_WII_SUPPORT} \
ENABLE_MACOSX_SUPPORT=${ENABLE_MACOSX_SUPPORT} \
ENABLE_MSDOS_SUPPORT=${ENABLE_MSDOS_SUPPORT} \
ENABLE_N3DS_SUPPORT=${ENABLE_N3DS_SUPPORT} \
ENABLE_N64_SUPPORT=${ENABLE_N64_SUPPORT} \
ENABLE_NDS_ARM9_SUPPORT=${ENABLE_NDS_ARM9_SUPPORT} \
ENABLE_PS1_SUPPORT=${ENABLE_PS1_SUPPORT} \
ENABLE_PS2_SUPPORT=${ENABLE_PS2_SUPPORT} \
ENABLE_PSP_SUPPORT=${ENABLE_PSP_SUPPORT} \
ENABLE_SATURN_SUPPORT=${ENABLE_SATURN_SUPPORT} \
ENABLE_SWITCH_SUPPORT=${ENABLE_SWITCH_SUPPORT} \
ENABLE_WIN32_SUPPORT=${ENABLE_WIN32_SUPPORT}

ENTRYPOINT ["/backend/docker_entrypoint.sh"]


FROM base AS uv-install

USER ubuntu

WORKDIR /backend
FROM dependencies AS uv-install

COPY pyproject.toml uv.lock /backend/

Expand All @@ -172,12 +43,9 @@ FROM dependencies AS prod
COPY --from=uv-install /backend/.venv /backend/.venv

COPY manage.py /backend
COPY housekeeping.py /backend
COPY db_housekeeping.py /backend

COPY wine /backend/wine
COPY decompme /backend/decompme
COPY libraries /backend/libraries
COPY compilers /backend/compilers

COPY coreapp /backend/coreapp

Expand Down
Loading
Loading