-
Notifications
You must be signed in to change notification settings - Fork 144
bump python packages, use UV instead of conda, update docker build #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Update pyproject dependencies. Update docker build script.
c658130 to
d5dadad
Compare
There was a problem hiding this 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.10topython3throughout 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.
| # 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 |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
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.
| # 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 |
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.
…king it more flexible).
Add a check/error message if we are running headless and wrap the fastsurfer-cc call in xvfb-run.
1e02b3a to
37e500d
Compare
…ftlink so it uses the correct venv and search paths
37e500d to
d208b9e
Compare
This PR includes:
Todo:
currently there is an error where Freesurfer'srca-config(a python script) cannot importyamlbut yaml is installed and available in the distributed python environment