-
Notifications
You must be signed in to change notification settings - Fork 183
refactor(container): reduce layers and image size. Add .devcontainer.json
sample.
#192
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
This is not worthwhile since most of the image size comes from NVidia container. Using more layers improves caching to test locally and smaller layers help on bad networking conditions. |
dc32288
to
6598f9e
Compare
RUN curl -sSf -L -O https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/llvm7.0-static-7.0.1-7.el8.x86_64.rpm | ||
RUN dnf -y install ./*.rpm | ||
RUN ln -s /usr/bin/llvm-config-7-64 /usr/bin/llvm-config | ||
RUN curl -sSf -L -O https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/l/libffi3.1-3.1-36.el9.x86_64.rpm && \ |
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.
Merging curl RUNs are fine since I think no many people would like to modify it.
I'm not able to build the ubuntu24 in main unless unless I add
I'm not sure if its docker desktop thing, but I'd figure if I needed to make that change, might as well combine a few others for good measure. Image sizes goes down from 15gb to 13.2, about 12%. Not a lot, but not a little. I was mostly thinking of these for CI then as a full dev setup. I have a devcontainer.json in my workspace that uses the image with a few other changes to include git, rust-analyzer component and vscode extension, and run args to enable the GPU. I can include that here if that would balance out your DX aspect. |
Emm ... yeah, seems that we have to do apt update maybe because of the tzdata has some security updates. For 12% size change I'm ok with that. The comments would need to live before the RUN commands. |
For devcontainer, yeah, I think we can add that. Do you think we should just provide a sample .devcontainer.json or ask developers to use ours? |
Just a sample they can start with. I'll prefix the file as such and add .devcontainer folder to gitignore. Users can rename that or copy to their .devcontainer. |
6598f9e
to
2704ac3
Compare
"dockerfile": "${localWorkspaceFolder}/container/ubuntu24-cuda12/Dockerfile", | ||
"context": "${localWorkspaceFolder}" | ||
}, | ||
"runArgs": ["--runtime=nvidia", "--gpus", "all"], |
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.
To enable OptiX on Linux desktop distributions with graphics cards, we would need to enable extra capabilities. Maybe we can just use all?
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.
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.
Based on the reference, we would need to set the environment variable:
NVIDIA_DRIVER_CAPABILITIES=all
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.
Set using containerEnv
.
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.
I can't verify the optix examples run atm. A WSL setup is more convoluted, requiring having to copy over driver files.
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.
That's fine. I think we can start with it.
2704ac3
to
ac93537
Compare
- Combines the RUN commands to reduce image layers where possible. - Clean apt/dnf package cache and remove downloaded package files.
Includes a `.devcontainer.json` in the project root to allow users to start a development container in supported supported tools. Updated README.md to include how to make customizations. In vscode at least, the presesne of both `.devcontainer.json` and `.devcontainer/devcontainer.json` brings up a selection menu to choose which to use.
ac93537
to
ecfed9d
Compare
Now that the images are public, I switched to using the ghcr.io image in |
LGTM. Would you like to change the title and description before merging? |
.devcontainer.json
sample.
rust-toolchain.toml
when installing rust..devcontainer.json
, configured with our ubuntu24 image, with NVidia gpus and capabilities set, and includes git. Users can copy this to.devcontainer/devcontainer.json
to make additional changes.