emo-bon / MetaGOflow

MGnify oriented implementation for the Marine Genomic Observatories oriented pipeline, developed in the framework of an EOSC-Life funded project
https://metagoflow.readthedocs.io
Apache License 2.0
7 stars 8 forks source link

Building the rocrate should not be reliant on the root filesystem #42

Open cymon opened 1 year ago

cymon commented 1 year ago

The workflow completed with success, but the rocrate failed to build because it was trying to use the /tmp filesystem and ran out of space, threw an error then proceeded to delete all the results, thereby loosing 9 days compute work.

INFO [workflow ] completed success                                                                                                                                                                                 
ERROR Unhandled error, try again with --debug for more information:                                                                                                                                                
  can only concatenate str (not "bool") to str                                                                                                                                                                     
ls: cannot access '*.merged.CDS.I5_*.tsv.gz': No such file or directory                                                                                                                                            
ls: cannot access '*.merged.CDS.I5_*.tsv.gz': No such file or directory                                                                                                                                            
export...                                                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                 
  File "utils/edit-ro-crate.py", line 470, in <module>                                                                                                                                                             
    main(args.target_directory, args.extended_config_yaml, args.ena_run_accession_id, args.metagoflow_version)                                                                                                     
  File "utils/edit-ro-crate.py", line 441, in main                                                                                                                                                                 
    crate.write_zip("".join([target_directory,".zip"]))                                                                                                                                                            
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/site-packages/rocrate/rocrate.py", line 440, in write_zip                                                                                          
    self.write(tmp_dir)                                                                                                                                                                                            
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/site-packages/rocrate/rocrate.py", line 430, in write                                                                                              
    writable_entity.write(base_path)                                                                                                                                                                               
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/site-packages/rocrate/model/file.py", line 68, in write                                                                                            
    shutil.copy(self.source, out_file_path)                                                                                                                                                                        
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/shutil.py", line 418, in copy                                                                                                                      
    copyfile(src, dst, follow_symlinks=follow_symlinks)                                                                                                                                                            
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/shutil.py", line 275, in copyfile                                                                                                                  
    _fastcopy_sendfile(fsrc, fdst)                                                                                                                                                                                 
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/shutil.py", line 166, in _fastcopy_sendfile                                                                                                        
    raise err from None                                                                                                                                                                                            
  File "/usr/local/src/miniconda3/envs/metaGOflow/lib/python3.8/shutil.py", line 152, in _fastcopy_sendfile                                                                                                        
    sent = os.sendfile(outfd, infd, offset, blocksize)                                                                                                                                                             
OSError: [Errno 28] No space left on device: 'HWLTKDRXY.UDI210/results/DBH_AAAAOSDA_1_2_HWLTKDRXY.UDI235_clean.fastq.trimmed.fasta' -> '/tmp/rocrate_ilrd4kfh/results/DBH_AAAAOSDA_1_2_HWLTKDRXY.UDI235_clean.fastq
.trimmed.fasta'                                                                                                                                                                                                    
(metaGOflow) 

The rocrate building should not be trying to use the (very small, in my case 50G) root files system rather than partition on which the wf is launched (20TB). Building the ro-crate should perhaps be separated from the workflow, or at the very least the wf needs to check that the rocrate build successful before deleting all the results.