How gurovic/booml works
Purpose and entry points
Booml is an ML-learning and competition platform: users work in notebooks, execute code in managed environments, submit ML-task results, and participate in courses/contests. The main runtime is a Django backend entered through backend/manage.py, backend/core/asgi.py, and backend/core/urls.py; container orchestration starts from docker-compose.yml or docker-compose.server.yml.
Client applications
The primary browser client is a Vue SPA with routing, API clients, notebook editing, course/contest/problem pages, and profile/auth flows. It communicates with Django HTTP APIs and likely streaming/WebSocket execution endpoints.
• frontend/src/main.js
• frontend/src/router/index.js
• frontend/src/components/NotebookCodeEditor.vue
A separate Vue dashboard supplies operational/metrics-facing UI.
• dashboard/src/main.js
• dashboard/src/pages/DashboardPage.vue
• dashboard/src/api/dashboard.js
Django application boundary
runner is the domain application. URL dispatch separates server-rendered/application views from API endpoints; serializers form the API representation boundary, while forms support browser-oriented mutation flows.
• backend/runner/urls.py
• backend/runner/api/urls.py
• backend/runner/api/serializers/submissions.py
Core persisted entities cover problems and attached datasets, notebook/cell workspaces, submissions/reports, contests/leaderboards, and hierarchical courses/sections.
• backend/runner/models/problem.py
• backend/runner/models/notebook.py
• backend/runner/models/submission.py
Notebook execution pipeline
A user edits notebook cells in the SPA or Django notebook pages, then invokes code-run endpoints. Execution requests are routed into streaming/runtime and worker services; output, artifacts, and reports return to views/API and are persisted against notebook/cell/submission records.
• backend/runner/api/views/run_cell.py
• backend/runner/api/views/run_cell_stream.py
• backend/runner/services/streaming_runs.py
Notebook lifecycle operations—create/import/export, device updates, cell ordering, and output persistence—are distinct view-level controls around the same notebook domain.
• backend/runner/views/create_notebook.py
• backend/runner/views/import_notebook.py
• backend/runner/views/save_cell_output.py
Isolated compute and async control plane
Untrusted or resource-intensive code is isolated behind VM/container management. Backend services define VM configurations, lifecycle management, agent communication, execution backends, and worker behavior. Celery tasks provide asynchronous dispatch; the exact broker is configuration-dependent.
• backend/runner/services/vm_manager.py
• backend/runner/services/vm_agent.py
• backend/runner/services/executor.py
Supporting container/VM image bootstrap is maintained separately from the web backend.
• backend/docker/Dockerfile
• backend/docker/docker_build.py
• backend/docker/vm_bootstrap.py
Evaluation, datasets, and submissions
Problems have on-disk train/test/answer/sample-submission assets under media storage. Submission handling passes results through validation, checking, scoring/custom metrics, and report parsing before exposing submission detail, rankings, and results.
• backend/media/problem_data/10/train/train.csv
• backend/runner/services/checker.py
• backend/runner/services/problem_scoring.py
Prevalidation supports earlier feedback before final evaluation.
• backend/runner/services/prevalidation_service.py
• backend/runner/models/prevalidation.py
• backend/runner/views/receive_test_result.py
Learning and competition layer
Courses organize sections and participants; contests attach ordered problems, access/moderation rules, notifications, leaderboards, and submissions. Permission services are the key authorization boundary across student, teacher, and contest actions.
• backend/runner/models/course.py
• backend/runner/models/contest.py
• backend/runner/services/permissions.py
Infrastructure and external services
The deployment stack uses Docker, Nginx, Django ASGI/WSGI, SQLite in the checked-in local setup, and Prometheus configuration for monitoring. CAPTCHA integration is explicitly encapsulated, and WebSocket notifications/routing support live updates.
• nginx.server.conf
• monitoring/prometheus.yml
• backend/runner/services/captcha.py
Main entry points: urls.py Runner API · submission.py Submission domain · asgi.py Django ASGI entry · streaming_runs.py Streaming runs
Components 21
Client apps
- Learning SPA · Notebook, course, contest, and account UI.
frontend/src/main.js - Notebook editor
frontend/src/components/NotebookCodeEditor.vue - Operations dashboard · Metrics-facing operational UI.
dashboard/src/main.js
Django platform
- Django ASGI entry · Serves HTTP and live execution connections.
backend/core/asgi.py - Application routing · Separates browser views from API routes.
backend/runner/urls.py - Runner API · API representation and mutation boundary.
backend/runner/api/urls.py - Notebook domain · Persists notebooks, cells, outputs, and submissions.
backend/runner/models/notebook.py - Courses and contests · Organizes participants, sections, problems, and leaderboards.
backend/runner/models/contest.py - Permission service · Authorizes student, teacher, and contest actions.
backend/runner/services/permissions.py - Run-cell endpoints · Accepts execution requests and streams output.
backend/runner/api/views/run_cell_stream.py - Streaming runs · Coordinates live runtime output with request handlers.
backend/runner/services/streaming_runs.py
Execution control plane
- Execution backend · Dispatches code to isolated execution environments.
backend/runner/services/executor.py - VM lifecycle manager · Provisions and manages isolated VM/container runtimes.
backend/runner/services/vm_manager.py - VM agent · Communicates execution commands to managed runtimes.
backend/runner/services/vm_agent.py - Runtime image bootstrap · Builds and initializes execution images.
backend/docker/vm_bootstrap.py
Evaluation
- Submission domain · Persists results and evaluation reports.
backend/runner/models/submission.py - Result checker · Validates outputs and evaluates submitted results.
backend/runner/services/checker.py - Problem scoring · Applies scoring and custom metrics.
backend/runner/services/problem_scoring.py - Problem datasets · Train, test, answer, and sample-submission files.
backend/media/problem_data/10/train/train.csv
Deployment and operations
- Container stack · Starts the platform service topology.
docker-compose.yml - Prometheus monitoring
monitoring/prometheus.yml
Connections 23
- Learning SPA → Notebook editor: hosts
- Learning SPA → Django ASGI entry: HTTP APIs
- Notebook editor → Run-cell endpoints: run code
- Operations dashboard → Django ASGI entry: operational APIs
- Django ASGI entry → Application routing: dispatches
- Application routing → Runner API: API routes
- Runner API → Notebook domain: reads and writes
- Runner API → Courses and contests: serves
- Runner API → Permission service: authorizes through
- Run-cell endpoints → Streaming runs: starts streamed run
- Streaming runs → Execution backend: dispatches execution
- Execution backend → VM lifecycle manager: acquires runtime
- VM lifecycle manager → VM agent: controls
- Runtime image bootstrap → VM lifecycle manager: provides runtime image
- Streaming runs → Notebook domain: persists output
- Execution backend → Submission domain: produces result
- Submission domain → Result checker: evaluates
- Result checker → Problem scoring: computes score
- Result checker → Problem datasets: uses expected data
- Problem scoring → Submission domain: stores report
- Submission domain → Courses and contests: updates rankings
- Container stack → Django ASGI entry: runs
- Container stack → Prometheus monitoring: includes monitoring