diff --git a/CHANGELOG.md b/CHANGELOG.md index e50d8bbc..d706f7ca 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,47 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.0.0] - 2024-02-28 : https://github.com/BU-ISCIII/buisciii-tools/releases/tag/2.0.0 +## [2.1.0dev] - 2024-0X-0X : https://github.com/BU-ISCIII/buisciii-tools/releases/tag/2.1.X + +### Credits + +Code contributions to the hotfix: + +### Template fixes and updates + +### Modules + +#### Added enhancements + +#### Fixes + +#### Changed + +#### Removed + +### Requirements + +## [2.X.1hot] - 2024-0X-0X : https://github.com/BU-ISCIII/buisciii-tools/releases/tag/2.X.1 + +### Credits + +Code contributions to the hotfix: + +### Template fixes and updates + +### Modules + +#### Added enhancements + +#### Fixes + +#### Changed + +#### Removed + +### Requirements + +## [2.0.0] - 2024-03-01 : https://github.com/BU-ISCIII/buisciii-tools/releases/tag/2.0.0 ### Credits @@ -31,6 +71,8 @@ Code contributions to the release: - Added finish module - Added json files: sftp_user.json - Added delivery jinja templates +- Added IRMA template to services.json +- Scratch module now executes rsync using SLURM's srun #### Fixes diff --git a/bu_isciii/conf/configuration.json b/bu_isciii/conf/configuration.json index a1316823..7a39ff99 100755 --- a/bu_isciii/conf/configuration.json +++ b/bu_isciii/conf/configuration.json @@ -21,10 +21,10 @@ }, "xtutatis_api_settings": { "api_url": "/drylab/api/", - "server": "http://iskylims.isciiides.es" + "server": "https://iskylims.isciii.es" }, "api_settings": { - "server": "http://iskylims.isciiides.es", + "server": "https://iskylims.isciii.es", "api_url": "/drylab/api/" }, "bioinfo_doc": { diff --git a/bu_isciii/scratch.py b/bu_isciii/scratch.py index a43b228d..d31ca0cd 100755 --- a/bu_isciii/scratch.py +++ b/bu_isciii/scratch.py @@ -71,9 +71,6 @@ def __init__( "resolution_full_number" ] self.scratch_tmp_path = os.path.join(self.tmp_dir, self.service_folder) - self.out_file = os.path.join( - self.tmp_dir, self.scratch_tmp_path, "DOC", "service_info.txt" - ) # params like --chdir, --partition and --time srun_params = self.conf["srun_settings"].items() self.srun_settings = [arg for param in srun_params for arg in param] @@ -98,12 +95,13 @@ def __init__( ) self.full_path = os.path.join(self.path, self.service_folder) + self.out_file = os.path.join(self.full_path, "DOC", "service_info.txt") def srun_command(self, srun_settings, command): command_list = [["srun"], srun_settings, command] srun_command = [arg for command in command_list for arg in command] - subprocess.run(srun_command, check=True, shell=True) - return + exit_code = subprocess.call(srun_command) + return exit_code def copy_scratch(self): stderr.print("[blue]I will copy the service from %s" % self.full_path) @@ -114,31 +112,35 @@ def copy_scratch(self): if protocol == "rsync": rsync_command = sysrsync.get_rsync_command( source=self.full_path, - destination=self.conf["scratch_path"], + destination=self.conf["scratch_path"] + "/", options=self.conf["options"], exclusions=self.conf["exclusions"], sync_source_contents=False, ) - self.srun_command(self.srun_settings, rsync_command) + exit_code = self.srun_command(self.srun_settings, rsync_command) + + else: + stderr.print( + "[ref] This protocol is not allowed at the moment", + highlight=False, + ) + sys.exit() + if exit_code == 0: stderr.print( "[green] Data copied to the sftp folder successfully", highlight=False, ) - else: + f = open(self.out_file, "w") + f.write("Temporal directory: " + self.scratch_tmp_path + "\n") + f.write("Origin service directory: " + self.full_path + "\n") + f.close() stderr.print( - "[ref] This protocol is not allowed at the moment", + "[green]Successfully copied the directory to %s" + % self.scratch_tmp_path, highlight=False, ) - sys.exit() - f = open(self.out_file, "w") - f.write("Temporal directory: " + self.scratch_tmp_path + "\n") - f.write("Origin service directory: " + self.full_path + "\n") - f.close() - stderr.print( - "[green]Successfully copied the directory to %s" - % self.scratch_tmp_path, - highlight=False, - ) + else: + stderr.print(f"[red]Errors while copying {self.full_path}") except Exception as e: stderr.print(e) stderr.print( @@ -173,7 +175,7 @@ def revert_copy_scratch(self): if self.conf["protocol"] == "rsync": # scratch_tmp cannot be used due to permission issues scratch_bi_path = "".join( - self.conf["scratch_path"], self.service_folder + [self.conf["scratch_path"], self.service_folder] ) rsync_command = sysrsync.get_rsync_command( source=scratch_bi_path, diff --git a/bu_isciii/templates/services.json b/bu_isciii/templates/services.json index 59a451a7..a2007838 100755 --- a/bu_isciii/templates/services.json +++ b/bu_isciii/templates/services.json @@ -304,5 +304,22 @@ "last_folder":"RESULTS", "delivery_md": "", "results_md": "" - } + }, + "IRMA": { + "label": "", + "template": "IRMA", + "url": "", + "order": 1, + "begin": "", + "end": "", + "description": "", + "clean": { + "folders":["02-preprocessing"], + "files":[] + }, + "no_copy": ["RAW", "TMP"], + "last_folder":"REFERENCES", + "delivery_md": "", + "results_md": "" + } }