Skip to content

jessn-dev/Modern-Data-Science-Template

Repository files navigation

Modern Data Science Template

A robust template that spins up a self-contained data science environment. It includes:

  1. Conda/Mamba for perfectly reproducible Python dependencies
  2. VS Code (code-server & Dev Containers) for full-featured development
  3. JupyterLab for quick prototyping

📖 The History: Why was this built in 2019?

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.

🚀 The 2026 Modernization: What Changed & Why?

While the core philosophy remains completely relevant, the underlying technologies have been entirely modernized to meet current data science standards:

  1. Native Dev Containers: Instead of manually running docker run, the project now features an interactive wizard (setup-devcontainer.sh). This dynamically generates a .devcontainer configuration, allowing you to open the environment natively in VS Code with a single click.
  2. Mamba over Conda: Standard conda dependency resolution has been replaced with mamba (a C++ reimplementation). Why? It resolves complex Python environments in seconds instead of minutes, vastly speeding up Docker build times.
  3. 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.
  4. Helm v3 Migration: The Kubernetes deployment scripts were upgraded to modern apps/v1 APIs and Helm 3 syntax. Why? Helm 2 and Kubernetes v1beta1 APIs have been deprecated and removed, meaning the old setup would crash on any modern cluster.
  5. 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.

🌟 Benefits of Using This Template

  • 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.

🛠️ How to Use It

Option 1: Local Development (VS Code Dev Containers)

This is the recommended workflow for modern local development.

  1. Clone this repository down and rename the folder to your project name.
  2. Run the interactive setup wizard in your terminal:
    ./setup-devcontainer.sh
  3. The wizard will ask for your preferred Python version, formatters, and extra Conda packages. It will automatically generate your environment.yml and .devcontainer/devcontainer.json.
  4. 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!

Option 2: Manual Docker Run (Legacy)

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

Option 3: Deploying to Kubernetes

If you want to deploy the environment to a secure Kubernetes cluster:

docker build -t vscode .
./local-deploy.sh

This uses Helm 3 to spin up JupyterLab and VS Code in your cluster. (To tear it down, simply run ./breakdown-local.sh).

About

A containerized data science template providing a secure, perfectly reproducible development environment with VS Code Dev Containers, JupyterLab, Mamba, and Kubernetes support.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors