Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ChEMBL
C
ChEMBL
Delayed Jobs
Delayed Jobs API
Commits
b292f185
Commit
b292f185
authored
Apr 01, 2021
by
David Mendez
Browse files
Status daemon: move launcher function to a separate module
parent
ce73b471
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
9 deletions
+27
-9
app/blueprints/job_submission/services/job_submission_service.py
...eprints/job_submission/services/job_submission_service.py
+2
-9
app/job_status_daemon/meeseeks_launcher.py
app/job_status_daemon/meeseeks_launcher.py
+25
-0
No files found.
app/blueprints/job_submission/services/job_submission_service.py
View file @
b292f185
...
...
@@ -23,6 +23,7 @@ from app.config import RUN_CONFIG
from
app.models
import
delayed_job_models
from
app
import
utils
from
app.job_statistics
import
statistics_saver
from
app.job_status_daemon
import
meeseeks_launcher
JOBS_RUN_DIR
=
RUN_CONFIG
.
get
(
'jobs_run_dir'
,
str
(
Path
().
absolute
())
+
'/jobs_run'
)
if
not
os
.
path
.
isabs
(
JOBS_RUN_DIR
):
...
...
@@ -562,15 +563,7 @@ def submit_job_to_lsf(job):
delayed_job_models
.
save_job
(
job
)
app_logging
.
debug
(
f
'LSF Job ID is:
{
lsf_job_id
}
'
)
app_logging
.
debug
(
'Going to launch Mr Meeseeks to monitor the job status'
)
meeseeks_command
=
f
'/app/run_daemon.sh
{
job
.
id
}
'
app_logging
.
debug
(
f
'Mr Meeseeks command is:
{
meeseeks_command
}
'
)
checker_env
=
{
'CONFIG_FILE_PATH'
:
os
.
getenv
(
'CONFIG_FILE_PATH'
)
}
app_logging
.
debug
(
f
'Mr Meeseeks env is:
{
checker_env
}
'
)
meeseeks_process
=
subprocess
.
Popen
(
shlex
.
split
(
meeseeks_command
),
env
=
checker_env
)
app_logging
.
debug
(
f
'Mr Meeseeks summoned! PID is
{
meeseeks_process
.
pid
}
'
)
meeseeks_launcher
.
summon_meeseeks_for_job
(
job
.
id
)
def
get_lsf_job_id
(
submission_out
):
...
...
app/job_status_daemon/meeseeks_launcher.py
0 → 100644
View file @
b292f185
"""
Module that launches the status daemon in a Mr Meeseeks way
"""
import
os
import
shlex
import
subprocess
import
app.app_logging
as
app_logging
def
summon_meeseeks_for_job
(
job_id
):
"""
starts the job checking process. It will disappear once the job is finished or errored.
:param job_id: id of the job to monitor
"""
app_logging
.
debug
(
'Going to launch Mr Meeseeks to monitor the job status'
)
meeseeks_command
=
f
'/app/run_daemon.sh
{
job_id
}
'
app_logging
.
debug
(
f
'Mr Meeseeks command is:
{
meeseeks_command
}
'
)
checker_env
=
{
'CONFIG_FILE_PATH'
:
os
.
getenv
(
'CONFIG_FILE_PATH'
)
}
app_logging
.
debug
(
f
'Mr Meeseeks env is:
{
checker_env
}
'
)
meeseeks_process
=
subprocess
.
Popen
(
shlex
.
split
(
meeseeks_command
),
env
=
checker_env
)
app_logging
.
debug
(
f
'Mr Meeseeks summoned! PID is
{
meeseeks_process
.
pid
}
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment