Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1c198fc
Dockerized build
chrisgleissner Oct 15, 2025
3e2421f
Fixed syntax
chrisgleissner Oct 15, 2025
69614ab
Fixes to Dockerized build
chrisgleissner Oct 15, 2025
93509e3
Merge main branch into feature/dockerized-ubuntu-build
chrisgleissner Oct 15, 2025
e721e98
Fix GitHub Actions startup failure by removing Docker container depen…
chrisgleissner Oct 15, 2025
5fe3af6
Remove build-docker-image job to fix GitHub Actions startup failure
chrisgleissner Oct 15, 2025
cb06cb9
Improved Docker build
chrisgleissner Oct 16, 2025
6adcbad
feat: implement dockerized Ubuntu build system with 60-75% speed impr…
chrisgleissner Oct 16, 2025
f509786
feat: implement fully automatic Docker image management
chrisgleissner Oct 16, 2025
d11cffb
fix: simplify to truly automatic Docker builds that just work
chrisgleissner Oct 16, 2025
11d1161
fix: restore Windows build and simplify E2E logic
chrisgleissner Oct 16, 2025
e4e48ee
feat: consolidate workflows into single build-project.yaml
chrisgleissner Oct 16, 2025
ee9c8d6
feat: restore manual E2E test trigger capability
chrisgleissner Oct 16, 2025
01c83ac
Improved dockerized build
chrisgleissner Oct 16, 2025
773d90a
refactor: clean up workflow language and remove unused traditional bu…
chrisgleissner Oct 16, 2025
be5fd42
Improved workflow
chrisgleissner Oct 16, 2025
c8cf204
fix: enable automatic builds for dockerized-ubuntu-build feature branch
chrisgleissner Oct 16, 2025
6b79aba
fix: restore 7-day Docker image age check for automatic rebuilds
chrisgleissner Oct 16, 2025
0b2b842
fix: grant packages:write permission for Docker image push to GHCR
chrisgleissner Oct 16, 2025
bf5b59b
Formatting
chrisgleissner Oct 16, 2025
0f08312
feat: add workflow validation tool and fix YAML syntax error
chrisgleissner Oct 16, 2025
c0f5236
Improved E2E logs
chrisgleissner Oct 16, 2025
10cae26
A/V sync black square and sound
chrisgleissner Oct 16, 2025
925a519
Added A/V sync checks
chrisgleissner Oct 16, 2025
c49e4c3
Fix CI formatting workflow and resolve formatting issues
chrisgleissner Oct 16, 2025
33bb03e
Fix Docker container shell compatibility
chrisgleissner Oct 16, 2025
e62f30c
Add file utility to Docker image for CPack DEB generation
chrisgleissner Oct 16, 2025
ff52c30
Add missing CPack and E2E dependencies to Docker image
chrisgleissner Oct 16, 2025
debda5e
Force Docker image rebuild when Dockerfile changes
chrisgleissner Oct 16, 2025
a611d11
Remove orphaned multi-stage Dockerfile and update docs
chrisgleissner Oct 16, 2025
80c42b7
Enhance packaging step with debug outputs
chrisgleissner Oct 16, 2025
59f1ae0
Check for 'file' binary in build process
chrisgleissner Oct 16, 2025
d388000
Update Dockerfile to install 'file' utility
chrisgleissner Oct 16, 2025
da97d29
Refactor Dockerfile to streamline file installation
chrisgleissner Oct 16, 2025
e2adc72
Clean up package plugin step in build workflow
chrisgleissner Oct 16, 2025
80d6373
Implement Dockerfile modification check in workflow
chrisgleissner Oct 16, 2025
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
17 changes: 15 additions & 2 deletions .github/actions/build-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,15 @@ runs:
run: |
: Install Dependencies 🛍️
echo ::group::Install Dependencies
sudo apt-get update -qq
sudo apt-get install -y zsh

