-
Notifications
You must be signed in to change notification settings - Fork 10
maint: devcontainer #145
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: master
Are you sure you want to change the base?
maint: devcontainer #145
Conversation
pygobject>=3.51.0 depends on libgirepository-2.0-dev
Pycharm gets lost otherwise
|
I would like to bring @MarcusZuber to this. Can you guys post the steps to make this all work which I can just "play" on my machine? |
|
Assuming you have vscode and some kind of docker/podman setup already working (I know that's a large caveat), you can install the Dev Containers extension. Then when you open the tofu repo checked out to this branch in vscode it will prompt you to create the devcontainer automatically. After the container is built, it will relaunch vscode inside the container. X11/GPU forwarding are pre-configured, GPU requires an nvidia card with the nvidia-container-toolkit installed on the host. You may want to expose some data to test, you can add this to the end of the The https://code.visualstudio.com/docs/devcontainers/containers docs are quite good and include a tutorial and docker setup instructions for various operating systems. I hope that's helpful! |
|
Hi, @stuart-cls, thanks a lot of creating the PR. @tfarago @MarcusZuber I think with some common understanding of the potential use cases we can definitely convert this from draft to merge candidate. It adds to the convenience to developing on top of ufo-tofu without interfering with the core attributes of the software. So, even if you consider merging this added feature your old ways of using ufo-tofu will remain absolutely intact. Just some additional comments.
We can mount the directories for these repositories inside the container. If we make some changes in a feature branch in the repository we can build and test them inside the container without tampering with our local workstations. If things look as expected we push the branch and use that branch inside this dev container. Alternatively, I think we an also customize the Dockerfile in a way, that instead of cloning we mount the ufo-core and ufo-filter repositories from host system to this dev container and use it as one central development platform for all the repositories. Version control would be handled from host system.
Overall, I think it is a good feature to have. It introduces new ways to do things without interfering with the old. |
Dockerfile and .devcontainer config to simplify development and possibly deployment. If you open tofu git checkout in a IDE like VS Code/PyCharm, you get a working container development environment without any build difficulties.
I based the Dockerfile on ufo-kit/ufo-core, but it only targets Nvidia systems at the moment (and assumes you have the nvidia-container-toolkit installed on the host). However since UFO uses OpenCL this could likely be adapted to work on other systems.
One improvement I made was to split building the UFO image from the python image, and only copying build artifacts. This reduces the size of the final image and saves re-building UFO (which seems quite stable at the moment). This multi-build file enables building layers with just UFO, UFO+tofu, and a devcontainer: the
runtimebuild should be appropriate for production use.The
requirements-ufo.txt(and exisiting requirements files) could probably be rationalized with a modernpyproject.toml.See also https://github.com/sarkarchandan/ufo-docker/tree/master