A robust template that spins up a self-contained data science environment. It includes:
- Conda/Mamba for perfectly reproducible Python dependencies
- VS Code (code-server & Dev Containers) for full-featured development
- JupyterLab for quick prototyping
I originally built this template back in 2019 to solve a massive problem in highly regulated industries. When working with sensitive, highly regulated data, having multiple copies of that data scattered across dozens of different developer laptops poses an unacceptably large security risk.
By running our development environments inside secure, containerized instances (either locally with mounted secure volumes or remotely on Kubernetes), we ensured that the protected data remained in a secure, single location with no unnecessary duplication. It gave developers an ideal, fully-featured IDE experience without compromising data governance.
While the core philosophy remains completely relevant, the underlying technologies have been entirely modernized to meet current data science standards:
- Native Dev Containers: Instead of manually running
docker run, the project now features an interactive wizard (setup-devcontainer.sh). This dynamically generates a.devcontainerconfiguration, allowing you to open the environment natively in VS Code with a single click. - Mamba over Conda: Standard
condadependency resolution has been replaced withmamba(a C++ reimplementation). Why? It resolves complex Python environments in seconds instead of minutes, vastly speeding up Docker build times. - Modern Python Tooling (Ruff): Replaced older tools like Flake8 and Black with
ruff. Why? Ruff is written in Rust, acts as a drop-in replacement for dozens of tools, and is exceptionally fast. - Helm v3 Migration: The Kubernetes deployment scripts were upgraded to modern
apps/v1APIs and Helm 3 syntax. Why? Helm 2 and Kubernetesv1beta1APIs have been deprecated and removed, meaning the old setup would crash on any modern cluster. - Modernized Code-Server: Moved away from hardcoded 2019 tarballs to Coder's official installation script, ensuring the web-based IDE is secure, patched, and supports the latest VS Code extensions.
- Data Security: Keep your code and IDE adjacent to your data, rather than pulling your data down to your laptop.
- Zero "It Works on My Machine": Every developer gets the exact same OS, Python version, and dependency tree.
- Flexibility: Use it locally via VS Code Dev Containers, or deploy it to a remote Kubernetes cluster for heavy compute.
This is the recommended workflow for modern local development.
- Clone this repository down and rename the folder to your project name.
- Run the interactive setup wizard in your terminal:
./setup-devcontainer.sh
- The wizard will ask for your preferred Python version, formatters, and extra Conda packages. It will automatically generate your
environment.ymland.devcontainer/devcontainer.json. - Open the folder in VS Code. It will prompt you to "Reopen in Container". Click it, and VS Code will automatically build your Docker environment and connect to it!
If you prefer to run it manually via terminal (or are spinning it up on a remote VM):
# Build the image
docker build -t vscode .
# Run the container (mounting your local data and code directories)
docker run -p 8443:8443 -p 8888:8888 -v $(pwd)/data:/data -v $(pwd)/code:/code --rm -it vscode- VS Code will be running at
http://localhost:8443 - JupyterLab will be running at
http://localhost:8888
If you want to deploy the environment to a secure Kubernetes cluster:
docker build -t vscode .
./local-deploy.shThis uses Helm 3 to spin up JupyterLab and VS Code in your cluster. (To tear it down, simply run ./breakdown-local.sh).