Feat/pull based job dispatch#52
Draft
as535364 wants to merge 17 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull-Based Job Dispatch — Runner / Infra Implementation Plan (Plan B)