# Check if we're in a container with dependencies already installed
if command -v zsh >/dev/null 2>&1 && command -v obs >/dev/null 2>&1; then
echo "Dependencies already available (likely in container)"
else
echo "Installing dependencies..."
sudo apt-get update -qq
sudo apt-get install -y zsh
fi
echo ::endgroup::

- name: Run Ubuntu Build
Expand All @@ -68,6 +75,12 @@ runs:
--target ubuntu-${{ inputs.target }}
--config ${{ inputs.config }}
)

# Skip dependency installation if we're in a container with pre-installed deps
if command -v obs >/dev/null 2>&1 && [[ -f "/usr/include/obs/obs.h" ]]; then
build_args+=(--skip-deps)
echo "Detected container environment - skipping dependency installation"
fi
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)

.github/scripts/build-ubuntu ${build_args}
Expand Down
49 changes: 49 additions & 0 deletions .github/build-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# Local Docker build script for C64 Stream Ubuntu build environment
# This builds the pre-built container locally for testing

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"

echo "🐳 Building C64 Stream Ubuntu build container..."

# Build the Ubuntu build environment image
docker build \
-f "${SCRIPT_DIR}/docker/Dockerfile.ubuntu-build" \
-t c64stream/ubuntu-build:latest \
"${PROJECT_ROOT}"

echo "✅ Container built successfully!"
echo ""
echo "🧪 Testing the container..."

# Test that the container works
docker run --rm c64stream/ubuntu-build:latest bash -c '
echo "Testing build tools..."
cmake --version
ninja --version
obs --version
ccache --version

echo "Testing Qt6..."
pkg-config --exists Qt6Core && echo "✅ Qt6Core found"
pkg-config --exists Qt6Widgets && echo "✅ Qt6Widgets found"
pkg-config --exists Qt6Svg && echo "✅ Qt6Svg found"

echo "Testing OBS headers..."
if [ -f "/usr/include/obs/obs.h" ]; then
echo "✅ OBS headers found"
else
echo "❌ OBS headers missing"
exit 1
fi

echo "✅ All tests passed!"
'

echo ""
echo "🚀 Container ready! You can now use it with:"
echo " docker run --rm -v \$(pwd):/workspace c64stream/ubuntu-build:latest bash -c 'cd /workspace && cmake --preset ubuntu-x86_64 && cmake --build build_x86_64'"
7 changes: 7 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,19 @@ fi
# Format validation
./build-aux/run-clang-format --check
./build-aux/run-gersemi --check

# Workflow validation (MANDATORY for any .github/workflows/ changes)
./build-aux/validate-workflows

# E2E (MANDATORY for any changes to the plugin itself. This is only applicable for local builds, not for builds on the GitHub CI environment.)
./local-build linux --install --e2e
```

**Checklist:**
- [ ] Linux build succeeds without warnings
- [ ] Code formatting passes
- [ ] CMake formatting passes
- [ ] Workflow validation passes (if .github/workflows/ modified)
- [ ] Cross-platform compatibility maintained
- [ ] Code committed with clear commit message

Expand Down
83 changes: 83 additions & 0 deletions .github/docker/Dockerfile.ubuntu-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Pre-built Ubuntu container with OBS Studio and Qt6 dependencies
# This dramatically speeds up CI builds by avoiding 3.5+ minute APT installations

FROM ubuntu:24.04

LABEL org.opencontainers.image.title="C64 Stream Ubuntu Build Environment"
LABEL org.opencontainers.image.description="Pre-built Ubuntu container with OBS Studio and Qt6 for fast CI builds"
LABEL org.opencontainers.image.source="https://github.com/chrisgleissner/c64stream"
LABEL org.opencontainers.image.licenses="GPL-2.0-or-later"

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

# Install essential packages and add OBS Studio PPA
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
software-properties-common \
ca-certificates \
curl \
wget \
gnupg \
lsb-release && \
add-apt-repository --yes ppa:obsproject/obs-studio && \
apt-get update -qq

# Install build dependencies and OBS Studio (the time-consuming part)
RUN apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
pkg-config \
git \
zsh \
jq \
ccache \
file \
dpkg-dev \
xz-utils \
libgles2-mesa-dev \
libsimde-dev \
obs-studio \
qt6-base-dev \
libqt6svg6-dev \
qt6-base-private-dev \
python3 \
python3-pip \
python3-numpy \
python3-opencv \
python3-pil \
python3-requests \
python3-websocket \
ffmpeg \
xvfb \
procps \
unzip && \
apt-get update -qq && apt-get install -y file && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Configure ccache for optimal build caching
RUN mkdir -p /usr/local/bin && \
ln -sf /usr/bin/ccache /usr/local/bin/gcc && \
ln -sf /usr/bin/ccache /usr/local/bin/g++ && \
ln -sf /usr/bin/ccache /usr/local/bin/cc && \
ln -sf /usr/bin/ccache /usr/local/bin/c++

# Set up working directory
WORKDIR /workspace

# Configure Git to avoid issues with file ownership in containers
RUN git config --global --add safe.directory /workspace && \
git config --global --add safe.directory '*'

# Set default shell to bash for compatibility
SHELL ["/bin/bash", "-c"]

# Verify installations work correctly
RUN obs --version && \
cmake --version && \
ninja --version && \
ccache --version && \
echo "✅ Ubuntu build environment ready"
80 changes: 80 additions & 0 deletions .github/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Docker Build System for C64 Stream Plugin 🐳

This directory contains Docker-based build configurations that dramatically speed up CI builds by pre-installing heavy dependencies.

## Performance Improvement

- **Traditional Build**: ~4.5 minutes (3.5min APT packages + 1min plugin build)
- **Docker Container Build**: ~1-2 minutes (0.5min container start + 1min plugin build)
- **Speed Improvement**: ~60-75% faster

## Build Strategy

### Pre-built Container (`Dockerfile.ubuntu-build`)

Uses a pre-built base image with OBS Studio and Qt6 already installed.

**Pros:**

- Fastest builds (~1-2 minutes)
- Consistent environment
- Cached dependency installation
- Automatic rebuild when Dockerfile changes

**Cons:**

- Requires maintaining custom image
- Initial image build takes ~10 minutes
- Weekly rebuilds for security updates (automatic)

**Usage:**

```yaml
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/chrisgleissner/c64stream/ubuntu-build:latest
```

## Current Implementation

The Docker build system is integrated into the main `build-project.yaml` workflow:

- **Automatic Image Management**: Checks if Docker image exists and is recent
- **Smart Rebuilding**: Rebuilds image when Dockerfile changes or age > 7 days
- **Transparent Integration**: Uses Docker container for Ubuntu builds seamlessly
- **No Manual Steps**: Everything works automatically

## Local Development

### Build Plugin with Docker

```bash
# Using pre-built image (matches CI environment)
docker run --rm -v $(pwd):/workspace \
ghcr.io/chrisgleissner/c64stream/ubuntu-build:latest \
bash -c "cd /workspace && cmake --preset ubuntu-x86_64 && cmake --build build_x86_64"
```

### Update Base Image

```bash
# Build new base image
docker build -f .github/docker/Dockerfile.ubuntu-build -t ubuntu-build .

# Test the image
docker run --rm ubuntu-build obs --version
```

## Migration Strategy

1. **Phase 1**: Keep existing VM builds, add containerized builds as optional
2. **Phase 2**: Once stable, switch main builds to containers
3. **Phase 3**: Remove VM builds, use containers exclusively

## Maintenance

- **Monthly**: Base image rebuilds (automated)
- **As needed**: Update Dockerfiles when dependencies change
- **Security**: Regular base image updates via scheduled builds
Loading
Loading