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 ## How it is built
The build installs a private miniconda into `$PREFIX/miniconda`, creates a Upstream recommends a fresh conda env, but repo.anaconda.com is not
`careless_<version>` env with Python 3.12 (upstream supports >=3.9,<3.13), reachable from Ra, so the build uses uv instead: it fetches a standalone
and runs `pip install careless[cuda]==<version>` inside it. The `[cuda]` Python 3.12 into `$PREFIX/python` (upstream supports >=3.9,<3.13), creates
extra pulls the NVIDIA libraries as pip wheels, so the same install works `$PREFIX/venv`, and runs `uv pip install careless[cuda]==<version>` into
on GPU and CPU-only Ra nodes. 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 `uv` must be on PATH on the build host (e.g. `pip install --user uv`).
is directly available, no `conda activate` needed) and sets `CARELESS_ENV`
to the conda env path. 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 ## Adding a new version
Add the version under `versions:` in `files/config.yaml`, then on a Ra 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() { pbuild::configure() {
# careless is pip-installed, but upstream recommends a fresh conda env # repo.anaconda.com is unreachable from Ra (GnuTLS error), so no conda.
# (TensorFlow dependency conflicts), so install a private miniconda in PREFIX # uv fetches a standalone CPython instead; keep it inside PREFIX so the
mkdir -p "$PREFIX/miniconda" # venv's interpreter symlinks don't depend on the builder's home cache.
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O "$PREFIX/miniconda/miniconda.sh" export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
bash "$PREFIX/miniconda/miniconda.sh" -b -u -p "$PREFIX/miniconda/" uv venv --python 3.12 "$PREFIX/venv"
"$PREFIX/miniconda/condabin/conda" create -y -n "careless_$V" python=3.12
} }
pbuild::compile() { pbuild::compile() {
@@ -18,10 +17,6 @@ pbuild::compile() {
} }
pbuild::install() { 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 # [cuda] extra ships the NVIDIA libs via pip wheels; works on CPU-only nodes too
pip install --no-cache-dir "careless[cuda]==${V_PKG}" uv pip install --python "$PREFIX/venv/bin/python" "careless[cuda]==${V_PKG}"
conda deactivate
} }
+2 -2
View File
@@ -12,5 +12,5 @@ approximate Bayesian inference (TensorFlow). Installed with the
back to CPU otherwise. back to CPU otherwise.
" "
setenv CARELESS_ENV $PREFIX/miniconda/envs/careless_$V setenv CARELESS_ENV $PREFIX/venv
prepend-path PATH $PREFIX/miniconda/envs/careless_$V/bin prepend-path PATH $PREFIX/venv/bin