Skip to content

Release Candidate 0.2.0 - #22

Merged
c-vigo merged 62 commits into
mainfrom
dev
Jan 6, 2026
Merged

c-vigo merged 62 commits into
mainfrom
dev

Conversation

@c-vigo

@c-vigo c-vigo commented Jan 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR introduces Release 0.2.0 of the vigOS Development Environment, featuring major improvements in build automation, Python development workflow, container runtime support, and developer experience.

Key highlights:

  • Build automation migration: Replaced make with just for modern, maintainable build recipes
  • Python project template: Pre-configured Python project structure with pre-built virtual environment
  • Podman support: Full Podman compatibility with socket detection and comprehensive testing
  • Docker Compose reorganization: Improved override system with project.yaml and local.yaml separation
  • Documentation generation: Docs-as-code system with Jinja2 templates
  • License compliance: Pre-commit hook for dependency license checking
  • Enhanced testing: Improved test infrastructure with container cleanup and better error handling
  • One-line install script: Curl-based quick deployment for new projects

Related Issue(s)

Latest Additions (Jan 6, 2026)

One-Line Install Script (install.sh)

New curl-based deployment for quick project setup:

curl -sSf https://vig-os.github.io/devcontainer/install.sh | sh -s -- ~/Projects/my-project

Features:

  • Auto-detect podman/docker runtime (prefers podman)
  • Auto-derive project name from folder (sanitized: lowercase, underscores)
  • OS-specific installation instructions (macOS, Ubuntu, Fedora, Arch, Windows)
  • Runtime health check with troubleshooting advice
  • Flags: --force, --version, --name, --dry-run, --docker, --podman

Non-Interactive Mode for init-workspace.sh

  • Added --no-prompts flag for CI/automation use
  • SHORT_NAME environment variable support
  • ORG_NAME now defaults to "vigOS/devc"

New Test Suite

  • 19 tests for install.sh (8 unit + 11 integration)
  • Tests name sanitization, placeholder replacement, default ORG_NAME

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test updates

Testing

  • Tests pass locally (just test)
  • Image tests pass (just test-image)
  • Integration tests pass (just test-integration)
  • Registry tests pass (just test-registry)
  • Install script tests pass (19 tests)
  • Manual testing performed

Total: 84+ tests passing

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation accordingly
  • I have updated the CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Breaking Changes

  1. Build Automation: All make commands replaced with just
  2. Docker Compose Overrides: docker-compose.override.yml → project.yaml + local.yaml
  3. ORG_NAME: Now defaults to "vigOS/devc" instead of requiring user input

Release Proposal: v0.2.0

After approval:

just push version=0.2.0

gerchowl and others added 30 commits December 10, 2025 09:42
Before prompting for confirmation, the script now:
- Scans template files against existing workspace files
- Lists all files that would be overwritten with visual indicators
- Shows the total count of affected files
- Displays 'No existing files would be overwritten' if none found
Resolved conflicts in CHANGELOG.md and README.md by keeping dev content.
This commit enables container-in-container operations by adding Podman
socket support throughout the devcontainer stack, with comprehensive
test coverage to verify functionality.

## Changes Made:

### 1. Container Image Enhancements (Containerfile)
- Install Podman CLI for Docker-out-of-Docker (DooD) pattern
- Generate architecture-specific docker-compose.override.yml at build time
  * arm64 → macOS socket path (/run/user/501/podman/podman.sock)
  * amd64 → Linux socket path (/run/user/1000/podman/podman.sock)

### 2. Workspace Template Updates
- docker-compose.yml: Add CONTAINER_HOST/DOCKER_HOST env vars, SELinux config
- devcontainer.json: Add containerEnv, runArgs, postStartCommand for socket
- docker-compose.override.yml.example: Comprehensive guide with examples
- LICENSE: Use {{ORG_NAME}} placeholder for proper replacement

### 3. Cross-Platform Compatibility (init-workspace.sh)
- Add sed_inplace function for GNU/BSD sed compatibility
- Fix placeholder replacement to search for {{SHORT_NAME}}/{{ORG_NAME}}
- Prevents accidental replacement of literal strings

### 4. Test Infrastructure (tests/)
- Add TestPodmanSocketAccess class with 7 comprehensive tests:
  * Socket file mounting verification
  * Environment variable configuration
  * Podman daemon communication (version, info)
  * Image operations (pull, build)
  * Container operations (run)
- Update conftest.py fixture to merge with existing socket configuration
- Update GitHub CLI version to 2.83.2
- Add pytest import for test assertions

## Why These Changes:

The devcontainer project needed to support running itself within its own
devcontainer (self-hosting) and enable users to build container images
and run sidecar containers from within the devcontainer.

This requires mounting the host's Podman socket into the container,
which is platform-specific (macOS VM vs Linux native). The solution:
- Generates appropriate socket mounts at image build time based on target arch
- Provides comprehensive examples for users to customize
- Includes extensive test coverage to verify socket access works correctly

## Testing:
✅ All tests passing (82 passed, 1 skipped)
- 21 image tests (including new Podman CLI verification)
- 53 integration tests (including 7 new socket tests)
- 8 registry tests

Closes #8
This commit adds comprehensive documentation and tests for builder sidecar
workflows using Approach 1: direct command execution via podman exec.

## Changes Made:

### 1. Test Sidecar Image (tests/fixtures/)
- Created simple Alpine-based sidecar Containerfile
- Includes bash for complex build scripts
- Stays alive with 'sleep infinity' for exec commands
- Removed HTTP server (not needed for Approach 1)

### 2. Standalone Sidecar Test Fixtures (tests/conftest.py)
- sidecar_image: Session-scoped fixture to build image once
- devcontainer_with_sidecar: Function-scoped multi-container setup
- Separated from devcontainer_up to avoid breaking existing tests
- Gracefully skips if podman-compose has issues (not critical)

### 3. Sidecar Connectivity Tests (tests/test_integration.py)
- test_sidecar_starts_with_devcontainer: Verify sidecar launches
- test_exec_simple_command_in_sidecar: Basic podman exec
- test_exec_build_workflow_in_sidecar: Realistic build simulation
- test_sidecar_has_bash: Tool availability check
- All tests use Approach 1: podman exec (real workflow)
- Tests skip gracefully if setup fails (socket tests already prove capability)

## Approach 1: Direct Command Execution

Users trigger builds in sidecars via:
```bash
# From devcontainer terminal
podman exec rust-builder cargo build --release
podman exec go-builder go build -o app
```

This is the standard Docker-out-of-Docker (DooD) pattern using the Podman socket.

## Why Tests Skip (Expected):

podman-compose multi-container setups can be fragile in test environments.
Since socket tests already prove:
- ✅ podman exec works
- ✅ Container management works
- ✅ Image building works

The sidecar tests serve as documentation/examples even when skipped.

## Test Results:
✅ 82 tests passed, 5 skipped (sidecar tests optional)
- 21 image tests
- 53 integration tests (including 7 socket tests)
- 8 registry tests
- 5 sidecar tests (skipped if compose fails)
This commit adds a simple test script to the sidecar image to better
demonstrate the real-world usage pattern of executing scripts in sidecars.

## Changes:

- Added test-build.sh: Simple script that outputs verification messages
- Updated sidecar.Containerfile: Copy and make script executable
- Updated test_exec_simple_command_in_sidecar: Execute the script instead of echo

## Why This Matters:

Real sidecar workflows involve executing build scripts, not just commands:
```bash
# Real-world example
podman exec rust-builder /usr/local/bin/build-release.sh
podman exec go-builder ./scripts/build.sh
```

This test now demonstrates:
- Including scripts in sidecar images
- Executing those scripts via podman exec
- Verifying output/success
- The actual pattern users will follow

## Testing:
```bash
podman run --rm localhost/test-sidecar:latest test-build.sh
# Output:
# Hello from sidecar test script
# Sidecar is ready for build commands
# Communication verified!
```
This commit adds automatic authentication to GitHub Container Registry
(ghcr.io) during devcontainer post-create, using the GitHub token from
the user's gh CLI configuration.

## Changes:

- Updated post-create.sh to extract GitHub token and username from
  ~/.config/gh/hosts.yml (copied from .devcontainer/.conf/gh/)
- Automatically runs 'podman login ghcr.io' on container creation
- Enables immediate 'make push' without manual authentication
- Graceful fallback with helpful messages if config is missing

## Benefits:

