From c0410dfe2d168e91ad8fd44dd7caed87bf62e706 Mon Sep 17 00:00:00 2001 From: Dawn Date: Tue, 18 Aug 2026 10:51:44 +0200 Subject: [PATCH] careless: build venv with uv instead of conda (anaconda.com blocked on Ra) Co-Authored-By: Claude Fable 5 --- careless/README.md | 21 ++++++++++++--------- careless/build | 17 ++++++----------- careless/modulefile | 4 ++-- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/careless/README.md b/careless/README.md index 9901225..b2df471 100644 --- a/careless/README.md +++ b/careless/README.md @@ -8,17 +8,20 @@ inference (variational merging), built on TensorFlow. ## 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. +Upstream recommends a fresh conda env, but repo.anaconda.com is not +reachable from Ra, so the build uses uv instead: it fetches a standalone +Python 3.12 into `$PREFIX/python` (upstream supports >=3.9,<3.13), creates +`$PREFIX/venv`, and runs `uv pip install careless[cuda]==` into +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. +`uv` must be on PATH on the build host (e.g. `pip install --user uv`). + +Loading the module puts the venv's `bin/` on `PATH` (the `careless` +command is directly available, no activation needed) and sets +`CARELESS_ENV` to the venv path. ## Adding a new version Add the version under `versions:` in `files/config.yaml`, then on a Ra -login node: `./build `. +login node: `modbuild build ` (modbuild/2.1.2). diff --git a/careless/build b/careless/build index 8869288..95a9d6c 100755 --- a/careless/build +++ b/careless/build @@ -5,12 +5,11 @@ 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 + # repo.anaconda.com is unreachable from Ra (GnuTLS error), so no conda. + # uv fetches a standalone CPython instead; keep it inside PREFIX so the + # venv's interpreter symlinks don't depend on the builder's home cache. + export UV_PYTHON_INSTALL_DIR="$PREFIX/python" + uv venv --python 3.12 "$PREFIX/venv" } pbuild::compile() { @@ -18,10 +17,6 @@ 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 + uv pip install --python "$PREFIX/venv/bin/python" "careless[cuda]==${V_PKG}" } diff --git a/careless/modulefile b/careless/modulefile index e2c2743..54ec7d0 100644 --- a/careless/modulefile +++ b/careless/modulefile @@ -12,5 +12,5 @@ approximate Bayesian inference (TensorFlow). Installed with the back to CPU otherwise. " -setenv CARELESS_ENV $PREFIX/miniconda/envs/careless_$V -prepend-path PATH $PREFIX/miniconda/envs/careless_$V/bin +setenv CARELESS_ENV $PREFIX/venv +prepend-path PATH $PREFIX/venv/bin