careless: build venv with uv instead of conda (anaconda.com blocked on Ra)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 10:51:44 +02:00
co-authored by Claude Fable 5
parent 0b8fc62557
commit c0410dfe2d
3 changed files with 20 additions and 22 deletions
+12 -9
View File
@@ -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_<version>` env with Python 3.12 (upstream supports >=3.9,<3.13),
and runs `pip install careless[cuda]==<version>` 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]==<version>` 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 <version>`.
login node: `modbuild build <version>` (modbuild/2.1.2).
+6 -11
View File
@@ -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}"
}
+2 -2
View File
@@ -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