Skip to content

Commit

Permalink
Merge pull request #25 from CCBR/chmod-perms
Browse files Browse the repository at this point in the history
fix permissions issues on biowulf
  • Loading branch information
kelly-sovacool authored Nov 6, 2023
2 parents 34b797d + 0407c5b commit b6d9984
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1-dev
11 changes: 8 additions & 3 deletions bin/install_biowulf.sh
Original file line number Diff line number Diff line change
@@ -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 a+rx ${install_path}/cruise/bin/*.*
chmod -R a+r ${install_path}

if [[ ":$PATH:" != *":${bin_path}:"* ]];then
export PATH="${PATH}:${bin_path}"
Expand Down
5 changes: 2 additions & 3 deletions conf/biowulf.config
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 os.path.isfile(bin_path):
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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b6d9984

Please sign in to comment.