Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
datascience
balsamDEPRECATED
Commits
e45ef83f
Commit
e45ef83f
authored
Jan 17, 2018
by
Michael Salim
Browse files
launcher process invokes db_writer
parent
8931606d
Changes
1
Hide whitespace changes
Inline
Side-by-side
balsam/launcher/launcher.py
View file @
e45ef83f
...
...
@@ -15,7 +15,7 @@ flag.
import
argparse
from
math
import
floor
import
os
from
sys
import
exit
import
sys
import
signal
import
time
...
...
@@ -214,7 +214,7 @@ def on_exit(runner_group, transition_pool, job_source, writer_proc):
transition_pool
.
end_and_wait
()
logger
.
debug
(
"on_exit: Launcher exit graceful
\n\n
"
)
writer_proc
.
terminate
()
exit
(
0
)
sys
.
exit
(
0
)
def
get_args
(
inputcmd
=
None
):
...
...
@@ -247,14 +247,18 @@ def detect_dead_runners(job_source):
job
.
update_state
(
'RESTART_READY'
,
'Detected dead runner'
)
def
launch_db_writer_process
():
from
importlib.util
import
find_spec
import
subprocess
db_writer
=
find_spec
(
"balsam.service.db_writer"
).
origin
writer_proc
=
subprocess
.
Popen
([
sys
.
executable
,
db_writer
],
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
STDOUT
)
import
multiprocessing
from
balsam.service
import
db_writer
INSTALL_PATH
=
settings
.
INSTALL_PATH
path
=
os
.
path
.
join
(
INSTALL_PATH
,
'db_writer_socket'
)
if
os
.
path
.
exists
(
path
):
os
.
remove
(
path
)
writer_proc
=
multiprocessing
.
Process
(
target
=
db_writer
.
main
)
writer_proc
.
daemon
=
True
writer_proc
.
start
()
return
writer_proc
if
__name__
==
"__main__"
:
args
=
get_args
()
...
...
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