A repository for our gathering on reproducibility on the 2nd of December 2025
- Install the uv python package manager
- Clone the repository
- Create a new branch locally
- Install the environment specified by
environment.ymlusinguv - Use uv to run
try_to_run_me_after_env_install.py - Try adding a new dependency to the project and also to the script
- Commit changes made to
pyproject.tomlanduv.lockfile to your branch - (Optional) Push your branch to this repository (only possible for menchelab members otherwise you can also try to fork and push to your own)
Once you managed to install the environment with uv you can try to create a container image containing the envrionment. To do so try the following
- Make sure you have Docker (or similar like Apptainer) installed
- Find suitable images of
uvand a linux distribution of your choice on a registry like docker hub - Use these images to generate a build script for a container (try following this or that guide to reduce the size of the resulting image)
- Run the container and try to execute
try_to_run_me_after_env_install.pyagain
The easiest way for me to do the following
git clone [email protected]:menchelab/gathering_reproducibility.git
cd gathering_reproducibility
uv init
# this is necessary to ensure correct python version
# because for me the default was the system wide which was not compatible with conda
uv python install 3.12
uv python pin 3.12
uv run try_to_run_me_after_env_install.pyOn my mac it was also necessary to add the commented out settings to the pyproject.toml in order to get the correct torch wheel
To build a docker image it is necessary get a linux distribution of your choice and then follow the instructions in the docs
The Dockerfile contains the final build script that worked for me on my mac with Docker Desktop with some explanatory comments. After building it via the docker cli
cd gathering_reproducibility
docker build .This builds an image that basically sets the global python to the one in the venv generated by uv which is akin to activate. On startup it fires up a bash shell so you can just run the image and then to python <your_script> to run anything with the packages in the venv. To run the container with the directory mounted you can use the following command
docker run -it -v <path_to_gathering_repo>:<absolute_path_to_directory_in_container> <image_hash>After starting up you can then just navigate to <absolute_path_to_directory_in_container> and use python try_to_run_me_after_env_install.py to run the script.
Here <path_to_gathering_repo> is the directory the repo resided on your computer and <absolute_path_to_directory_in_container> is the directory you want the repo to show up in your container session.
e.g. I used the following -v ~/gathering_reproducibility:/workdir (path has to be absolute after the colon) which allowed me to do the following after startup
cd workdir
python try_to_run_me_after_env_install.pyAlso please not that the image is quite large because the environment is also quite large. I tried to solve it with a multistage build but it did not result in a notable size reduction. Maybe there are more advanced techniques but I am too lazy to do more here :)