config_check
tit.jobs.config_check ¶
Reject a job config the runner could not deserialise, at submit time instead of at run time.
Background (the regression this exists for): a client POSTed {"__mock_fast": true} as a
sim config. POST /api/jobs accepted it, the manager wrote config.json, and the job
only failed minutes later inside the runner with
TypeError: SimulationConfig.__init__() missing 2 required positional arguments:
'subject_id' and 'montages'
which reaches the user as a dead job with a stack trace rather than a rejected request. The
runners for these kinds call :func:tit.config_io.deserialize_config directly and have no
fallback, so exactly the same call made here at submit time turns that into a 422.
Only kinds whose __main__ deserialises one class with no fallback are listed. pre,
analyzer and source deliberately tolerate a config deserialize_config rejects (they
fall back to a filtered constructor), so pre-validating them here would reject configs those
runners can genuinely run.
check_job_config ¶
Raise :class:ValueError if config is not a deserialisable config for kind.
A no-op for a kind with no entry in :data:CONFIG_CLASS_FOR_KIND, and a no-op when the
config class cannot be imported in this environment (a host without SimNIBS, say) — this is
a guard against a bad request, never a new hard dependency on the submit path.