How topcoder-platform/marathon-match-api-v6 works
This is a NestJS Marathon Match API that stores challenge scoring configuration, prepares tester JARs, accepts submission events, and launches ECS scoring work. The runtime workflow proceeds from configuration and tester setup through submission-triggered scoring, runner callbacks, and review-result handling; separate branches cover reruns, scheduled SYSTEM scoring, and runner-log retrieval. The tree and excerpts establish the API entry points and several service responsibilities, but do not show all worker, persistence, or ECS wiring, so uncertain links are omitted.
Main entry points: scoring-result.service.ts Scoring result service · prisma.service.ts Prisma access · main.ts HTTP API · tester.service.ts Tester service
Components 32
Configuration and testers
- HTTP API
src/main.ts - Config endpoints
src/api/marathon-match-config/marathon-match-config.controller.ts - Config service
src/api/marathon-match-config/marathon-match-config.service.ts - Tester endpoints
src/api/tester/tester.controller.ts - Tester service
src/api/tester/tester.service.ts - Tester compilation
src/api/tester/tester-compilation.service.ts - Compilation worker
src/api/tester/compilation-worker.service.ts
Submission intake
- Kafka consumer
src/shared/modules/kafka/kafka-consumer.service.ts - Submission handler
src/shared/modules/kafka/handlers/marathon-match-submission.handler.ts
Scoring orchestration
- Scoring endpoints
src/api/scoring-result/scoring-result.controller.ts - Scoring result service
src/api/scoring-result/scoring-result.service.ts - SYSTEM scheduler
src/api/scoring-result/system-score-dispatch-scheduler.service.ts - SYSTEM worker
src/api/scoring-result/system-score-dispatch-worker.service.ts - Relative scheduler
src/api/scoring-result/relative-scoring-recompute-scheduler.service.ts - Relative worker
src/api/scoring-result/relative-scoring-recompute-worker.service.ts - Test timeout scheduler
src/api/scoring-result/system-test-timeout-scheduler.service.ts - Test timeout worker
src/api/scoring-result/system-test-timeout-worker.service.ts - Completion email
src/api/scoring-result/scoring-completion-email.service.ts
Runner and integrations
- ECS runner tasks
- ECS service
src/shared/modules/global/ecs.service.ts - Marathon runner
ecs-runner/boilerplate/src/main/java/com/topcoder/marathon/MarathonController.java - Scorer entry point
src/java/boilerplate/src/main/java/com/topcoder/scorer/ScorerMain.java - Submission client
src/java/boilerplate/src/main/java/com/topcoder/scorer/services/SubmissionService.java - Review client
src/java/boilerplate/src/main/java/com/topcoder/scorer/services/ReviewService.java - PostgreSQL
- Prisma access
src/shared/modules/global/prisma.service.ts - Runner-log endpoint
src/api/submission-runner-log/submission-runner-log.controller.ts - Runner-log service
src/api/submission-runner-log/submission-runner-log.service.ts
Other components
- Administrator / caller
- Kafka broker
- Submission API
- CloudWatch logs
Connections 35
- Administrator / caller → HTTP API: calls
- HTTP API → Config endpoints: routes
- HTTP API → Tester endpoints: routes
- HTTP API → Scoring endpoints: routes
- Config endpoints → Config service: calls
- Tester endpoints → Tester service: calls
- Tester service → Tester compilation: compiles
- Tester compilation → Compilation worker: dispatches
- Config service → Prisma access: persists
- Tester service → Prisma access: persists
- Kafka broker → Kafka consumer: delivers events
- Kafka consumer → Submission handler: dispatches
- Submission handler → Scoring result service: requests scoring
- Scoring endpoints → Scoring result service: calls
- SYSTEM scheduler → SYSTEM worker: schedules
- SYSTEM worker → ECS service: launches task
- Scoring result service → ECS service: launches task
- ECS service → ECS runner tasks: starts task
- ECS runner tasks → Marathon runner: runs
- Marathon runner → Scorer entry point: executes scoring
- Scorer entry point → Submission client: fetches submission
- Submission client → Submission API: reads metadata and files
- Scorer entry point → Review client: posts score
- Review client → Submission API: creates review
- Marathon runner → Scoring endpoints: posts callback
- Scoring result service → Prisma access: stores results
- Relative scheduler → Relative worker: schedules
- Relative worker → Scoring result service: recomputes scores
- Test timeout scheduler → Test timeout worker: schedules
- Test timeout worker → Scoring result service: handles timeout
- Scoring result service → Completion email: notifies completion
- Runner-log endpoint → Runner-log service: calls
- Runner-log service → Prisma access: reads task mappings
- Runner-log service → CloudWatch logs: fetches events
- Prisma access → PostgreSQL: reads and writes