Skip to content

Commit

Permalink
fix processing with directory outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Mar 11, 2024
1 parent 33a9d9e commit 6281725
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions process/process_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ def decode_task_json(json_string: Optional[str]) -> Any:
docker_result = container.wait()
logger.info(docker_result)

# Print the log out of the module
logger.info("=== MODULE OUTPUT - BEGIN ========================================")
if container.logs() is not None:
logs = container.logs().decode("utf-8")
if not config.mercure.processing_logs.discard_logs:
monitor.send_process_logs(task.id, task_processing.module_name, logs)
logger.info(logs)
logger.info("=== MODULE OUTPUT - END ==========================================")

# In lieu of making mercure a sudoer...
logger.debug("Changing the ownership of the output directory...")
try:
Expand All @@ -285,15 +294,12 @@ def decode_task_json(json_string: Optional[str]) -> Any:
# Reset the permissions to owner rwx, world readonly.
( folder / "out" ).chmod(0o755)
for k in ( folder / "out" ).glob("**/*"):
k.chmod(0o644)
# Print the log out of the module
logger.info("=== MODULE OUTPUT - BEGIN ========================================")
if container.logs() is not None:
logs = container.logs().decode("utf-8")
if not config.mercure.processing_logs.discard_logs:
monitor.send_process_logs(task.id, task_processing.module_name, logs)
logger.info(logs)
logger.info("=== MODULE OUTPUT - END ==========================================")
if k.is_dir():
k.chmod(0o755)

for k in ( folder / "out" ).glob("**/*"):
if k.is_file():
k.chmod(0o644)

await monitor.async_send_task_event(
monitor.task_event.PROCESS_MODULE_COMPLETE,
Expand Down

0 comments on commit 6281725

Please sign in to comment.