Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "MTUQ Development",
"dockerComposeFile": "../docker-compose.yml",
"service": "dev",
"workspaceFolder": "/workspace",

// Configure tool-specific properties
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.flake8",
"ms-toolsai.jupyter",
"ms-vscode.vscode-json"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"editor.formatOnSave": true,
"files.eol": "\n"
}
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally
// "forwardPorts": [8000, 8888],

// Use 'postCreateCommand' to run commands after the container is created
"postCreateCommand": "pip install -e .",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root
"remoteUser": "developer"
}

65 changes: 65 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
env/
ENV/
.venv

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Git
.git/
.gitignore

# Documentation builds
docs/_build/
docs/build/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# Jupyter
.ipynb_checkpoints/
*.ipynb

# OS
.DS_Store
Thumbs.db

# Docker
Dockerfile
docker-compose.yml
.dockerignore

# Data files (optional - comment out if you want to include data)
# data/

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tmp*
*.eps
*.png
*.ps
*.nc
*_solution.json

build/
__pycache__/
Expand Down
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Development Dockerfile for mtuq
FROM python:3.11-slim

# Set working directory
WORKDIR /workspace

# Install system dependencies including OpenMPI for parallel execution
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
g++ \
gfortran \
libnetcdf-dev \
libhdf5-dev \
pkg-config \
git \
vim \
curl \
openmpi-bin \
libopenmpi-dev \
&& rm -rf /var/lib/apt/lists/*

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
OMPI_MCA_btl_vader_single_copy_mechanism=none

# Copy the full source to install dependencies from pyproject.toml
COPY . /workspace

# Install Python dependencies from pyproject.toml (single source of truth)
# Use [dev] extras to include development dependencies like mpi4py
RUN pip install --upgrade pip setuptools wheel && \
pip install -e ".[dev]"

# Create a non-root user for development
RUN useradd -m -s /bin/bash developer && \
chown -R developer:developer /workspace

USER developer

# Default command
CMD ["/bin/bash"]

23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
dev:
build:
context: .
dockerfile: Dockerfile
container_name: mtuq-dev
volumes:
- .:/workspace
- mtuq-data:/workspace/data
working_dir: /workspace
stdin_open: true
tty: true
environment:
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
# Uncomment the following lines if you need to expose ports
# ports:
# - "8000:8000"
# - "8888:8888"

volumes:
mtuq-data:

Loading