Users can now:
1. Open devcontainer
2. Run 'make push' immediately (no manual login needed)
3. Push images to ghcr.io seamlessly

## Security:

The GitHub token is:
- Stored in .devcontainer/.conf/gh/hosts.yml (gitignored)
- Only accessible inside the devcontainer
- Same token used by gh CLI for GitHub operations

## Testing:

After opening the devcontainer, check login status:
```bash
podman login ghcr.io
# Should show: Login Succeeded!
```
This commit fixes a bug in copy-host-user-conf.sh that was creating
a nested .conf/gh/gh/ directory structure.

## Problem:

The script was copying the entire gh directory INTO .conf/gh/:
```bash
cp -r "$HOME/.config/gh" "$CONF_DIR/gh"
# Created: .conf/gh/gh/ ❌
```

This caused:
- Nested directories: .conf/gh/gh/config.yml
- Confusion about which files to use
- The nested structure propagated to container ~/.config/gh/gh/

## Fix:

Changed to copy only the contents:
```bash
mkdir -p "$CONF_DIR/gh"
cp -r "$HOME/.config/gh"/* "$CONF_DIR/gh/" 2>/dev/null || true
# Creates: .conf/gh/config.yml ✅
```

## Cleanup:

Also removed the existing nested gh/ directory from .conf/gh/

## Result:

Correct structure:
```
.devcontainer/.conf/gh/
├── config.yml
├── hosts.yml
└── config.yml.backup
```
Add pexpect, pytest, pyyaml, and testinfra to main dependencies to support
running integration tests from within the devcontainer itself.
- Updated Makefile to support a NO_CACHE option for the build target.
- Modified build.sh to handle the --no-cache flag, allowing builds without cache for improved control over the build process.
- Bumped GitHub CLI version from 2.83.1 to 2.83.2
- Bumped ruff version from 0.14.8 to 0.14.9
BREAKING CHANGE: Docker Compose override system reorganized

- Replace docker-compose.override.yml with two new files:
  - docker-compose.project.yaml: team/project config (git-tracked)
  - docker-compose.local.yaml: personal config (git-ignored)
- Both files preserved during init-workspace.sh --force upgrades
- Merge docker-compose.sidecar.yaml into docker-compose.yml

Socket Detection:
- Prioritize Podman over Docker Desktop on macOS and Linux
- Dynamic socket detection via initialize.sh writes to .env file
- Socket mount uses environment variable: ${CONTAINER_SOCKET_PATH:-/var/run/docker.sock}
- Remove :Z SELinux flag from socket mounts (incompatible with macOS)

Test Infrastructure:
- Add pre-flight check for lingering test containers
- Add pytest_sessionstart hook to detect stale containers
- Add PYTEST_AUTO_CLEANUP env var for automatic cleanup
- Add 'make clean-test-containers' target
- Fix socket detection during tests to match runtime behavior

Performance:
- Build-time manifest generation for placeholder replacement
- Significantly faster init-workspace.sh initialization
- Remove cross-platform sed handling (always runs in Linux)

Documentation:
- Update CHANGELOG.md with all breaking changes
- Add migration guide in README.md for v0.1 users
- Document preserved files in Quick Start
- Update test documentation for new compose files

Other:
- Remove deprecated 'version' field from compose files
- Update .gitignore for new compose file structure
- Fix test assertions for compose file reorganization
Add tests/tmp/ to .gitignore to prevent temporary test workspace
directories from being tracked in version control.
Make it more explicit in CHANGELOG that {{TAG}} placeholder
replacement logic was moved from runtime to container build-time
with manifest generation.
- Add pyproject.toml with dev and science optional dependencies
- Add standard project structure: src/, tests/, docs/
- Pre-build Python venv during container build for instant startup
- Auto-sync dependencies on container attach via uv sync
- Configure VS Code to use pre-built venv interpreter
- Add UV_PROJECT_ENVIRONMENT to docker-compose.yml
- Exclude .venv from workspace copy (used directly from image)
- Run container cleanup check once at start of make test
- Add PYTEST_SKIP_CONTAINER_CHECK to skip check within test phases
- Exclude .venv from placeholder test scan
- Update Python interpreter path expectation in tests
- Remove .devcontainer/SIDECAR-TESTING.md (obsolete)
- Remove .devcontainer/TESTING-FROM-DEVCONTAINER.md (obsolete)
Force-add docker-compose.local.yaml to git despite nested .gitignore.
The file needs to be in the template for docker-compose validation,
but should remain gitignored in user workspaces after init.

