Skip to content
Snippets Groups Projects
Commit 13fb5af4 authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Download extra files before running task's container

parent 766ba3a3
No related branches found
No related tags found
1 merge request!2397Download extra files before running task's container
......@@ -148,7 +148,20 @@ def run_docker_task(client, task, temp_dir):
assert str(folder.resolve()) in str(path.resolve()), "Invalid artifact path: {artifact.path}."
artifact.download_to(str(path))
# 3. Do run the container asynchronously
# 3. Download extra_files
if task.extra_files:
logger.info(f"Downloading extra_files for task {task!s}")
try:
download_extra_files(task, temp_dir)
except Exception as e:
logger.warning(
f"Failed downloading extra_files for task {task!s}: {e!s}"
)
task.state = State.Error
task.save()
return
# 4. Do run the container asynchronously
logger.debug("Running container")
kwargs = {
"environment": {
......@@ -179,19 +192,6 @@ def run_docker_task(client, task, temp_dir):
task.state = State.Running
task.save()
# 4. Download extra_files
if task.extra_files:
logger.info(f"Downloading extra_files for task {task!s}")
try:
download_extra_files(task, temp_dir)
except Exception as e:
logger.warning(
f"Failed downloading extra_files for task {task!s}: {e!s}"
)
task.state = State.Error
task.save()
return
# 5. Read logs
logger.debug("Reading logs from the docker container")
previous_logs = b""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment