Skip to content
Open
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
81d20de
Merge branch 'main' into cromper-2
ethteck Dec 18, 2025
fe5f593
add timeouts to all ci tasks
mkst Dec 18, 2025
05c0341
Finish Cromper service rebase
ethteck Jul 17, 2026
3120850
Fix backend production image permissions
ethteck Jul 17, 2026
72e0501
Fix nsjail root mount in containers
ethteck Jul 17, 2026
67ef9a0
Restore backend healthcheck dependency
ethteck Jul 17, 2026
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
174 changes: 81 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,184 +4,167 @@ on:
branches:
- main
pull_request:

jobs:
backend_test_docker_dev:
name: backend tests (docker dev container)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Build decompme_backend image
run: |-
docker build backend --target dev -t decompme_backend
- name: Run tests
- name: Build backend development image
run: docker build backend --target dev -t decompme_backend
- name: Run backend 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
mkdir -p backend/.venv
sudo chown "${USER_1000}:${USER_1000}" backend/.venv
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 LOCAL_FILE_DIR=/local_files \
-e USE_SANDBOX_JAIL=on \
-e SANDBOX_DISABLE_PROC=true \
-e TIMEOUT_SCALE_FACTOR=10 \
-e DUMMY_COMPILER=1 \
-e DATABASE_URL=sqlite:///:memory: \
-e SECRET_KEY=secret-key-secret-key-secret-key-secret-key-secret-key-secret-key \
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} && \
uv run python manage.py test'
-c 'cd /decomp.me/backend && uv sync && uv run python manage.py test'

backend_test_docker_prod:
name: backend tests (docker prod container)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Build decompme_backend image
run: |-
docker build backend --target prod -t decompme_backend
- name: Fetch compilers and libraries
- name: Build backend production image
run: docker build backend --target prod -t decompme_backend
- name: Run backend tests
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
docker run \
--entrypoint /bin/bash \
-e DATABASE_URL=sqlite:///:memory: \
-e SECRET_KEY=secret-key-secret-key-secret-key-secret-key-secret-key-secret-key \
decompme_backend \
-c 'uv run python manage.py test'

cromper_test:
name: cromper tests (docker dev container)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Build Cromper development image
run: docker build cromper --target dev -t decompme_cromper
- name: Run Cromper 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 \
for dir in cromper/.venv cromper/compilers cromper/libraries; do
mkdir -p "$dir"
sudo chown -R "$USER_1000:$USER_1000" "$dir"
done
docker run --rm \
-v $(pwd)/cromper:/cromper \
--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 \
--tmpfs /tmp/sandbox:exec,uid=1000,gid=1000,size=256M,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 COMPILER_BASE_PATH=/cromper/compilers \
-e LIBRARY_BASE_PATH=/cromper/libraries \
-e USE_SANDBOX_JAIL=true \
-e SANDBOX_DISABLE_PROC=true \
-e TIMEOUT_SCALE_FACTOR=10 \
-e DUMMY_COMPILER=1 \
-e DATABASE_URL=sqlite:///:memory: \
-e SECRET_KEY=secret-key-secret-key-secret-key-secret-key-secret-key-secret-key \
decompme_backend \
-c 'uv run python manage.py test'
decompme_cromper \
-c 'cd /cromper && \
uv sync --locked --all-extras && \
uv run --locked compilers/download.py --compilers-dir $COMPILER_BASE_PATH && \
uv run --locked libraries/download.py --libraries-dir $LIBRARY_BASE_PATH && \
uv run --locked pytest'

docker_compose_test:
name: test docker compose
runs-on: ubuntu-latest
timeout-minutes: 10

timeout-minutes: 15
steps:
- uses: actions/checkout@v6

- 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 cromper/libraries