Fixes #19
- Add justfile with layered architecture (base, project, local)
- Add just installation to main devcontainer
- Add test sidecar justfile for build workflows
- Add generic sidecar passthrough mechanism
- Add documentation generation system (docs/generate.py)
- Fix clean.sh trailing slash handling for TEST_REGISTRY
- Fix justfile escaping for podman format strings using hex codes
- Update test_registry.py to use just positional parameters
- Add just migration to CHANGELOG unreleased section
- Update all make references to just in CONTRIBUTE.md
- Update command examples and recipe documentation
- Add scripts/requirements.yaml as single source of truth for dependencies
- Add scripts/init.sh for OS-sensitive dependency checking/installation
  - Supports macOS, Debian/Ubuntu, Fedora, Alpine
  - Interactive y/n confirmations for each missing dependency
  - --check mode for CI/verification only, --yes for auto-confirm
- Update docs/generate.py to read from requirements.yaml
- Auto-generate requirements table and install commands in docs
- Add pre-commit hook to regenerate docs when templates change
- Add 'just docs' and 'just init' recipes
- Add jinja2 dependency for template rendering
- Remove checkmake hook (replaced make with just)
- Add promptexecution.justlang-lsp VS Code extension to devcontainer.json
- Replace checkmake hook with just fmt in workspace pre-commit config
c-vigo and others added 10 commits December 16, 2025 17:27
- Deleted the entire .devcontainer directory, including configuration files, scripts, and example files.
- Updated justfile imports to reference local files directly instead of from the .devcontainer directory.
- This change simplifies the project structure and removes unnecessary complexity related to the devcontainer setup.
…t processes

