├── bin ├── sacct ├── sbatch ├── squeue └── inner-slurm ├── .gitignore ├── .datalad ├── .gitattributes └── config ├── .gitattributes ├── .gitmodules ├── README.md ├── config_toybidsapp_demo.yaml └── Makefile /bin/sacct: -------------------------------------------------------------------------------- 1 | inner-slurm -------------------------------------------------------------------------------- /bin/sbatch: -------------------------------------------------------------------------------- 1 | inner-slurm -------------------------------------------------------------------------------- /bin/squeue: -------------------------------------------------------------------------------- 1 | inner-slurm -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | envs 2 | *_ria/ 3 | -------------------------------------------------------------------------------- /.datalad/.gitattributes: -------------------------------------------------------------------------------- 1 | config annex.largefiles=nothing 2 | -------------------------------------------------------------------------------- /.datalad/config: -------------------------------------------------------------------------------- 1 | [datalad "dataset"] 2 | id = 2ed0c05d-8d45-482d-9256-0e63bafd95b7 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * annex.backend=MD5E 2 | **/.git* annex.largefiles=nothing 3 | * annex.largefiles=((mimeencoding=binary)and(largerthan=0)) 4 | -------------------------------------------------------------------------------- /bin/inner-slurm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | #set -x 6 | cmd="${0##*/}" 7 | topd=$(readlink -f "$0" | xargs dirname | xargs dirname) 8 | 9 | # echo "Delegating inside: topd=$topd cmd=$cmd" 10 | 11 | podman exec -it --user $USER slurm "$cmd" "$@" 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "toybidsapp-container"] 2 | path = toybidsapp-container 3 | url = ./toybidsapp-container 4 | datalad-id = 47e38ba7-5ed2-4f28-8c82-2b339e898ffa 5 | [submodule "my_BABS_project/analysis"] 6 | path = my_BABS_project/analysis 7 | url = ./my_BABS_project/analysis 8 | datalad-id = 7fa821cf-678c-4f3f-b9e6-4aff77022a2b 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repo is being used to test the [BABS project](https://github.com/PennLINC/babs) by following the [example walkthrough](https://pennlinc-babs.readthedocs.io/en/stable/walkthrough.html) against a [slurm microcluster](https://github.com/giovtorres/docker-centos7-slurm). 2 | 3 | 4 | ``` 5 | conda create -n babs -p envs/conda-babs -y python=3.9.16 6 | conda activate $PWD/envs/conda-babs 7 | conda install -c conda-forge -y datalad-container 8 | pip install datalad-osf 9 | export PATH=$PWD/bin:$PATH 10 | ``` 11 | 12 | # TODO: YODA'ify https://pennlinc-babs.readthedocs.io/en/stable/walkthrough.html#step-1-get-prepared 13 | # -- singularity container is not added via datalad 14 | -------------------------------------------------------------------------------- /config_toybidsapp_demo.yaml: -------------------------------------------------------------------------------- 1 | # Arguments in `singularity run`: 2 | singularity_run: 3 | --no-zipped: "" 4 | --dummy: "2" 5 | -v: "" 6 | 7 | # Output foldername(s) to be zipped, and the BIDS App version to be included in the zip filename(s): 8 | zip_foldernames: 9 | toybidsapp: "0-0-7" 10 | 11 | # How much cluster resources it needs: 12 | cluster_resources: 13 | interpreting_shell: /bin/bash 14 | hard_memory_limit: 2G 15 | 16 | # Necessary commands to be run first: 17 | script_preamble: | 18 | . "/home/asmacdo/miniconda3/etc/profile.d/conda.sh" && \ 19 | conda activate babs 20 | 21 | # Where to run the jobs: 22 | job_compute_space: "/tmp" # our local temporary space 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # TODO: add reason why custom container here 2 | REGISTRY=docker.io 3 | HUBUSER=asmacdo 4 | REPO=centos7-slurm 5 | TAG=23.11.07 6 | 7 | FQDN_IMAGE=${REGISTRY}/${HUBUSER}/${REPO}:${TAG} 8 | 9 | # vanilla slurm, conda bound in 10 | run-slurm: 11 | podman run -it --rm \ 12 | -v /home/asmacdo/miniconda3/:/home/asmacdo/miniconda3/ \ 13 | -v $${PWD}:$${PWD} \ 14 | -e "UID=$$(id -u)" \ 15 | -e "GID=$$(id -g)" \ 16 | -e "USER=$$USER" \ 17 | -h slurmctl --cap-add sys_admin --privileged \ 18 | --name slurm \ 19 | ${FQDN_IMAGE} \ 20 | /bin/bash -c "groupadd --gid $$(id -u) $$USER && useradd --uid $$(id -u) --gid $$(id -u) $$USER && bash" 21 | --------------------------------------------------------------------------------