Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/Add-Packages-Complex-Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export CPLUS_INCLUDE_PATH="$(python -c "import galsim, os; print(os.path.join(os
python3 -m pip install --user --no-build-isolation .
```

## Persist for Jupyter
## NERSC Jupyter

To use this new installation of BATSim in jupyter.nersc.gov, add this to `$HOME/.bashrc`:

Expand Down
60 changes: 60 additions & 0 deletions doc/Installing-Your-Own-Env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Installing your own copy of desc-python

Using [conda-lock](https://github.com/conda/conda-lock) you can quickly and easily install your own copy of most DESC conda environments where lock files are available.

## At NERSC

`conda-lock` is available for all DESC members at NERSC, just add `$CFS/lsst/utilities/bin`to your PATH

`export PATH=$CFS/lsst/utilities/bin:$PATH`

In this example we will install a copy of `desc-python`.

git clone https://github.com/LSSTDESC/desc-python.git`

To use the current production version of `desc-python`, let us assume $curBuildDir points to your desired installation directory

```bash
cp desc-python/conda/sitecustomize.py $curBuildDir
cp desc-python/conda/desc-py-lock.yml $curBuildDir
cp desc-python/conda/pip.config $curBuildDir
cd $curBuildDir

module unload python
module unload cray-libsci
module load cray-mpich-abi/8.1.30
export CONDA_PKGS_DIRS=$curBuildDir/pkgs

# use your own copy of Miniforge or you could use NERSC's python module
url="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
curl -LO "$url"

bash ./Miniforge3-Linux-x86_64.sh -b -p $curBuildDir/py
source $curBuildDir/py/etc/profile.d/conda.sh
conda activate base

export PIP_CONFIG_FILE=$curBuildDir/pip.config

conda-lock install --mamba -n my-desc-python $curBuildDir/desc-py-lock.yml

conda activate my-desc-python

conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library
cd ${CONDA_PREFIX}
source ${CONDA_PREFIX}/bin/cosmosis-configure
cosmosis-build-standard-library main
```

And that's it!

#### To use your my-desc-python environment

```bash
module unload python
module unload cray-libsci
module load cray-mpich-abi/8.1.30
source $curBuildDir/bin/activate
conda activate my-desc-python
```