As an HPC facilitator I assist researchers with troubleshooting their code or optimizing their code. To keep my work organized I created this bash script that generates a directory structure to support my work for any new request I recieve.
Git needs to be installed. For helper scripts generated, they use LMOD module load commands.
Syntax: new_request.sh CLIENT TICKET DIR
Arguments:
CLIENT A client identifier (e.g. username).
TICKET Request identifier (e.g. ticket number).
DIR Location to create directory hierarchy (if blank defaults to pwd).
The bash script will create a new request directory using the CLIENT and TICKET arguments as unique identifiers. The directory will be initialized as a git repository. For example, running the example command below will create a directory "bob/123456" in the current working directory:
bash new_request.sh bob 123456
Initialized empty Git repository in /projectnb/dvm-rcs/client/bob/123456/.git/
The script will also generate a .gitignore
file with the following contents:
Lines 74 to 76 in a57c043
Additionally, two helper bash scripts will be generated in the env_setup
directory.
r_env.sh
- This bash scripts will load the specified module, create a directory to install packages, install packages that are required for VSCode, and generate an 'r_activate.sh' script for activating the environment (Load the appropriate module and setR_LIBS_USER
environment variable.).
Example Usage
source r_env.sh R/4.4.0
env_setup/py_virtenv.sh
- This is a helper bash script for creating a new python virtual environment or loading an existing one. The virtual environment created will be named after the python module specified.
Example Usage
source py_virtenv.sh python3/3.12.4
Below is the directory structure the bash script will create:
- data - Directory to store relevant data used by the client's scripts.
- env_setup - Directory to store scripts files associated with setting up the enviroment for the request at hand.
- scripts - Directory to store the client's scripts.
- output - Directory to store the output data generated by the client's scripts.