-
Notifications
You must be signed in to change notification settings - Fork 32
🐳 Add Dockerfile and documentation for using Docker image #134
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
Conversation
Thank you, @tonyzamyatin, for your PR! Having a Dockerfile would indeed be useful. Here are a few comments that @alafage and I had:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #134 +/- ##
=======================================
Coverage 99.15% 99.16%
=======================================
Files 143 143
Lines 7136 7149 +13
Branches 910 912 +2
=======================================
+ Hits 7076 7089 +13
Misses 27 27
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thank you for the feedback! I originally structured the Dockerfile with a developer workflow in mind—where the package is installed from source to allow real-time modifications. This setup is useful for contributors working on a fork, as they can experiment and commit changes while ensuring updates apply immediately (I actually ran into this issue myself when I forgot to install in editable mode). In this case, installing That said, I completely agree that a lightweight Docker image for end users would be beneficial. Installing from PyPI would streamline the build and ensure stability. Why not do both? Two Dockerfiles—one for development (from source) and one for end users (from PyPI). I also agree that moving everything Docker-related into a |
I tried also moving the I have tested building the Dockerfile, pulling the Docker image from the registry, and spinning up the container through my cloud provider. I believe I cought all bugs now 🤠 |
Sorry, we had some issues with the |
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.
Thank you so much for the PR. I understand the need for a docker image for development purposes, and your scripts seem pretty neat. For now, I don't feel that we would need a production-ready dockerfile, but it may change if we get an issue on this point or if you think that it would be helpful for you.
I've got two small remarks:
- We will have to add the contents of docker.md to the new doc
- We might create a docker account to store the updated images that we could generate automatically with GitHub actions, I guess
You may want to switch to torchuncertainty[all] again if you think it makes it easier! I'll merge this tonight in dev.
I strongly recommend providing a ready-to-pull Docker image for developers and contributors, as it would significantly lower the entry barrier and accelerate adoption of the library. The library itself is already very well-structured, with neat CLI interfaces that make it easy to use and extend. Personally, it took me 2–3 days to set up a VM workflow for running experiments on remote accelerators, and I believe this Docker setup would save future contributors a lot of time. Given the effort I put into designing it, I'd love to see it leveraged to help others contribute more efficiently. btw, do you have any specific ideas or preferences for how the Docker workflow should be structured moving forward? I’d be happy to iterate on it if there's anything you'd like to see differently! |
Hi @tonyzamyatin, Sorry I wasn't clear, I of course see the interest of your dockerfile, which I will happily merge to the library, and I thank you again for your contribution. I was writing about a potential second dockerfile made only for production purposes, which would install TU directly from PyPI. We could discuss that in a second PR if you feel that it would be beneficial? In the end, do you want to rollback to installing all the dependencies instead of the necessary & dev ones only? |
No worries, just a little misunderstanding on my side. Thanks for clarifying ^^
|
This is the point: I'm not sure! I never use docker, and I'm completely unable to determine how useful it could be for potential users, given that TU is still mainly aimed at preparatory works.
For now, It is clear that |
Hi @o-laurent, After thinking about it more, I see the PyPI package as primarily for use in other projects, while the Dockerfile is for those cloning/forking the repo, which are likely users looking to experiment and contribute. The primary use case of the Docker image is to make it seamless to get the repo onto a VM and run experiments out-of-the-box without setup. We could create separate Docker images for running experiments vs. editing What do you think? |
I agree; we can merge as is, maybe with |
Just to have it in this PR as well: |
As long as one cannot push failing code it's fine by me. Then, if we find a way to automatically re-commit after fixing, why not? let's keep this for later. I let you push the installation of the pre-commits and then we can merge. |
They are already being installed as a part of
|
This is the installation of the package, I mean the actual setup of the hooks with pre-commit install |
Before merging I would like to hear your comment on this related issue @o-laurent. Thanks! 🤠 |
I don't get why the style check fails lol The pre-commmit hook didn't flag anything:
Neither did
|
This is due to @alafage not updating his ruff 😄 fixing is in progress |
Well, I can't test with the new code version without pushing, but we can proceed and merge! (and hope!) Thanks for your help, @tonyzamyatin! |
From the related issue:
Wait, I will make it part of the Dockerfile installation then, until motion blur is implemented in this repo! |
No, I don't think we need to bother with this; we'll implement motion blur quickly; it doesn't seem very complicated. |
I don't have a GPU, so I need to rent a cloud GPU for experiments. Setting up the environment each time is tedious and time-consuming, especially when you terminate the cloud VM after use to save costs. This is why I created this Dockerfile and a pre-built image to streamline the process. 🚀
This PR adds:
The repo authors should feel free to push the image to their organizational registry and update the docs on the pre-built image accordingly to pull from their own registry.