Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elenacarino-max/Pildora4_ext_StarWars/llms.txt

Use this file to discover all available pages before exploring further.

MLflow Jedi ships as a single Docker image built on python:3.12-slim and orchestrated by a minimal Docker Compose file. The architecture is intentionally self-contained: Streamlit, MLflow’s embedded tracking server, and two SQLite databases all run inside one container, with all persistent state written to a named Docker volume (mlflow_jedi_data) that survives container restarts and image rebuilds. There are no external services — no separate MLflow server, no object store, no database host — making it straightforward to deploy on a classroom laptop, a school server, or a cloud VM.

Prerequisites

Choose one of the following:
  • Docker with Docker Compose — recommended for any shared or persistent deployment. Docker Desktop (Windows/macOS) and Docker Engine with the Compose plugin (Linux) are both supported.
  • Python 3.12 — for local development or single-instructor use without Docker. See the Quickstart for the local Python path.

Environment Variables

Configuration is loaded from a .env file in the app-v2/ directory at startup. Copy .env.example to .env and set values appropriate for your environment before building or starting the app.
VariableDefaultPurpose
MLFLOW_JEDI_TEACHER_PASSWORD1234Password required to access the Profesorado teacher panel. Change this before any shared deployment.
MLFLOW_JEDI_DATA_DIR./dataDirectory where both SQLite databases and the MLflow artifacts folder are created. Relative paths are resolved from the app-v2/ root.
MLFLOW_JEDI_MAX_TEAMS10Maximum number of teams that can join a single session. The built-in team name list also contains exactly ten names.
Inside Docker, the MLFLOW_JEDI_DATA_DIR environment variable is overridden to /app/data by the Dockerfile’s ENV instruction, and the named volume is mounted at that path — so MLFLOW_JEDI_DATA_DIR in .env is only relevant for local Python runs.

Docker Compose

The full docker-compose.yml for app-v2/ is shown below. It defines a single service, maps port 8501, injects the two configurable environment variables from .env, mounts the persistent volume, and sets a restart policy so the container recovers automatically from crashes.
services:
  mlflow-jedi:
    build: .
    ports:
      - "8501:8501"
    environment:
      MLFLOW_JEDI_TEACHER_PASSWORD: ${MLFLOW_JEDI_TEACHER_PASSWORD:-cambia-esta-clave}
      MLFLOW_JEDI_MAX_TEAMS: ${MLFLOW_JEDI_MAX_TEAMS:-10}
    volumes:
      - mlflow_jedi_data:/app/data
    restart: unless-stopped

volumes:
  mlflow_jedi_data:
The named volume mlflow_jedi_data is managed by Docker and persists across docker compose down / docker compose up cycles and image rebuilds. It is mounted at /app/data inside the container, which is where both SQLite databases and the MLflow artifacts/ directory are written. Because MLFLOW_JEDI_DATA_DIR is set to /app/data in the Dockerfile, the container always writes to the volume regardless of what .env contains.

Starting and Stopping

Start (or rebuild) the container:
docker compose up --build
The --build flag ensures the image is rebuilt when source files change. Omit it on subsequent starts if the code has not changed, to save time. Stop the container without losing data:
docker compose down
This stops and removes the container but leaves the mlflow_jedi_data volume intact. All sessions, scores, MLflow runs, and artifacts are preserved for the next startup.
Running docker compose down -v deletes all named volumes, including mlflow_jedi_data. This permanently destroys every session, team score, MLflow run, and artifact stored in the volume. Always export a JSON/CSV backup from the Profesorado panel before running this command if any session data needs to be retained.

Port and Health Check

The container listens on port 8501 (Streamlit’s default), mapped 1-to-1 to the host. The Dockerfile defines a health check that polls the Streamlit internal health endpoint:
python -c "import urllib.request; urllib.request.urlopen('http://localhost:8501/_stcore/health')"
Docker will mark the container unhealthy if this check fails repeatedly. The endpoint is also useful for external load balancers or uptime monitors — a 200 OK response at http://<host>:8501/_stcore/health confirms the app is serving traffic. The full Streamlit start command used in the container is:
streamlit run app.py --server.address=0.0.0.0 --server.port=8501 --server.headless=true
--server.headless=true suppresses the browser-open prompt and email collection that Streamlit shows in interactive mode.

Data Directory Layout

All persistent state lives under a single directory — /app/data in Docker, or the path configured by MLFLOW_JEDI_DATA_DIR in a local Python run. The layout is always:
data/
├── game.db       # sessions, teams, attempts, scores, and defenses
├── mlflow.db     # MLflow tracking metadata (experiments, runs, params, metrics)
└── artifacts/   # confusion matrices, classification reports, and MLflow artifacts
game.db is the application’s own SQLite database, managed by the core/database.py module. mlflow.db is the SQLite backend for the embedded MLflow tracking server. artifacts/ contains files logged during mission runs — primarily matriz_confusion.png and classification_report.json — organised by MLflow’s standard run-ID directory structure. To back up a deployment, stop the container, copy the entire data/ directory (or export JSON/CSV from the teacher panel for a portable summary), then restart.

Security Considerations

The teacher password is a basic access control designed for a supervised classroom activity on a trusted network. It is not a substitute for proper authentication. If you expose MLflow Jedi on a public URL or untrusted network, you must add HTTPS termination (e.g. a reverse proxy with a TLS certificate), a stronger authentication layer, and appropriate network-level access controls. The application has no built-in rate limiting or brute-force protection on the password field.
For typical classroom use on a local network — where the instructor controls access to the URL — the default setup is appropriate. For any internet-facing deployment, treat the teacher password as a first line of defence only and layer additional controls in front of the container.
Before committing to a self-hosted deployment, test the full teacher and student flows on the live public instance at https://pildora4extstarwars-14.streamlit.app/. It runs the same code, requires no setup, and is ideal for trying out the activity before your classroom session.

Build docs developers (and LLMs) love