Metadata-Version: 2.4
Name: nitro-contestant-runtime
Version: 1.0.0
Summary: Pinned contestant runtime for Nitro AI competitions
Author: Mihnea-Teodor Stoica
License-Expression: AGPL-3.0-only
Project-URL: Repository, https://github.com/MihneaTeodorStoica/contestant-jupyter-server
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.11
Requires-Python: <3.12,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cloudpickle==3.1.2
Requires-Dist: numpy==2.4.6
Requires-Dist: pandas==3.0.5
Requires-Dist: scipy==1.17.1
Requires-Dist: scikit-learn==1.9.0
Requires-Dist: scikit-image==0.26.0
Requires-Dist: numba==0.66.0
Requires-Dist: matplotlib==3.11.1
Requires-Dist: seaborn==0.13.2
Requires-Dist: torch==2.9.1
Requires-Dist: torchvision==0.24.1
Requires-Dist: torchmetrics==1.9.0
Requires-Dist: transformers==5.14.1
Requires-Dist: timm==1.0.28
Requires-Dist: stable-baselines3==2.9.0
Requires-Dist: gymnasium==1.3.0
Requires-Dist: spacy==3.8.14
Requires-Dist: gensim==4.4.0
Requires-Dist: nltk==3.10.0
Requires-Dist: opencv-python-headless==5.0.0.93
Requires-Dist: Pillow==12.3.0
Requires-Dist: gdown==6.1.0
Requires-Dist: Unidecode==1.4.0
Requires-Dist: tornado==6.5.7
Provides-Extra: notebook
Requires-Dist: ipykernel==7.3.0; extra == "notebook"
Requires-Dist: ipywidgets==8.1.8; extra == "notebook"
Requires-Dist: jedi-language-server==0.47.0; extra == "notebook"
Requires-Dist: jupyterlab==4.6.2; extra == "notebook"
Requires-Dist: jupyterlab-lsp==5.3.0; extra == "notebook"
Requires-Dist: notebook==7.6.1; extra == "notebook"
Requires-Dist: jupyterlab-nitro-ai-judge==1.6.2; extra == "notebook"
Requires-Dist: nitro-ai-judge-cli<4,>=3.0.2; extra == "notebook"
Dynamic: license-file

# Nitro Contestant Runtime

The owned, reproducible runtime used by Nitro AI contestant notebooks and the
submission proxy. This repository retains the history and AGPL-3.0 license of
the original `nitronlp/contestant-jupyter-server` project.

## Published interfaces

Python 3.11 applications can install the shared scientific/ML runtime or the
same runtime plus the notebook UI:

```bash
pip install nitro-contestant-runtime==1.0.0
pip install "nitro-contestant-runtime[notebook]==1.0.0"
```

The package contains dependency metadata only; it intentionally installs no
importable `nitro_contestant_runtime` module.

The matching Linux/AMD64 fallback containers are:

```text
ghcr.io/mihneateodorstoica/nitro-contestant-notebook:1.0.0
ghcr.io/mihneateodorstoica/nitro-submission-proxy:1.0.0
```

`1.0` and `stable` are promoted only after both exact images pass the shared
runtime, proxy, Jupyter base-path, and cross-image cloudpickle checks.

## Runtime contract

The notebook keeps the upstream `/home/jovyan` home, `/opt/conda` runtime,
custom OAuth login, base-path entrypoint, and outbound network isolation. It
accepts the base path as its first argument and exposes Jupyter on port 8888.
Both `PROXY_URL` and `NITRO_SUBMISSION_PROXY_URL` point at the submission proxy;
`PROXY_URL_CLIENT` is the browser-visible URL.

The proxy keeps the Python 3.11/nsjail prejudging sandbox, cache and API
contract, and exposes `/health` and the proxy API on port 9000. Required proxy
settings are `JUDGE_BASE_URL`, `ORGANIZATION_SLUG`, `COMPETITION_SLUG`, and
`JUPYTER_BASE_URL`.

## Local stack

```bash
docker network create nitro_net
mkdir -p secrets
touch secrets/session_whitelist_bypass_key
cp jupyter-server/.env.example jupyter-server/.env
cp submission-proxy/.env.remote submission-proxy/.env
docker compose up --build
```

Edit the organization, competition, judge, and Jupyter URLs in
`submission-proxy/.env` before connecting to a real competition. Add
`docker-compose.gpu.yml` when the NVIDIA Container Toolkit is available:

```bash
docker compose -f docker-compose.yml -f docker-compose.gpu.yml up --build
```

## Reproducing the lock and images

`pyproject.toml` is the only hand-edited dependency input. `uv.lock` and the
two hashed pip exports are tracked:

```bash
uv lock
uv export --locked --no-dev --no-emit-project --output-file requirements/base.txt
uv export --locked --no-dev --no-emit-project --extra notebook --output-file requirements/notebook.txt
docker build -f jupyter-server/Dockerfile -t nitro-contestant-notebook .
docker build -f submission-proxy/Dockerfile -t nitro-submission-proxy .
```

Both Dockerfiles use the repository root so the image installs those exact
hashes and then installs the local metadata package with `--no-deps`.
