Design Document for PP-912
Interface : server hook event - “endjob”
- Visibility: Public
- Change Control: Experimental
- Details:
- The hook created for this event will be invoked when the job ends at the server side.
- This hook is created by pbsadmin and it will have read privileges to the server and the job object.
- The job object with in the hook can be created by an interface pbs.event().job exposed by the PBS event module.
- The server attributes can be accessed by the interface pbs.server() exposed by the PBS module.
- The queue attributes related to the job can be accessed by the interface pbs.server().queue(<queue_name>) exposed by the server object.
- The node attributes related to the job can be accessed by the interface pbs.server().vnode(<vnode_name>) exposed by the server object.
- The hook will run in foreground.
- The hook can accept or reject the job. Upon reject(), the hook will not interrupt the execution of the process invoking it and a log message - endjob request rejected by <hook name> is added in the server logs.
- On hitting the hook’s alarm, the hook gets rejected with a message - alarm call while running endjob hook <hook name>, request rejected in the server logs.
Usage:
qmgr -c "create hook h1 event=job_end"
qmgr -c "import hook h1 application/x-python default <script path>"
In the following case, If one tries to create a hook with a wrong event name:
qmgr -c "s h h1 event=resvtest"
qmgr obj=h1 svr=default: invalid argument (resvtest) to event.
Should be one or more of: queuejob,modifyjob,resvsub,movejob,runjob,provision,periodic,resv_confirm,resv_end,endjob,execjob_begin,execjob_prologue,execjob_epilogue,execjob_preterm,
execjob_end,exechost_periodic,execjob_launch,exechost_startup or execjob_attach or "" for no event.
qmgr: hook error returned from server