Skip to content
Merged
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
24 changes: 18 additions & 6 deletions .github/workflows/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: live-test
#
# PrusaSlicer (Flathub, pinnable) -> p2pp -> G-code lint -> Palette 3 simulator
#
# The Palette 3 stage is a behavioural simulator, not emulated firmware: Mosaic
# publishes no redistributable P3 firmware image, so there is nothing to boot
# under QEMU in public CI. See docs/e2e_pipeline.md.
# The P3 firmware is downloaded from Mosaic's public S3 bucket and run under
# QEMU ARM emulation. See docs/e2e_pipeline.md.

on:
push:
Expand Down Expand Up @@ -34,21 +33,25 @@ jobs:
run: python3 tests/test_p3_simulator.py

e2e-pipeline:
name: Slice -> p2pp -> lint -> P3 simulator
name: Slice -> p2pp -> lint -> P3 firmware
runs-on: ubuntu-latest
if: false # disabled until Docker container (#88) provides Xvfb + Flatpak runtime
if: false # disabled until Xvfb + Flatpak + Docker runtime is validated
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Load pinned versions
run: cat .slicer-versions.env >> "$GITHUB_ENV"

- name: Install p2pp dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
xvfb libgl1 libegl1 libxkbcommon-x11-0 libxcb-cursor0 \
libxcb-icccm4 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0
libxcb-icccm4 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \
p7zip-full docker-compose
python3 -m pip install --upgrade pip
pip install -r requirements-common.txt -r requirements-linux.txt

Expand All @@ -58,9 +61,18 @@ jobs:
path: /var/lib/flatpak
key: flatpak-prusaslicer-${{ env.PRUSASLICER_FLATPAK_COMMIT || 'stable' }}

- name: Cache P3 firmware
uses: actions/cache@v4
with:
path: /tmp/p3-firmware
key: p3-firmware-${{ env.P3_FIRMWARE_VERSION }}

- name: Install PrusaSlicer from Flathub
run: bash scripts/install_prusaslicer.sh

- name: Install P3 firmware (QEMU + Docker)
run: bash scripts/install_p3_firmware.sh

- name: Run end-to-end pipeline
run: bash scripts/e2e_pipeline.sh

Expand Down
5 changes: 4 additions & 1 deletion .slicer-versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ PRUSA_SLICER_VERSION=2.8.1
PRUSA_SLICER_URL=https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-newer-distros-GTK3-202409181416.AppImage

ORCA_SLICER_VERSION=2.4.2
ORCA_SLICER_URL=https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v2.4.2/OrcaSlicer_Linux_AppImage_Ubuntu2404_V2.4.2.AppImage
ORCA_SLICER_URL=https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v2.4.2/OrcaSlicer_Linux_AppImage_Ubuntu2404_V2.4.2.AppImage

P3_FIRMWARE_VERSION=22.08.11.0
P3_FIRMWARE_URL=https://p3-stable.s3.amazonaws.com/versions/p3_22.08.11.0.zip
40 changes: 40 additions & 0 deletions scripts/install_p3_firmware.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -euo pipefail

# Download and load the Palette 3 firmware Docker stack.
# The firmware is publicly available from Mosaic's S3 bucket.
# Since the P3 runs on ARM, Docker images need QEMU binfmt emulation on x86.
#
# Usage: bash scripts/install_p3_firmware.sh
# Env: P3_FIRMWARE_URL (from .slicer-versions.env)

FIRMWARE_URL="${P3_FIRMWARE_URL:-https://p3-stable.s3.amazonaws.com/versions/p3_22.08.11.0.zip}"
FIRMWARE_DIR="${P3_FIRMWARE_DIR:-/tmp/p3-firmware}"

echo "=== Enabling QEMU binfmt for ARM emulation ==="
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

echo "=== Downloading P3 firmware from ${FIRMWARE_URL} ==="
if [ -d "${FIRMWARE_DIR}" ] && [ -f "${FIRMWARE_DIR}/.loaded" ]; then
echo "Firmware already downloaded and loaded — skipping"
exit 0
fi

wget -q "${FIRMWARE_URL}" -O /tmp/p3_firmware.zip
mkdir -p "${FIRMWARE_DIR}"

echo "=== Extracting firmware ==="
# 7z handles the large zip better than unzip
7z x -o"${FIRMWARE_DIR}" /tmp/p3_firmware.zip -y
rm -f /tmp/p3_firmware.zip

echo "=== Loading Docker images ==="
for img in "${FIRMWARE_DIR}"/images/*.tar.gz; do
echo "Loading $(basename "$img")..."
docker load -i "$img"
done

echo "=== P3 firmware loaded ==="
touch "${FIRMWARE_DIR}/.loaded"
echo "Firmware extracted to ${FIRMWARE_DIR}"
echo "Start the stack with: cd ${FIRMWARE_DIR} && docker compose up -d"
Loading