✨ Add .devcontainer Configuration for TorchServe Development Environment#3346
✨ Add .devcontainer Configuration for TorchServe Development Environment#3346yhna940 wants to merge 5 commits intopytorch:masterfrom
.devcontainer Configuration for TorchServe Development Environment#3346Conversation
|
Hi @yhna940 thanks for the contribution! Could you add the same description you added to the PR to serve/docker/README.md and also add a line referring to that section into serve/CONTRIBUTING.md? |
Hi @mreso , thank you for the review! I have updated the files as requested. Please let me know if there are any additional changes needed :) |
|
Hello @mreso, I hope you're doing well! I wanted to follow up on the status of this PR. Are there any additional changes or updates you'd like me to make? Please let me know if there's anything else I can do to help move this forward. Thank you for your time and feedback! 😊 |
Description
This PR introduces a
.devcontainer/devcontainer.jsonconfiguration for setting up a Docker-based development environment in VS Code, specifically for TorchServe. Many libraries, such as Accelerate and PyTorch, support similar Dev Container environments, allowing for streamlined development with a consistent toolchain across contributors and platforms.Type of change
Please delete options that are not relevant.
Feature/Issue validation/testing
Visual Studio Code Dev Containers
The Dev Containers extension in VS Code allows developers to use a Docker container as a fully-featured development environment. This provides a reproducible, isolated setup that can mirror production configurations, enabling:
Once initialized, VS Code operates as if all tools and files were local, ensuring a seamless workflow.
In Visual Studio Code, search for "Dev Containers" in the Extensions marketplace and install it.
After installation, you will see a pop-up similar to the one in the screenshot. Click the "Reopen in Container" button to start the development environment inside a Docker container.
If you want to customize the development environment further, modify the appropriate fields in
.devcontainer/devcontainer.json. For example, to use a GPU-based container, you can adjust the configuration as shown below:{ "name": "TorchServe Dev Environment", "build": { "dockerfile": "../docker/Dockerfile", "context": "..", "args": { "BASE_IMAGE": "nvidia/cuda:12.1.1-base-ubuntu20.04", "PYTHON_VERSION": "3.9", "BRANCH_NAME": "master", "REPO_URL": "https://github.com/pytorch/serve.git", "CUDA_VERSION": "cu121" } }, "customizations": { "vscode": { "extensions": [ "ms-python.python" ] } }, "runArgs": [ "--gpus", "all", "--ipc", "host" ] }With this setup, you can run a GPU-enabled TorchServe container for accelerated model serving.
Checklist: