Skip to content

feat(devcontainer): add supervisor feature - #69

Merged
VAIBHAVSING merged 4 commits into
mainfrom
feat/devcontainer-supervisor-feature
Nov 16, 2025
Merged

feat(devcontainer): add supervisor feature#69
VAIBHAVSING merged 4 commits into
mainfrom
feat/devcontainer-supervisor-feature

Conversation

@VAIBHAVSING

@VAIBHAVSING VAIBHAVSING commented Nov 14, 2025

Copy link
Copy Markdown
Owner

Summary

Add DevContainer feature for installing the Dev8 workspace supervisor binary with consistent GitHub release URLs that never change.

🎯 Key Innovation: Zero-Maintenance URLs

The supervisor binary is distributed via a constant release tag (supervisor-latest) that gets updated automatically on each merge to main:

Consistent URLs (Never Change!):

  • AMD64: https://github.com/VAIBHAVSING/Dev8.dev/releases/download/supervisor-latest/supervisor-linux-amd64
  • ARM64: https://github.com/VAIBHAVSING/Dev8.dev/releases/download/supervisor-latest/supervisor-linux-arm64

Why This Matters

  • No maintenance: DevContainer feature never needs URL updates
  • Always latest: URLs point to most recent build automatically
  • No authentication: Public release URLs work without tokens
  • Reliable: Fallback to source build if download fails
  • Simple: Clean, consistent URLs perfect for automation

What This Adds

1. DevContainer Feature

  • Feature definition for supervisor installation
  • Smart installation script with release URL downloads
  • Comprehensive documentation
  • Configurable version and install path

2. CI/CD Pipeline

GitHub Actions workflow (.github/workflows/build-supervisor.yml):

  • Builds on every push to main
  • Multi-architecture support (AMD64, ARM64)
  • Deletes and recreates supervisor-latest release
  • Uploads fresh binaries with checksums
  • URLs stay constant, content updates

3. Installation Methods

Method 1: Pre-built Binary (Primary)

  • Downloads from consistent release URL
  • No authentication required
  • Installation time: <10 seconds
  • Auto-verifies checksums

Method 2: Build from Source (Fallback)

  • Used if download fails
  • Auto-installs Go 1.22 if needed
  • Installation time: 2-3 minutes

Technical Implementation

Workflow Strategy

# On every merge to main:
1. Build binaries for AMD64 and ARM64
2. Run tests
3. Delete existing 'supervisor-latest' release
4. Create new 'supervisor-latest' release
5. Upload binaries (URLs unchanged)

Install Script Logic

1. Detect architecture (x86_64 → amd64, aarch64 → arm64)
2. Download from consistent URL
3. Verify checksum if available
4. Install to /usr/local/bin/supervisor
5. On failure: fallback to source build

Usage Example

{
  "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
  "features": {
    "ghcr.io/dev8-community/devcontainer-features/supervisor:1": {
      "version": "latest"
    }
  }
}

That's it! No tokens, no changing URLs, no maintenance needed.

Benefits

For DevContainer Features

  • Zero maintenance: URLs never change
  • No tokens: Public release URLs
  • Always current: Automatic updates
  • Fast install: <10 seconds
  • Reliable: Auto-fallback to source build

For CI/CD

  • Automatic: Triggers on code changes
  • Consistent: Same URLs every build
  • Multi-arch: AMD64 and ARM64
  • Tested: Runs tests before release
  • Clean: Deletes old release first

For Users

  • Simple: One consistent URL
  • Fast: Pre-built binaries
  • Reliable: Fallback available
  • Transparent: Clear download progress
  • Verified: Checksum validation

How It Works

┌─────────────────────────────────────────────┐
│  1. Code merged to main                     │
└────────────────┬────────────────────────────┘
                 │
┌────────────────▼────────────────────────────┐
│  2. GitHub Actions builds binaries          │
│     - Linux AMD64                           │
│     - Linux ARM64                           │
└────────────────┬────────────────────────────┘
                 │
┌────────────────▼────────────────────────────┐
│  3. Delete existing 'supervisor-latest'     │
│     release (if exists)                     │
└────────────────┬────────────────────────────┘
                 │
┌────────────────▼────────────────────────────┐
│  4. Create new 'supervisor-latest' release  │
│     - Upload supervisor-linux-amd64         │
│     - Upload supervisor-linux-arm64         │
│     - Upload checksums                      │
│     - URLs stay the same!                   │
└────────────────┬────────────────────────────┘
                 │
┌────────────────▼────────────────────────────┐
│  5. DevContainer feature downloads from     │
│     same URL, gets latest binary            │
└─────────────────────────────────────────────┘

Comparison: Before vs After

Before (Artifacts Approach)

  • ❌ URLs changed on every build
  • ❌ Required GitHub token for downloads
  • ❌ Needed API calls to find latest artifact
  • ❌ Complex authentication logic
  • ❌ 90-day expiration

After (Consistent Release Approach)

  • ✅ URLs never change
  • ✅ No authentication required
  • ✅ Direct download URL
  • ✅ Simple wget/curl download
  • ✅ Permanent availability

Testing

Test Locally

{
  "features": {
    "./packages/devcontainer-features/src/supervisor": {}
  }
}

After Merge to Main

The workflow will automatically:

  1. Build fresh binaries
  2. Update the supervisor-latest release
  3. Make them available at the consistent URLs

Files Changed

  • .github/workflows/build-supervisor.yml - CI/CD pipeline with consistent release
  • packages/devcontainer-features/src/supervisor/install.sh - Simple release URL downloader
  • packages/devcontainer-features/src/supervisor/README.md - Updated documentation
  • packages/devcontainer-features/src/supervisor/devcontainer-feature.json - Feature definition

Part of Stacked PRs

This is PR #1 in the DevContainer features stack:


Ready for merge! This establishes a maintenance-free binary distribution system for internal tools.

Summary by CodeRabbit

  • New Features
    • Introduced Dev8 Workspace Supervisor as a new DevContainer feature with configurable version and installation path options.
    • Supervisor provides workspace activity monitoring, automated backups to Azure Files, and health status reporting via HTTP API.
    • Supports pre-built binary installation with fallback to build-from-source capability.

Add DevContainer feature for installing Dev8 workspace supervisor.
The supervisor provides activity monitoring, automated backups,
and health reporting for workspaces.

- Install supervisor binary from source or GitHub releases
- Support configurable version and install path
- Include comprehensive README documentation
- Compatible with official Microsoft DevContainer images
@coderabbitai

coderabbitai Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces a comprehensive DevContainer feature for the Dev8 Workspace Supervisor—a Go-based binary for workspace activity monitoring and backups. It includes a GitHub Actions workflow for building and releasing supervisor binaries across platforms, an installation script with build-from-source fallback, feature documentation, and configuration files.

Changes

Cohort / File(s) Summary
CI/CD Workflow
\.github/workflows/build-supervisor\.yml
New GitHub Actions workflow that builds the Supervisor binary for linux/amd64 and linux/arm64 using Go 1.22, runs tests, generates checksums, creates releases, and publishes artifacts to GitHub Releases with embedded version metadata.
Git Configuration
\.gitignore
Added ignore rule for the supervisor binary and corrected a comment typo.
DevContainer Feature
packages/devcontainer-features/src/supervisor/README\.md
New documentation describing the Dev8 Workspace Supervisor feature, its capabilities (activity monitoring, backups, health reporting, HTTP API), installation methods, configuration via config.yaml, and binary distribution details.
DevContainer Manifest
packages/devcontainer-features/src/supervisor/devcontainer-feature\.json
New feature manifest defining the supervisor as a DevContainer feature with configurable version and installPath options, plus dependency on common-utils.
Installation Script
packages/devcontainer-features/src/supervisor/install\.sh
New bash script that detects platform, downloads pre-built binaries from GitHub Releases with SHA-256 verification, and falls back to building from source (including Go installation if needed) with comprehensive error handling.

Sequence Diagram

