oioioi.zeus.handlers

Module Contents

Functions

from_csv_metadata(metadata)

submit_job(env, submission, kind)

Recipe handler that sends the job to Zeus.

transfer_job(env, kind, source_code)

"Sends the job to Zeus for given kind.

restore_job(env, results_env)

import_results(env, **kwargs)

Imports the results returned by Zeus.

update_problem_tests_set(env, kind, **kwargs)

Creates or updates problem oioioi.programs.models.Test objects

Attributes

oioioi.zeus.handlers.DEFAULT_METADATA_DECODER = oioioi.zeus.handlers.from_csv_metadata[source]
oioioi.zeus.handlers.logger[source]
oioioi.zeus.handlers.from_csv_metadata(metadata)[source]
oioioi.zeus.handlers.submit_job(env, submission, kind)[source]

Recipe handler that sends the job to Zeus.

oioioi.zeus.handlers.transfer_job(env, kind, source_code)[source]

“Sends the job to Zeus for given kind.

Used env keys:
  • submission_id

  • language

  • saved_environ_id

  • zeus_problem_id

  • zeus_id

oioioi.zeus.handlers.restore_job(env, results_env)[source]
oioioi.zeus.handlers.MAP_VERDICT_TO_STATUS[source]
oioioi.zeus.handlers.import_results(env, **kwargs)[source]

Imports the results returned by Zeus.

The env['zeus_metadata_decoder'], which is used by this Handler, should be a path to a function which gets Zeus metadata for test (e.g. a env['zeus_results'][0]['metadata'] string) and returns a dictionary which will be a base for test information (at least containing keys name, group and max_score defined as below).

Used environ keys:
  • zeus_results - retrieved from Zeus callback

  • compilation_result - may be OK if the file compiled

    successfully or CE otherwise.

Produced environ keys:

  • tests - a dictionary mapping test names into dictionaries with following keys:

    name

    test name

    kind

    kind of the test (EXAMPLE, NORMAL)

    group

    group the test belongs to

    max_score

    maximum score the user can get for this test

    exec_time_limit

    time limit for the test (in ms)

    exec_memory_limit

    memory limit for the test (in KiB)

    zeus_metadata

    raw metadata for the test as returned by Zeus

  • test_results - a dictionary, mapping test names into dictionaries with the following keys:

    result_code

    test status: OK, WA, RE, …

    result_string

    detailed supervisor information (for example, where the required and returned outputs differ)

    time_used

    total time used, in milliseconds

    zeus_test_result

    raw result returned by Zeus

oioioi.zeus.handlers.update_problem_tests_set(env, kind, **kwargs)[source]

Creates or updates problem oioioi.programs.models.Test objects basing on env['tests'] dict.

Sends email to all admins when tests set differ.

Considers only tests with given kind.

Used environ keys:
  • problem_id

  • tests

  • zeus_problem_id

  • zeus_id