- name: Setup dummy production env
- name: Setup dummy production environment
run: |
echo 'POSTGRES_USER=decompme' >> docker.prod.env
echo 'POSTGRES_PASSWORD=decompme' >> docker.prod.env
echo 'SECRET_KEY=secret-key-secret-key-secret-key-secret-key-secret-key-secret-key' >> docker.prod.env
echo 'DATABASE_URL=psql://decompme:decompme@postgres:5432/decompme' >> docker.prod.env
echo 'CONN_MAX_AGE=60' >> docker.prod.env
echo 'CONN_HEALTH_CHECKS="true"' >> docker.prod.env
echo 'SANDBOX_DISABLE_PROC="true"' >> docker.prod.env
echo 'ALLOWED_HOSTS="backend,backend-green,backend-blue,localhost,127.0.0.1"' >> docker.prod.env
echo 'CROMPER_URL=http://cromper:8888' >> docker.prod.env
echo 'CROMPER_PORT=8888' >> docker.prod.env
echo 'USE_SANDBOX_JAIL="on"' >> docker.prod.env
echo 'SANDBOX_DISABLE_PROC="true"' >> docker.prod.env
echo 'CI=true' >> docker.prod.env
echo 'ACTIVE_SLOT=blue' >> .deploy.env
echo 'BLUE_TAG=latest' >> .deploy.env
echo 'GREEN_TAG=latest' >> .deploy.env
echo 'NGINX_TAG=latest' >> .deploy.env
echo 'CROMPER_TAG=latest' >> .deploy.env

- name: Comment out SSL server configuration from nginx
run: |
sed -i '/{{HTTPS_SERVER_BLOCK_START}}/,/{{HTTPS_SERVER_BLOCK_END}}/s/^/#/' nginx/production/default.conf

- name: Prepare production runtime config
run: |
cp ./nginx/production/runtime/geo.conf.example ./nginx/production/runtime/geo.conf
cp ./nginx/production/runtime/geo.conf.example ./nginx/production/runtime/geo.conf
cp ./nginx/production/runtime/upstream.conf.example ./nginx/production/runtime/upstream.conf

- name: Build production images
run: |
docker compose -f docker-compose.prod.yaml build nginx backend-blue frontend-blue
docker compose -f docker-compose.prod.yaml build cromper nginx backend-blue frontend-blue

- name: Ensure production services
run: |
timeout 60s python3 deploy.py ensure || true
timeout 120s python3 deploy.py ensure

- name: View docker compose logs (blue)
if: always()
run: |
timeout 15s docker compose -f docker-compose.prod.yaml logs -f || true

- name: Check docker compose status (blue)
run: |
docker compose -f docker-compose.prod.yaml ps
run: docker compose -f docker-compose.prod.yaml ps

- name: Deploy green slot
run: |
python3 deploy.py deploy --no-pull latest green
run: python3 deploy.py deploy --no-pull latest green

- name: View docker compose logs (green)
if: always()
run: |
timeout 15s docker compose -f docker-compose.prod.yaml logs -f || true

- name: Check docker compose status (green)
run: |
docker compose -f docker-compose.prod.yaml ps
run: docker compose -f docker-compose.prod.yaml ps

- name: Shut everything down
if: always()
run: |
docker compose -f docker-compose.prod.yaml down
run: docker compose -f docker-compose.prod.yaml down

- name: Print out image sizes
- name: Print image sizes
if: always()
run: |
docker image ls
run: docker image ls

frontend_lint:
name: biome
name: frontend lint and tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Setup Node.js 24
Expand All @@ -203,9 +186,10 @@ jobs:
cd frontend
yarn test

mypy:
name: mypy
backend_lint:
name: backend lint and type check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install uv
Expand All @@ -218,12 +202,15 @@ jobs:
python-version: "3.14"
- 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-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install uv
Expand All @@ -235,7 +222,8 @@ jobs:
with:
python-version: "3.14"
- run: |-
cd backend
uv sync
uv run ruff check .
uv run ruff format --check .
cd cromper
uv sync --locked --all-extras
uv run --locked mypy .
uv run --locked ruff check
uv run --locked ruff format --check
3 changes: 3 additions & 0 deletions .github/workflows/ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: backend
context: backend
target: prod
- name: cromper
context: cromper
target: prod
- name: frontend
context: frontend
target: prod
Expand Down
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/**
Loading