sequenceDiagram
    participant User as DevContainer User
    participant Script as install.sh
    participant Platform as OS/Arch Detection
    participant Download as GitHub Releases
    participant Source as Build from Source
    participant Install as /usr/local/bin
    
    User->>Script: Execute install.sh
    Script->>Platform: Detect OS & architecture
    Platform-->>Script: Platform identifier
    
    Script->>Download: Attempt download pre-built binary
    alt Download Succeeds
        Download-->>Script: Binary + checksum verification
        Script->>Install: Extract & move binary
        Install-->>Script: Installation complete
    else Download Fails
        Script->>Source: Check for Go
        alt Go Not Installed
            Source->>Source: Install Go 1.22.0
        end
        Source->>Source: Clone or locate source code
        Source->>Source: Build supervisor binary
        Source->>Install: Move compiled binary
        Install-->>Script: Installation complete
    end
    
    Script->>Script: Verify installation
    Script-->>User: Display version & completion details
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Shell script complexity: The install.sh requires careful review of platform detection logic, download/fallback decision tree, error handling, and permission/verification steps.
  • Workflow correctness: Matrix builds, artifact management, release asset generation, and version embedding in ldflags should be validated.
  • Cross-platform compatibility: Installation paths, binary naming, and checksum verification across linux/amd64 and linux/arm64.

Poem

🐰 A supervisor hops into place,
Watching workspaces with diligent grace,
Download or build—it knows the way,
Monitoring backups, reporting each day!
From source or GitHub, whichever you choose,
Dev8's workspace can never lose. 🔧✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/devcontainer-supervisor-feature

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b04523 and ff366a5.

📒 Files selected for processing (5)
  • .github/workflows/build-supervisor.yml (1 hunks)
  • .gitignore (1 hunks)
  • packages/devcontainer-features/src/supervisor/README.md (1 hunks)
  • packages/devcontainer-features/src/supervisor/devcontainer-feature.json (1 hunks)
  • packages/devcontainer-features/src/supervisor/install.sh (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add automated CI/CD pipeline to build supervisor binaries for
multiple platforms and store them as GitHub Actions artifacts.

Changes:
- Created .github/workflows/build-supervisor.yml workflow
  - Multi-arch support (Linux AMD64, ARM64)
  - Builds on push to main and PRs
  - Creates version manifest
  - 90-day artifact retention
  - Build summary output

- Updated supervisor install script to download from artifacts
  - Prefer pre-built binaries from GitHub Actions
  - Fallback to building from source if needed
  - Support for GITHUB_TOKEN authentication
  - Automatic architecture detection
  - Enhanced error handling

- Updated documentation
  - Installation methods explanation
  - Authentication requirements
  - Binary distribution details
  - Development workflow

Benefits:
- Fast installation (<10 seconds vs 2-3 minutes)
- No need to install Go in containers
- Consistent binary versions
- Private artifact storage (not exposed publicly)
- Multi-architecture support out of the box

The supervisor binary remains internal and is not published
as a public release, keeping it accessible only to team
members with repository access.
Replace workflow artifacts approach with consistent GitHub release tag
for zero-maintenance binary distribution.

Key Changes:
- Workflow now creates/updates 'supervisor-latest' release
- Release tag stays constant, only binary content updates
- Consistent download URLs that never change
- No authentication required for downloads
- Install script simplified to use direct release URLs
- Automatic fallback to source build if download fails

Benefits:
- **Zero maintenance**: URLs never need updating
- **Consistent URLs**: Perfect for DevContainer features
  - AMD64: .../supervisor-latest/supervisor-linux-amd64
  - ARM64: .../supervisor-latest/supervisor-linux-arm64
- **No tokens needed**: Public release URLs work without auth
- **Automatic updates**: Each merge to main updates the release
- **Reliable**: Fallback to source build if needed

Workflow Changes:
- Deletes existing 'supervisor-latest' release on each run
- Creates new release with same tag name
- Uploads fresh binaries with checksums
- URLs remain constant across all builds
- Only updates on push to main (not PRs)

Install Script Changes:
- Downloads from consistent release URL
- Verifies checksums when available
- Shows download progress
- Graceful fallback to source build
- No GitHub token required

This approach ensures the DevContainer feature install script
never needs updates - it always downloads the latest binary
from the same URL!
@VAIBHAVSING
VAIBHAVSING marked this pull request as ready for review November 16, 2025 18:49
@VAIBHAVSING
VAIBHAVSING merged commit 3100223 into main Nov 16, 2025
6 of 7 checks passed
@VAIBHAVSING
VAIBHAVSING deleted the feat/devcontainer-supervisor-feature branch November 16, 2025 18:50
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.

1 participant