Skip to content

Commit 951a7ca

Browse files
authored
Merge pull request #174 from LSSTDESC/doc-april2026
add conda-lock instructions
2 parents 6d0314e + d1822e6 commit 951a7ca

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

doc/Add-Packages-Complex-Install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export CPLUS_INCLUDE_PATH="$(python -c "import galsim, os; print(os.path.join(os
5151
python3 -m pip install --user --no-build-isolation .
5252
```
5353

54-
## Persist for Jupyter
54+
## NERSC Jupyter
5555

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

doc/Installing-Your-Own-Env.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Installing your own copy of desc-python
2+
3+
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.
4+
5+
## At NERSC
6+
7+
`conda-lock` is available for all DESC members at NERSC, just add `$CFS/lsst/utilities/bin`to your PATH
8+
9+
`export PATH=$CFS/lsst/utilities/bin:$PATH`
10+
11+
In this example we will install a copy of `desc-python`.
12+
13+
git clone https://github.com/LSSTDESC/desc-python.git`
14+
15+
To use the current production version of `desc-python`, let us assume $curBuildDir points to your desired installation directory
16+
17+
```bash
18+
cp desc-python/conda/sitecustomize.py $curBuildDir
19+
cp desc-python/conda/desc-py-lock.yml $curBuildDir
20+
cp desc-python/conda/pip.config $curBuildDir
21+
cd $curBuildDir
22+
23+
module unload python
24+
module unload cray-libsci
25+
module load cray-mpich-abi/8.1.30
26+
export CONDA_PKGS_DIRS=$curBuildDir/pkgs
27+
28+
# use your own copy of Miniforge or you could use NERSC's python module
29+
url="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
30+
curl -LO "$url"
31+
32+
bash ./Miniforge3-Linux-x86_64.sh -b -p $curBuildDir/py
33+
source $curBuildDir/py/etc/profile.d/conda.sh
34+
conda activate base
35+
36+
export PIP_CONFIG_FILE=$curBuildDir/pip.config
37+
38+
conda-lock install --mamba -n my-desc-python $curBuildDir/desc-py-lock.yml
39+
40+
conda activate my-desc-python
41+
42+
conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library
43+
cd ${CONDA_PREFIX}
44+
source ${CONDA_PREFIX}/bin/cosmosis-configure
45+
cosmosis-build-standard-library main
46+
```
47+
48+
And that's it!
49+
50+
#### To use your my-desc-python environment
51+
52+
```bash
53+
module unload python
54+
module unload cray-libsci
55+
module load cray-mpich-abi/8.1.30
56+
source $curBuildDir/bin/activate
57+
conda activate my-desc-python
58+
```
59+
60+

0 commit comments

Comments
 (0)