Skip to content

feat: add VS Code / Codespaces dev containers (closes #843)#1071

Open
christianescamilla15-cell wants to merge 1 commit intobilby-dev:mainfrom
christianescamilla15-cell:feat/devcontainer
Open

feat: add VS Code / Codespaces dev containers (closes #843)#1071
christianescamilla15-cell wants to merge 1 commit intobilby-dev:mainfrom
christianescamilla15-cell:feat/devcontainer

Conversation

@christianescamilla15-cell
Copy link
Copy Markdown

Summary

Adds Dev Container configurations to bilby, enabling instant reproducible development environments via VS Code's Dev Containers extension or GitHub Codespaces.

Closes #843.

Why two containers?

As suggested in the issue, GW dependencies (lalsuite, gwpy, pyfftw) are heavy and require C libraries. Developers working on core bilby, samplers, or hyperparameter inference don't need them. Providing two configurations gives contributors a choice:

  • Core (default, fast): ~1-2 min build, no C libraries, no LALSuite
  • GW (full): heavier build due to LALSuite compilation, but complete

What's included

.devcontainer/devcontainer.json (default, core)

  • Python 3.12 base (mcr.microsoft.com/devcontainers/python:3.12)
  • Installs: requirements.txt + sampler_requirements.txt + optional_requirements.txt
  • `pip install -e .` on create
  • VS Code extensions: Python, Pylance, Ruff, Black, Jupyter, GitLens, autoDocstring
  • Pytest configured for the test/ directory

.devcontainer/gw/devcontainer.json (full GW)

Same as core, plus:

  • System libraries: libfftw3-dev, libgsl-dev, libhdf5-dev
  • Additionally installs gw_requirements.txt (lalsuite, gwpy, astropy, pyfftw, scikit-learn)
  • Host requirements: 4 CPUs / 8 GB RAM (LALSuite needs this)

.devcontainer/README.md

Documentation explaining:

  • When to use each container
  • How to use with VS Code locally
  • How to use with GitHub Codespaces
  • What's included in each

Test plan

  • devcontainer.json files validated against containers.dev schema
  • JSON syntax verified
  • Testing the actual containers requires running VS Code or Codespaces (reviewer can verify)

Usage

Once merged, contributors can:

  1. VS Code locally: F1 → Dev Containers: Reopen in Container → choose core or GW
  2. Codespaces: Click the green Code button → Codespaces → Create codespace

Both paths give a fully working bilby development environment in minutes without polluting the host system.

References

Adds two Dev Container configurations to the repository:

1. .devcontainer/devcontainer.json — Core container
   - Python 3.12 base image
   - Installs requirements.txt + sampler_requirements.txt + optional_requirements.txt
   - Suitable for core bilby work (non-GW)
   - Lightweight, fast to build

2. .devcontainer/gw/devcontainer.json — GW container
   - Same base but additionally installs gw_requirements.txt
   - Installs C deps (libfftw3, libgsl, libhdf5) needed for LALSuite
   - Requires 4 CPUs / 8 GB RAM
   - For bilby.gw development

Both containers include:
- Git and GitHub CLI features
- VS Code extensions: Python, Pylance, Ruff, Black, Jupyter, GitLens, autoDocstring
- Pytest configured for test/ directory

Documentation added in .devcontainer/README.md explaining usage for both
local VS Code and GitHub Codespaces workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add devcontainer file

1 participant