- Removed the deprecated Makefile for build and test commands.
- Updated all relevant scripts and documentation to reflect the new command structure using `just`.
- Ensured that all test commands and workflows are now compatible with the justfile format, enhancing simplicity and maintainability.
- Added functionality to remove manifest lists before images to handle multi-arch scenarios.
- Implemented checks for arch-specific tags (amd64, arm64) during cleanup.
- Enhanced final verification to ensure all related images and manifests are removed, improving reliability of the cleanup process.
- Updated tests to verify the removal of both arch-less and arch-specific images after cleanup.
- Introduced a new settings.json file for VSCode to configure Python development environment.
- Replaces old attempt to use a devcontainer in this project.
- Set default interpreter path to the virtual environment.
- Enabled automatic formatting on save using the Ruff formatter.
- Configured file exclusions for Python cache and compiled files to streamline the workspace.
- Updated the justfile to allow dynamic repository selection via TEST_REGISTRY environment variable, enhancing flexibility for test scenarios.
- Modified the cleanup script to handle arch-less and arch-specific images more robustly, ensuring proper removal of images and manifests.
- Improved test cases to verify the existence of images post-cleanup, ensuring reliability in the image management process.
- Modified documentation in CONTRIBUTING.md and related templates to reflect the use of Semantic Versioning (MAJOR.MINOR.PATCH) for versioning.
- Updated example commands and version references throughout the documentation to include the full semantic version format (e.g., 1.0.0 instead of 1.0).
- Adjusted testing scripts and README updates to align with the new versioning format, ensuring consistency across the project.
- Updated uv to version 0.9.21, pre_commit to 4.5.1, and ruff to 0.14.10 to ensure compatibility with the latest features and fixes.
- Introduced Semantic Versioning (X.Y.Z format) for releases, maintaining backwards compatibility for the previous version.
- Documented changes in the CHANGELOG to reflect these updates and other significant modifications.
@c-vigo c-vigo added this to the 0.2 milestone Jan 5, 2026
@c-vigo
c-vigo requested a review from gerchowl January 5, 2026 11:01
@c-vigo c-vigo self-assigned this Jan 5, 2026
- Auto-detect podman/docker runtime (prefers podman)
- Auto-derive project name from folder (sanitized: lowercase, underscores)
- OS-specific installation instructions (macOS, Ubuntu, Fedora, Arch, Windows)
- Runtime health check with troubleshooting advice
- Flags: --force, --version, --name, --dry-run, --docker, --podman, --skip-pull
- Support SHORT_NAME env var (required with --no-prompts)
- Support ORG_NAME env var (defaults to 'vigOS/devc')
- Escape special characters in placeholder values for sed
- Skip interactive prompts and confirmations in non-interactive mode
- Maintains full backward compatibility with interactive mode
- Unit tests for script flags and options (--help, --dry-run, --name, etc.)
- Integration tests for full deployment workflow
- Tests name sanitization, placeholder replacement, default ORG_NAME
- Add auto-generated preamble comment
- Document all install.sh flags (--dry-run, --docker, --podman)
- Add note about OS-specific installation instructions
- Move manual setup to collapsible section
- Simplify pexpect pattern for org name prompt (more flexible matching)
- Update expected tool versions: uv 0.9.22, pre-commit 4.5.1, ruff 0.14.10
- Add just 1.40.0 to expected versions
- Implement version-check.sh with DRY & SOLID design principles
- Check GitHub API for new releases, notify users of available updates
- Silent mode with graceful failure (network errors don't disrupt workflow)
- Configurable check interval (default 24h) with spam prevention
- Mute notifications for duration: just check 7d|1w|12h|30m
- Enable/disable: just check on|off
- One-command update: just update (downloads install script with --force)
- Config stored in .devcontainer/.local/ (gitignored, machine-specific)
- Auto-runs on just default command via _check-update in justfile.base
- Comprehensive test suite with 24 tests (23 pass, 1 skip for old workspaces)
- Clean notification format without box-drawing alignment issues
- Update command prompts for confirmation and preserves custom configs

Files changed:
- assets/workspace/.devcontainer/scripts/version-check.sh (new, 479 lines)
- assets/workspace/.devcontainer/justfile.base (add check/update recipes, default recipe)
- assets/workspace/.devcontainer/.gitignore (add .local/ directory)
- assets/workspace/justfile.project (keep simple default without forced check)
- tests/test_version_check.py (new, comprehensive test suite)
- CHANGELOG.md (document new feature)

@gerchowl gerchowl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passing (84+ tests). Ready for final review.

@gerchowl

gerchowl commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

@c-vigo Ready for your review!

Latest additions:

All 84+ tests passing. PR description updated with full details.

@c-vigo

c-vigo commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

@gerchowl I modified init.sh to run on my Ubuntu, check that it still runs on macOS

@c-vigo

c-vigo commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

How is this supposed to work?

carlosvigo@vigolaptop:~$ curl -sSf https://vig-os.github.io/devcontainer/install.sh | sh -s -- /tmp/my-project
curl: (22) The requested URL returned error: 404

We will release that script through GitHub packages or pages? Or point towards the latest stable version of the file, e.g. https://github.com/vig-os/devcontainer/blob/main/install.sh (which will only exist after this PR is merged)?

@gerchowl

gerchowl commented Jan 6, 2026 •

Copy link
Copy Markdown
Contributor

@c-vigo Good catch! The URL https://vig-os.github.io/devcontainer/install.sh requires GitHub Pages to be set up, which doesn't exist yet.

Options:

  1. Raw GitHub URL (works after merge to main):

    curl -sSf https://raw.githubusercontent.com/vig-os/devcontainer/main/install.sh | sh
  2. Set up GitHub Pages (requires repo admin) - host the script at the prettier URL

  3. GitHub Releases - attach install.sh to each release

Recommendation: Use the raw GitHub URL for now - it's simpler and works immediately after merge. I'll update the README to use:

curl -sSf https://raw.githubusercontent.com/vig-os/devcontainer/main/install.sh | sh

Also note: The install script requires the new image with --no-prompts support in init-workspace.sh. Until we push v0.2.0, the remote latest image has the old script that requires -it (interactive terminal). After just push version=0.2.0, it will work.

@gerchowl

gerchowl commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Also confirmed: all tests pass on my end with the new init.sh changes on macOS. ✅

@c-vigo
c-vigo merged commit ec027aa into main Jan 6, 2026

@gerchowl gerchowl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c-vigo readme is generated from /docs/readme.md.j2 and there are more than one lines using the githubpages install.sh link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment