xqute.plugin
Hook specifications for scheduler plugins
on_init
(
xqute
)
— When xqute is initialized</>on_job_failed
(
scheduler
,job
)
— When the job is failed</>on_job_init
(
scheduler
,job
)
— When the job is initialized</>on_job_killed
(
scheduler
,job
)
— When the job is killed</>on_job_killing
(
scheduler
,job
)
— When the job is being killed</>on_job_polling
(
scheduler
,job
)
— When the system is polling job status</>on_job_queued
(
scheduler
,job
)
— When the job is queued</>on_job_started
(
scheduler
,job
)
— When the job starts to run.</>on_job_submitted
(
scheduler
,job
)
— When the job is submitted</>on_job_submitting
(
scheduler
,job
)
— When the job is to be submitted</>on_job_succeeded
(
scheduler
,job
)
— When the job is succeeded</>on_jobcmd_end
(
scheduler
,job
)
(str) — When the job command finishes and after the postscript is run</>on_jobcmd_init
(
scheduler
,job
)
(str) — When the job command wrapper script is initialized before the prescript is run</>on_jobcmd_prep
(
scheduler
,job
)
(str) — When the job command right about to be run</>on_shutdown
(
xqute
,sig
)
— When xqute is shutting down</>
xqute.plugin.
on_init
(
xqute
)
When xqute is initialized
Note that this hook will run at the same time when producer and consumer start. So they are not ensured to be started at this point.
xqute
(Xqute) — The xqute object
xqute.plugin.
on_shutdown
(
xqute
, sig
)
When xqute is shutting down
Return False to stop shutting down, but you have to shut it down
by yourself, for example, xqute.task.cancel()
Only the first return value will be used.
xqute
(Xqute) — The xqute objectsig
(signal.signals | none) — The signal.None
means a natural shutdown
xqute.plugin.
on_job_init
(
scheduler
, job
)
When the job is initialized
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_queued
(
scheduler
, job
)
When the job is queued
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_submitting
(
scheduler
, job
)
When the job is to be submitted
Return False to cancel submitting. Only the first return value is used.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_submitted
(
scheduler
, job
)
When the job is submitted
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_started
(
scheduler
, job
)
When the job starts to run.
Note that this is not when exactly the job starts to run, but when the scheduler starts to wait for the job to finish. So this hook is not suitable for measuring the time of the job.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_polling
(
scheduler
, job
)
When the system is polling job status
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_killing
(
scheduler
, job
)
When the job is being killed
Return False to stop killing the job.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_killed
(
scheduler
, job
)
When the job is killed
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_failed
(
scheduler
, job
)
When the job is failed
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_job_succeeded
(
scheduler
, job
)
When the job is succeeded
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
xqute.plugin.
on_jobcmd_init
(
scheduler
, job
)
When the job command wrapper script is initialized before the prescript is run
This should return a piece of bash code to be inserted in the wrapped job
script (template), which is a python template string, with the following
variables available: status
and job
. status
is the class JobStatus
from
xqute.defaults.py
and job
is the Job
instance.
For multiple plugins, the code will be inserted in the order of the plugin priority.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
The bash code to be inserted
xqute.plugin.
on_jobcmd_prep
(
scheduler
, job
)
When the job command right about to be run
This should return a piece of bash code to be inserted in the wrapped job
script (template), which is a python template string, with the following
variables available: status
and job
. status
is the class JobStatus
from
xqute.defaults.py
and job
is the Job
instance.
The bash variable $cmd
is accessible in the context. It is also possible to
modify the cmd
variable. Just remember to assign the modified value to cmd
.
For multiple plugins, the code will be inserted in the order of the plugin priority.
Keep in mind that the $cmd
may be modified by other plugins.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
The bash code to be inserted
xqute.plugin.
on_jobcmd_end
(
scheduler
, job
)
When the job command finishes and after the postscript is run
This should return a piece of bash code to be inserted in the wrapped job
script (template), which is a python template string, with the following
variables available: status
and job
. status
is the class JobStatus
from
xqute.defaults.py
and job
is the Job
instance.
The bash variable $rc
is accessible in the context, which is the return code
of the job command.
For multiple plugins, the code will be inserted in the order of the plugin priority.
scheduler
(Scheduler) — The scheduler objectjob
(Job) — The job object
The bash code to be inserted