Skip to content

Commit

Permalink
Merge branch 'master' of github.com:covidgraph/motherlode
Browse files Browse the repository at this point in the history
  • Loading branch information
timbleimehl committed Aug 4, 2020
2 parents 5e2ac1e + a188508 commit 06237c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions motherlode/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class DEFAULT(ConfigBase):
# similar to DATALOADER_LIST but only to run a single dataloader. overrides DATALOADER_LIST
DATALOADER_SINGLE = None

SKIP_DATALOADER_LIST = []

# DOCKER_DEAMON_BASE_URL = "tcp://127.0.0.1:1234"
DOCKER_DEAMON_BASE_URL = "unix://var/run/docker.sock"

Expand Down
13 changes: 11 additions & 2 deletions motherlode/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def create_log_node(dataloader_name, image):


def get_log_nodes(dataloader_name, image):
# NodeMatcher will fail with neo4j 4.x and py2neo 4.*
return list(
py2neo.NodeMatcher(get_graph()).match(
"LoadingLog",
Expand Down Expand Up @@ -186,9 +187,13 @@ def run_datasource_containers():

for datasource in sorted_datasources:
envs = env_vars.copy()

if "envs" in datasource:
envs.update(datasource["envs"])
log.info("###########################".format(datasource["dockerimage"]))
log.info("###########################{}".format(datasource["dockerimage"]))
if datasource["name"] in config.SKIP_DATALOADER_LIST:
log.info("Skip because of value in config.SKIP_DATALOADER_LIST")
continue
container_name = "ML_{}".format(datasource["name"])
log.info(
"[{}]: checking dependencies: {}".format(
Expand Down Expand Up @@ -249,7 +254,11 @@ def run_datasource_containers():
log_file = open(log_file_path, "a")
log_file.write(l.decode())
log_file.close()
res = container.wait()
try:
res = container.wait()
except:
# container allready shut down. this can happen when exiting happens very fast
pass

log_file = open(log_file_path, "a")
log_file.write("================================================")
Expand Down

0 comments on commit 06237c3

Please sign in to comment.