From bee6bab94593c0d24f6df153341d6418c4ccfa75 Mon Sep 17 00:00:00 2001 From: meono Date: Wed, 20 Nov 2019 23:19:52 +0100 Subject: [PATCH] Fix: eliminate potential deadlock Add: direct bcl2fastq command output to files Update Dockerfile with version --- Dockerfile | 2 +- run_container.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72bc939..d56e87c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN conda install -y python=3.7.3 RUN cd /tmp && \ git clone https://github.com/meono/library_to_samplesheet.git && \ cd library_to_samplesheet && \ - git checkout v0.1.3 && \ + git checkout v0.1.4 && \ pip install -e . CMD python run_container.py diff --git a/run_container.py b/run_container.py index 56a157a..96fa681 100644 --- a/run_container.py +++ b/run_container.py @@ -61,12 +61,16 @@ '--processing-threads', '8', '--loading-threads', '4', '--writing-threads', '4', - '1>', f'{run_path}/bcl2fastq.out', - '2>', f'{run_path}/bcl2fastq.err' ], stdout=PIPE, stderr=PIPE) - process_b2f.wait() stdout, stderr = process_b2f.communicate() + + # write stdout and strerr to files + with open(f'{run_path}/bcl2fastq.out', 'w') outfile: + outfile.writelines(stdout.decode()) + with open(f'{run_path}/bcl2fastq.err', 'w') errfile: + outfile.writelines(stderr.decode()) + # return error message is something went wrong if process_b2f.returncode != 0: print(f'Bcl2fastq failed with return code '