Files
superset2/.devcontainer/devcontainer.json
Maxime Beauchemin fd51cc65a2 feat: Add GitHub Codespaces support with docker-compose-light
## Summary

Adds full GitHub Codespaces development environment configuration leveraging the new `docker-compose-light.yml` for efficient cloud development.

## Key Features

- **Lightweight Setup**: Uses `docker-compose-light.yml` which removes Redis/nginx for faster startup and lower resource usage
- **Multi-Instance Support**: Each Codespace gets isolated database volumes, perfect for testing multiple branches
- **Auto-Configuration**: Includes VS Code extensions, Python/TypeScript settings, and auto-start script
- **Developer Friendly**: Comprehensive README with SSH, VS Code, and browser connection instructions

## Implementation Details

### Files Added
- `.devcontainer/devcontainer.json` - Main configuration with:
  - Docker-in-Docker support for compose
  - Optimized VS Code extensions for Superset development
  - Smart port forwarding (9001 for frontend, 8088 for API)
  - 4-core/8GB recommended resources

- `.devcontainer/start-superset.sh` - Auto-start script that:
  - Uses unique project names per Codespace
  - Handles Docker daemon startup
  - Shows clear status and credentials

- `.devcontainer/README.md` - Developer guide covering:
  - Multiple connection methods (SSH, VS Code, browser)
  - Port forwarding instructions
  - Cost optimization tips
  - Integration with `claude --yes` workflows

## Benefits

1. **Isolated Development**: No risk to local machine when using `claude --yes`
2. **Resource Efficiency**: Laptop stays cool, Codespaces handles the load
3. **Parallel Testing**: Spin up multiple instances for different features
4. **Quick Pause/Resume**: Auto-stops when idle, resumes in ~30 seconds

## Testing

Push to fork and create a Codespace to test. The environment auto-starts Superset and forwards port 9001 with HTTPS.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 11:19:55 -07:00

95 lines
2.7 KiB
JSON

{
"name": "Apache Superset Development",
"dockerComposeFile": [
"../docker-compose-light.yml"
],
"service": "superset-node-light",
"workspaceFolder": "/app",
// Use the light config for faster startup and lower resource usage
"shutdownAction": "stopCompose",
// Forward ports for development
"forwardPorts": [9001, 8088],
"portsAttributes": {
"9001": {
"label": "Superset Frontend",
"onAutoForward": "notify"
},
"8088": {
"label": "Superset Backend API",
"onAutoForward": "silent"
}
},
// VS Code extensions for Superset development
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"charliermarsh.ruff",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-tslint-plugin",
"eamodio.gitlens",
"github.copilot",
"ms-azuretools.vscode-docker"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
}
},
// Environment variables for development
"remoteEnv": {
"FLASK_ENV": "development",
"SUPERSET_ENV": "development",
"CYPRESS_CACHE_FOLDER": "/tmp/cypress_cache",
// Enable hot reloading
"FLASK_DEBUG": "1",
// For multiple instances, use different project names
"COMPOSE_PROJECT_NAME": "${localEnv:CODESPACE_NAME}"
},
// Run commands after container is created
"postCreateCommand": "chmod +x /app/.devcontainer/start-superset.sh && echo '🚀 Superset Codespace ready! Run: .devcontainer/start-superset.sh to start'",
// Auto-start Superset on Codespace resume
"postStartCommand": "cd /app && .devcontainer/start-superset.sh",
// Features to add to the dev container
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": "18"
}
},
// Memory and CPU (Codespaces will provision accordingly)
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
}
}