Skip to content

Feat/pull based job dispatch#52

Draft
as535364 wants to merge 17 commits into
mainfrom
feat/pull-based-job-dispatch
Draft

Feat/pull based job dispatch#52
as535364 wants to merge 17 commits into
mainfrom
feat/pull-based-job-dispatch

Conversation

@as535364

@as535364 as535364 commented Apr 28, 2026

Copy link
Copy Markdown
Member

Pull-Based Job Dispatch — Runner / Infra Implementation Plan (Plan B)

as535364 added 14 commits April 28, 2026 04:17
Addresses code review findings:
- yapf -ir on client.py and test_client.py to satisfy CI
- 3 new tests for download_code (happy path, 4xx, network error)
… inline PUT)

Replace on_submission_complete's inline HTTP PUT with a push to result_queue
so the agent's result_sender thread handles delivery. Remove now-unused
imports (requests, tempfile). Add two TDD tests verifying queue push and
state cleanup behaviour.
- delete app.py and gunicorn.conf.py
- Dockerfile CMD: python main.py (+ mkdir -p logs)
- requirements.txt: drop flask + gunicorn (no longer needed)
- dispatcher/utils.py: update logger fallback from 'gunicorn.error' to 'dispatcher'

Sandbox is now an active runner agent that polls Backend, not a passive
HTTP server. The pull-loop modules in agent/ replace the old Flask routes.
After Plan B's removal of SANDBOX_TOKEN, dispatcher/testdata.py needs to
authenticate to backend's testdata endpoints with the runner's own
rk_token (set after registration).

- Module-level _RK_TOKEN with set_runner_token() setter
- fetch_problem_meta, fetch_testdata, get_checksum use it
- main.py calls dispatcher_testdata.set_runner_token(creds.token) after registration
main.py is no longer a Flask app — current_app fallback is dead code.
Caused ModuleNotFoundError when running the sandbox container.
@as535364 as535364 marked this pull request as draft April 28, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant