:py:mod:`oioioi.zeus.handlers` ============================== .. py:module:: oioioi.zeus.handlers Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: oioioi.zeus.handlers.from_csv_metadata oioioi.zeus.handlers.submit_job oioioi.zeus.handlers.transfer_job oioioi.zeus.handlers.restore_job oioioi.zeus.handlers.import_results oioioi.zeus.handlers.update_problem_tests_set Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.zeus.handlers.DEFAULT_METADATA_DECODER oioioi.zeus.handlers.logger oioioi.zeus.handlers.MAP_VERDICT_TO_STATUS .. py:data:: DEFAULT_METADATA_DECODER :annotation: = oioioi.zeus.handlers.from_csv_metadata .. py:data:: logger .. py:function:: from_csv_metadata(metadata) .. py:function:: submit_job(env, submission, kind) Recipe handler that sends the job to Zeus. .. py:function:: transfer_job(env, kind, source_code) "Sends the job to Zeus for given ``kind``. Used ``env`` keys: * ``submission_id`` * ``language`` * ``saved_environ_id`` * ``zeus_problem_id`` * ``zeus_id`` .. py:function:: restore_job(env, results_env) .. py:data:: MAP_VERDICT_TO_STATUS .. py:function:: import_results(env, **kwargs) 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 .. py:function:: update_problem_tests_set(env, kind, **kwargs) Creates or updates problem :class:`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``