diff --git a/careless/README.md b/careless/README.md new file mode 100644 index 0000000..9901225 --- /dev/null +++ b/careless/README.md @@ -0,0 +1,24 @@ +# careless + +Scaling and merging of X-ray diffraction data with approximate Bayesian +inference (variational merging), built on TensorFlow. + +- Upstream: https://github.com/rs-station/careless +- License: MIT + +## How it is built + +The build installs a private miniconda into `$PREFIX/miniconda`, creates a +`careless_` env with Python 3.12 (upstream supports >=3.9,<3.13), +and runs `pip install careless[cuda]==` inside it. The `[cuda]` +extra pulls the NVIDIA libraries as pip wheels, so the same install works +on GPU and CPU-only Ra nodes. + +Loading the module puts the env's `bin/` on `PATH` (the `careless` command +is directly available, no `conda activate` needed) and sets `CARELESS_ENV` +to the conda env path. + +## Adding a new version + +Add the version under `versions:` in `files/config.yaml`, then on a Ra +login node: `./build `. diff --git a/careless/build b/careless/build new file mode 100755 index 0000000..8869288 --- /dev/null +++ b/careless/build @@ -0,0 +1,27 @@ +#!/usr/bin/env modbuild + +pbuild::prep() { + : +} + +pbuild::configure() { + # careless is pip-installed, but upstream recommends a fresh conda env + # (TensorFlow dependency conflicts), so install a private miniconda in PREFIX + mkdir -p "$PREFIX/miniconda" + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O "$PREFIX/miniconda/miniconda.sh" + bash "$PREFIX/miniconda/miniconda.sh" -b -u -p "$PREFIX/miniconda/" + "$PREFIX/miniconda/condabin/conda" create -y -n "careless_$V" python=3.12 +} + +pbuild::compile() { + : +} + +pbuild::install() { + source "$PREFIX/miniconda/etc/profile.d/conda.sh" + conda activate "careless_$V" + pip install --upgrade pip + # [cuda] extra ships the NVIDIA libs via pip wheels; works on CPU-only nodes too + pip install --no-cache-dir "careless[cuda]==${V_PKG}" + conda deactivate +} diff --git a/careless/files/config.yaml b/careless/files/config.yaml new file mode 100644 index 0000000..cfd5995 --- /dev/null +++ b/careless/files/config.yaml @@ -0,0 +1,11 @@ +--- +format: 1 +careless: + defaults: + group: MX + overlay: base + relstage: unstable + versions: + 0.5.4: + config: + relstage: unstable diff --git a/careless/modulefile b/careless/modulefile new file mode 100644 index 0000000..e2c2743 --- /dev/null +++ b/careless/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 + +module-whatis "careless - merging crystallography data with variational inference" +module-url "https://github.com/rs-station/careless" +module-license "MIT" +module-maintainer "MX Data " + +module-help " +careless: scaling and merging of X-ray diffraction data using +approximate Bayesian inference (TensorFlow). Installed with the +[cuda] extra, so it uses NVIDIA GPUs when available and falls +back to CPU otherwise. +" + +setenv CARELESS_ENV $PREFIX/miniconda/envs/careless_$V +prepend-path PATH $PREFIX/miniconda/envs/careless_$V/bin