From 4ee9a57957d1563f41d60093d26e3fa1409f9273 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Wed, 1 Nov 2023 15:17:51 -0400 Subject: [PATCH 1/9] fix: update cruise repo path on biowulf --- bin/install_biowulf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_biowulf.sh b/bin/install_biowulf.sh index 1f2ca14..b4ed4b5 100755 --- a/bin/install_biowulf.sh +++ b/bin/install_biowulf.sh @@ -3,7 +3,7 @@ set -euxo pipefail version=$1 -repo_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/cruise-dev/ +repo_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/dev/ install_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/${version} bin_path=${install_path}/bin/ From e365c1179d1b914b44075a7218fa5e55e8df369e Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Wed, 1 Nov 2023 23:38:27 -0400 Subject: [PATCH 2/9] fix: make sure installed files are readable by all --- bin/install_biowulf.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/install_biowulf.sh b/bin/install_biowulf.sh index 1f2ca14..b26685b 100755 --- a/bin/install_biowulf.sh +++ b/bin/install_biowulf.sh @@ -1,18 +1,23 @@ #!/usr/bin/env bash set -euxo pipefail - version=$1 -repo_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/cruise-dev/ +repo_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/dev/ install_path=/data/CCBR_Pipeliner/Pipelines/CRUISE/${version} bin_path=${install_path}/bin/ . "/data/CCBR_Pipeliner/db/PipeDB/Conda/etc/profile.d/conda.sh" conda activate py311 +# remove artifacts from prior builds +pushd ${repo_path} +rm -rf build/ *.egg-info +popd + echo "Installing CRUISE to ${install_path}" pip install ${repo_path} --target ${install_path} --upgrade chmod +x ${install_path}/cruise/bin/*.* +chmod -R a+r ${install_path} if [[ ":$PATH:" != *":${bin_path}:"* ]];then export PATH="${PATH}:${bin_path}" From ba4b0c98162b8d3c9b5c613baa4ce05ceede665b Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Thu, 2 Nov 2023 10:34:40 -0400 Subject: [PATCH 3/9] fix: make sure scripts are executable by all --- bin/install_biowulf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_biowulf.sh b/bin/install_biowulf.sh index b26685b..2bce347 100755 --- a/bin/install_biowulf.sh +++ b/bin/install_biowulf.sh @@ -16,7 +16,7 @@ popd echo "Installing CRUISE to ${install_path}" pip install ${repo_path} --target ${install_path} --upgrade -chmod +x ${install_path}/cruise/bin/*.* +chmod a+x ${install_path}/cruise/bin/*.* chmod -R a+r ${install_path} if [[ ":$PATH:" != *":${bin_path}:"* ]];then From b6f1585f59ca6c9a2c9d68789270859849db9af2 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 13:45:42 -0400 Subject: [PATCH 4/9] fix: don't create pycache files --- VERSION | 2 +- conf/biowulf.config | 5 ++--- nextflow.config | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 6e8bf73..c992723 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.1.1-dev diff --git a/conf/biowulf.config b/conf/biowulf.config index cd7a6ea..2f9fb5a 100644 --- a/conf/biowulf.config +++ b/conf/biowulf.config @@ -24,9 +24,8 @@ singularity { envWhitelist='https_proxy,http_proxy,ftp_proxy,DISPLAY,SLURM_JOBID,SINGULARITY_BINDPATH' } -env { - SINGULARITY_CACHEDIR = "/data/CCBR_Pipeliner/SIFS" -} +env.SINGULARITY_CACHEDIR = "/data/CCBR_Pipeliner/SIFS" + process.clusterOptions = ' --gres=lscratch:200 ' process.scratch = '/lscratch/$SLURM_JOBID' diff --git a/nextflow.config b/nextflow.config index ac29ce3..df4f12b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -84,6 +84,8 @@ env { R_PROFILE_USER = "/.Rprofile" R_ENVIRON_USER = "/.Renviron" JULIA_DEPOT_PATH = "/usr/local/share/julia" + // prevent python from creating pycache files + PYTHONDONTWRITEBYTECODE = 'true' } // Capture exit codes from upstream processes when piping From 19d02a47add7f44653b5eb30f1d0c82b1a650964 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 13:50:22 -0400 Subject: [PATCH 5/9] fix: chmod a+x is handled by installation script also, only try to change files, not directories --- src/util.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/util.py b/src/util.py index c4e7985..bacf7f2 100644 --- a/src/util.py +++ b/src/util.py @@ -99,11 +99,12 @@ def chmod_bins_exec(): bin_dir = nek_base("bin/") for filename in os.listdir(bin_dir): bin_path = os.path.join(bin_dir, filename) - file_stat = os.stat(bin_path) - # below is equivalent to `chmod +x` - os.chmod( - bin_path, file_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH - ) + if bin_path.is_file(follow_symlinks=False): + file_stat = os.stat(bin_path) + # below is equivalent to `chmod +x` + os.chmod( + bin_path, file_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH + ) class OrderedCommands(click.Group): @@ -153,8 +154,6 @@ def run_nextflow( ): """Run a Nextflow workflow""" nextflow_command = ["nextflow", "run", nextfile_path] - # make sure bins are executable for nextflow processes - chmod_bins_exec() hpc = get_hpc() if mode == "slurm" and not hpc: From be45bc9f16ee643ea2d63c65c935c138ea3d59bf Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 14:08:51 -0400 Subject: [PATCH 6/9] fix: syntax error for os.path.isfile() --- src/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.py b/src/util.py index bacf7f2..337671e 100644 --- a/src/util.py +++ b/src/util.py @@ -99,7 +99,7 @@ def chmod_bins_exec(): bin_dir = nek_base("bin/") for filename in os.listdir(bin_dir): bin_path = os.path.join(bin_dir, filename) - if bin_path.is_file(follow_symlinks=False): + if os.path.isfile(bin_path, follow_symlinks=False): file_stat = os.stat(bin_path) # below is equivalent to `chmod +x` os.chmod( From 89fcecb52e30cd57b0faf1a81761957fad05880a Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 14:12:49 -0400 Subject: [PATCH 7/9] fix(cli): os.path.isfile() doesn't accept named args --- src/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.py b/src/util.py index 337671e..0821e65 100644 --- a/src/util.py +++ b/src/util.py @@ -99,7 +99,7 @@ def chmod_bins_exec(): bin_dir = nek_base("bin/") for filename in os.listdir(bin_dir): bin_path = os.path.join(bin_dir, filename) - if os.path.isfile(bin_path, follow_symlinks=False): + if os.path.isfile(bin_path): file_stat = os.stat(bin_path) # below is equivalent to `chmod +x` os.chmod( From 35ed0942af717dd5720e11403913355f0d87a5f4 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 14:15:03 -0400 Subject: [PATCH 8/9] chore: make sure bins are readable --- bin/install_biowulf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_biowulf.sh b/bin/install_biowulf.sh index 2bce347..dc83746 100755 --- a/bin/install_biowulf.sh +++ b/bin/install_biowulf.sh @@ -16,7 +16,7 @@ popd echo "Installing CRUISE to ${install_path}" pip install ${repo_path} --target ${install_path} --upgrade -chmod a+x ${install_path}/cruise/bin/*.* +chmod a+rx ${install_path}/cruise/bin/*.* chmod -R a+r ${install_path} if [[ ":$PATH:" != *":${bin_path}:"* ]];then From 0407c5b770730f0e3d1c98cdf4229f10fbd768ca Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 3 Nov 2023 14:15:18 -0400 Subject: [PATCH 9/9] ci: make sure bins are executable on github --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32030e9..aeff185 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools pip install .[dev,test] + python -c 'from cruise.src.util import chmod_bins_exec; chmod_bins_exec()' - name: Test stub run run: | cd tests/