Commit f939f1d5 authored by Flavio TARSETTI's avatar Flavio TARSETTI

Merge branch 'databases_docker_fixes' into '1.4.x'

Databases docker fixes

See merge request !51
parents 0d031f78 cb1aee90
Pipeline #23977 failed with stages
in 7 minutes and 11 seconds
......@@ -226,8 +226,11 @@ def start_db_container(configuration, cmd, host,
if cmd == CMD_VIEW_OUTPUTS:
databases_container.add_port(
database_port, database_port, host_address=host.ip)
databases_container.add_volume(tmp_prefix, '/beat/prefix')
databases_container.add_volume(configuration.cache, '/beat/cache', read_only=False)
databases_container.add_volume(db_tempdir, '/beat/prefix')
databases_container.add_volume(configuration.cache, '/beat/cache')
else:
databases_container.add_volume(tmp_prefix, '/beat/prefix')
databases_container.add_volume(configuration.cache, '/beat/cache', read_only=False)
# Specify the volumes to mount inside the container
if 'datasets_root_path' not in db_configuration:
......@@ -377,7 +380,11 @@ def index_outputs(configuration, names, uid=None, db_root=None, docker=False):
uid=uid, db_root=db_root
)
status = host.wait(databases_container)
logs = host.logs(databases_container)
host.rm(databases_container)
if status != 0:
logger.error("Error occurred: %s", logs)
retcode += 1
return retcode
......@@ -509,6 +516,8 @@ def view_outputs(configuration, dataset_name, excluded_outputs=None, uid=None,
input_group = input_list.group(set_name)
retvalue = 0
# Display the data
try:
previous_start = -1
......@@ -559,9 +568,18 @@ def view_outputs(configuration, dataset_name, excluded_outputs=None, uid=None,
except Exception as e:
logger.error("Failed to retrieve the next data: %s", e)
return 1
retvalue = 1
if docker:
host.kill(databases_container)
status = host.wait(databases_container)
logs = host.logs(databases_container)
host.rm(databases_container)
if status != 0:
logger.error("Docker error: %s", logs)
return 0
return retvalue
# ----------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment