Skip to content

Conversation

@dkuegler
Copy link
Member

@dkuegler dkuegler commented Jan 19, 2026

This PR includes:

  • version bumps for all python packages
  • removes conda environment files entirely (fastsurfer now uses UV as the default/supported package manager in both documentation and docker image)
  • several updates to the docker build
    • UV instead of docker (significant simplification of the build)
    • update to Ubuntu 24.04 as base
    • update all major python packages
    • add xvfb-run dependencies in the runtime to support whippersnappy (for example for CC QC images)
    • add image metadata fields
    • adaptations to the build script
    • caching the freesurfer download instead of downloading each time is a massive speedup to the build time
    • fspython is a wrapper script instead of a softlink

Todo:

  • finish surface pipeline testing
  • currently there is an error where Freesurfer's rca-config (a python script) cannot import yaml but yaml is installed and available in the distributed python environment

Update pyproject dependencies.
Update docker build script.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes FastSurfer's build infrastructure and dependency management by migrating from conda to UV as the package manager and updating all Python packages.

Changes:

  • Complete migration from conda to UV for Python environment management
  • Removal of all conda-specific files and configuration
  • Docker build refactoring to use UV instead of conda, with Ubuntu 24.04 as base
  • Python version references updated from python3.10 to python3 throughout scripts
  • Addition of xvfb-run support for headless OpenGL rendering in corpus callosum QC
  • Package version updates in pyproject.toml including torch 2.7.*, torchvision 0.22.1, and new dependencies

Reviewed changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/build/link_fs.sh Convert string to array syntax, change error to warning
tools/build/install_fs_pruned.sh Remove login shell, add error handling for parallel execution, convert strings to arrays
tools/Docker/install_env.py File deleted - conda-specific environment installer
tools/Docker/build.py Update shebang, replace conda with venv references, add new build args, update version support
tools/Docker/entrypoint.sh Update comment from conda to venv
tools/Docker/conda_pack.sh File deleted - conda-specific packaging script
tools/Docker/Dockerfile Major refactor: UV instead of conda, Ubuntu 24.04, new build stages, add xvfb dependencies
tools/Docker/README.md Update documentation for UV, new version numbers
run_fastsurfer.sh Update python reference, add xvfb-run support for OpenGL
recon_surf scripts Update python version references
pyproject.toml Update dependencies, add Python 3.13 support, pin torch/torchvision versions
env/*.yml Conda environment files deleted
doc/overview/*.md Update documentation from conda to UV
Tutorial files Update from conda to UV instructions
FastSurferCNN/version.py Minor formatting changes, update git status flags
FastSurferCNN/utils/checkpoint.py Improved error handling for checkpoint downloads
FastSurferCNN/data_loader/conform.py Fix type annotation
CorpusCallosum/shape/mesh.py Improve OpenGL/whippersnappy error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +300 to +307
# Fix for cuda11.8+cudnn8.7 bug+warning: https://github.com/pytorch/pytorch/issues/97041
if [[ "$DEVICE" == "cu118" ]]
then
torch_lib_path=/venv/python${PYTHON_VERSION}/site-packages/torch/lib
ln -s ${torch_lib_path}/libnvrtc-*.so.11.2 ${torch_lib_path}/libnvrtc.so
fi
source /venv/bin/activate
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The torch library path uses a hardcoded python version directory structure that may not match the actual directory name created by uv. The path /venv/python${PYTHON_VERSION}/site-packages/torch/lib assumes the directory is named exactly python${PYTHON_VERSION}, but uv may use a different naming convention (e.g., lib/python3.12/site-packages). This could cause the symlink creation to fail.

Suggested change
# Fix for cuda11.8+cudnn8.7 bug+warning: https://github.com/pytorch/pytorch/issues/97041
if [[ "$DEVICE" == "cu118" ]]
then
torch_lib_path=/venv/python${PYTHON_VERSION}/site-packages/torch/lib
ln -s ${torch_lib_path}/libnvrtc-*.so.11.2 ${torch_lib_path}/libnvrtc.so
fi
source /venv/bin/activate
source /venv/bin/activate
# Fix for cuda11.8+cudnn8.7 bug+warning: https://github.com/pytorch/pytorch/issues/97041
if [[ "$DEVICE" == "cu118" ]]
then
torch_lib_path=$(python -c 'import os, torch; print(os.path.join(os.path.dirname(torch.__file__), "lib"))')
ln -s ${torch_lib_path}/libnvrtc-*.so.11.2 ${torch_lib_path}/libnvrtc.so
fi

Copilot uses AI. Check for mistakes.
install conda pack into a separate environment
add labels to the different images
pass values for the labels in the images through the build script
make sure linking fspython to /venv/bin/python works
Some formatting cleanup
Resolve upx bugs
change the virtual environment and python install command from conda to uv
Remove conda-related files, as our primary install mechanism is now uv (instead of conda, with the dependencies defined in pyproject).
Update version and build scripts to work with the new Dockerfile.
Add a check/error message if we are running headless and wrap the fastsurfer-cc call in xvfb-run.
@dkuegler dkuegler force-pushed the feature/version-bump branch 3 times, most recently from 1e02b3a to 37e500d Compare January 21, 2026 16:12
@dkuegler dkuegler force-pushed the feature/version-bump branch from 37e500d to d208b9e Compare January 21, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant