Skip to content

Commit e18db75

Browse files
authored
Merge pull request #107 from jackapbutler/add-cluster-env-script
feat: add cluster conda environment script
2 parents e0670a2 + 377875c commit e18db75

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

scripts/CLUSTER.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Working with the Stability cluster
2+
3+
We currently run our large scale experiments on the Stability AI HPC cluster.
4+
This subdirectory features a few helpful scripts that can help you get up and
5+
running on the cluster.
6+
7+
1. [Install Miniconda](stability-cluster/miniconda_install.sh) -
8+
installs miniconda for your cluster environment.
9+
10+
2. [Create Environment](stability-cluster/env_creation.sh) -
11+
creates a basic conda environment for experiments.
12+
13+
- Creates a conda environment at the prefix `CONDA_ENV_PATH` path.
14+
> Using the positional argument passed into the script
15+
- Clones `chemnlp` into your personal cluster `USER` directory.
16+
- Installs the current revision of the `chemnlp` repository and
17+
dependencies that are in your personal directory into the conda environment.
18+
19+
```bash
20+
# for creating a personal environment
21+
source scripts/stability-cluster/env_creation.sh jack/ jack/
22+
23+
# for creating an experiment environment (usually called by another script)
24+
source scripts/stability-cluster/env_creation.sh experiments/my-experiment jack/
25+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/bash
2+
### This script creates a conda environment for chemnlp
3+
### The first arg ($1) is the prefix directory where the environment is saved
4+
### The second arg ($2) is the directory to use when building the environment
5+
6+
## Must already have miniconda installed!
7+
export CONDA_ENV_PATH=/fsx/proj-chemnlp/$1/conda/env/chemnlp-standard
8+
export PYTHON_VER=3.8
9+
10+
## ensure we can use activate syntax in slurm scripts
11+
CONDA_BASE=$(conda info --base)
12+
source $CONDA_BASE/etc/profile.d/conda.sh
13+
14+
# Create Python environment through conda
15+
conda create --force --prefix ${CONDA_ENV_PATH} python=${PYTHON_VER} -y
16+
conda activate ${CONDA_ENV_PATH}
17+
18+
# Python requirements
19+
## cd into your directory inside of proj-chemnlp
20+
cd /fsx/proj-chemnlp/$2
21+
22+
## clone + submodules (ok if exists)
23+
[ ! -d 'chemnlp' ] && git clone --recurse-submodules --remote-submodules [email protected]:OpenBioML/chemnlp.git
24+
25+
## install
26+
pip install chemnlp # our repo
27+
pip install -r chemnlp/gpt-neox/requirements/requirements.txt # base gpt-neox requirements
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/bash
2+
3+
cd ~
4+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
5+
bash Miniconda3-latest-Linux-x86_64.sh # Follow instructions, accept all conditions blindly

0 commit comments

Comments
 (0)