common.rpc
¶
This is our custom RPC implementation, used by all of our apps to communicate securely with each other.
Utilities¶
Autograder¶
-
common.rpc.ag_master.
trigger_jobs
(*, assignment_id: str, jobs: List[str])[source]¶ Given a list of job IDs, queues autograder workers to begin grading.
- Parameters
Bound in
create_okpy_endpoints()
-
common.rpc.ag_master.
get_submission
(*, job_id: str) → Dict[source]¶ Given a job ID, gets submission information from Okpy and forwards it to the requesting worker.
- Parameters
job_id (str) – the job ID associated with the requested backup
- Returns
a dictionary containing backup information, specifically the
data
value here
Bound in
create_worker_endpoints()
-
common.rpc.ag_master.
handle_output
(*, output: str, job_id: str)[source]¶ Given output and a job ID, parses the output for scores and uploads them to Okpy. See
worker
for helper functions used.- Parameters
Bound in
create_worker_endpoints()
-
common.rpc.ag_master.
set_failure
(*, job_id: str, result: str)[source]¶ Given a job ID and some output result, set the job to failed and report the failure to Okpy.
- Parameters
Bound in
create_worker_endpoints()
-
common.rpc.ag_master.
upload_zip
(*, course: str, name: str, file: str)[source]¶ Given a course, a filename, and base64-encoded zip file contents, upload the file to a cloud storage bucket. This method is meant to be accessed using the SICP command-line tool.
- Parameters
Bound in
create_admin_endpoints()
-
common.rpc.ag_master.
create_assignment
(*, course: str, name: str, file: str, command: str, batch_size: int, grading_base: str) → str[source]¶ Given some information about an assignment, register it into the autograder database so that it may be graded using the autograder. This method is meant to be accessed using the SICP command-line tool.
- Parameters
course (str) – the course code
name (str) – the assignment shortname
file (str) – the assignment filename (should be the same as
name
inupload_zip()
)command (str) – the command the worker should run to grade a backup for this assignment
batch_size (int) – how many backups should be graded by one worker
grading_base (str) – the grading server associated with the assignment (by default, https://okpy.org)
Bound in
create_admin_endpoints()