Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ self-hosted-runner:
# GitHub-hosted Xcode 27 image; newer than the pinned actionlint label list.
- xcode-27
- blacksmith-8vcpu-ubuntu-2404
- blacksmith-16vcpu-ubuntu-2404
- blacksmith-32vcpu-ubuntu-2404
61 changes: 61 additions & 0 deletions .github/workflows/linux-runner-size-probe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Experiment only, never merge. Does blacksmith-16vcpu-ubuntu-2404 (and 32)
# provision without a pre-created scale set, and how much faster is a cold Agent
# clippy + test build on 16/32 vCPU than on 8?
name: Linux runner size probe

on:
pull_request:
paths:
- .github/workflows/linux-runner-size-probe.yml

permissions:
contents: read

concurrency:
group: linux-runner-size-probe-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
probe:
name: Agent cold build on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
runner: [blacksmith-8vcpu-ubuntu-2404, blacksmith-16vcpu-ubuntu-2404, blacksmith-32vcpu-ubuntu-2404]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Machine
run: |
echo "::notice::$(nproc) CPUs, $(free -g | awk '/Mem:/{print $2}') GB RAM on ${{ matrix.runner }}"

- name: Install pinned Nix environment
uses: DeterminateSystems/determinate-nix-action@96c5ee93a9dddf2830d31e1da6ec719077336c28 # v3.23.3
with:
source-tag: v3.23.3
github-token: ""

- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh

- name: Cold Agent clippy and test build
working-directory: apps/maple-agent
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: "0"
run: |
set -euo pipefail
start=$SECONDS
nix develop --no-update-lock-file . -c true
shell=$((SECONDS - start))
start=$SECONDS
nix develop --no-update-lock-file . -c cargo clippy --workspace --all-targets --locked -- -D warnings
clippy=$((SECONDS - start))
start=$SECONDS
nix develop --no-update-lock-file . -c cargo test --workspace --locked --no-run
tests=$((SECONDS - start))
echo "::notice::${{ matrix.runner }}: shell ${shell}s, cold clippy ${clippy}s, cold test build ${tests}s"
179 changes: 179 additions & 0 deletions .github/workflows/macos27-blacksmith-experiment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Experiment only, never merge. Can Agent macOS work stay on Blacksmith's macOS 27
# image with Xcode 27.1? Two arms:
# 1. Export Xcode 27.1's Metal Toolchain on GitHub's xcode-27 image, import it on
# Blacksmith (whose own catalog download fails), and build the Agent with
# compiled Metal shaders.
# 2. Without any Metal Toolchain, run the Agent clippy with gpui's
# runtime_shaders feature (shaders compile at run time, not build time).
name: macOS 27 Blacksmith experiment

on:
pull_request:
paths:
- .github/workflows/macos27-blacksmith-experiment.yml

permissions:
contents: read

concurrency:
group: macos27-blacksmith-experiment-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
export-metal:
name: Export Metal Toolchain (GitHub xcode-27)
runs-on: xcode-27
timeout-minutes: 30
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py

- name: Download and export the Metal Toolchain
run: |
set -euxo pipefail
xcodebuild -version
xcodebuild -showComponent metalToolchain || true
export_dir="$RUNNER_TEMP/metal-export"
mkdir -p "$export_dir"
start=$SECONDS
xcodebuild -downloadComponent metalToolchain -exportPath "$export_dir"
echo "::notice::Metal Toolchain export took $((SECONDS - start))s"
find "$export_dir" -maxdepth 2 -print
du -sh "$export_dir"
find "$export_dir" -name ExportMetadata.plist -exec plutil -p {} \; || true
# Keep symlinks and modes intact; artifacts flatten them.
tar -C "$export_dir" -cf "$RUNNER_TEMP/metal-export.tar" .

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: metal-toolchain-xcode-27.1
path: ${{ runner.temp }}/metal-export.tar
retention-days: 1
compression-level: 0

blacksmith-imported-metal:
name: Blacksmith macos-27, imported Metal, Agent build
needs: export-metal
runs-on: blacksmith-6vcpu-macos-27
timeout-minutes: 90
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py

- name: Metal before import
run: |
xcodebuild -version
xcodebuild -showComponent metalToolchain || true
if xcrun -sdk macosx metal --version; then
echo "::notice::Metal Toolchain is already present on this Blacksmith image"
else
echo "::notice::Metal Toolchain missing before import, as expected"
fi

- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: metal-toolchain-xcode-27.1
path: ${{ runner.temp }}/metal

- name: Import the Metal Toolchain
run: |
set -euxo pipefail
export_dir="$RUNNER_TEMP/metal-export"
mkdir -p "$export_dir"
tar -C "$export_dir" -xf "$RUNNER_TEMP/metal/metal-export.tar"
ls -la "$export_dir"
bundle="$(find "$export_dir" -maxdepth 1 \( -name '*.exportedBundle' -o -name '*.dmg' \) -print -quit)"
test -n "$bundle"
start=$SECONDS
if ! xcodebuild -importComponent metalToolchain -importPath "$bundle"; then
echo "::warning::unprivileged import failed; retrying with sudo"
sudo xcodebuild -importComponent metalToolchain -importPath "$bundle"
fi
echo "::notice::Metal Toolchain import took $((SECONDS - start))s"
xcodebuild -showComponent metalToolchain || true

- name: Compile a Metal shader
run: |
set -euxo pipefail
cat > "$RUNNER_TEMP/probe.metal" <<'EOF'
#include <metal_stdlib>
using namespace metal;
kernel void probe(device float *out [[buffer(0)]]) { out[0] = 1.0; }
EOF
xcrun -sdk macosx metal --version
xcrun -sdk macosx metal -c "$RUNNER_TEMP/probe.metal" -o "$RUNNER_TEMP/probe.air"
xcrun -sdk macosx metallib "$RUNNER_TEMP/probe.air" -o "$RUNNER_TEMP/probe.metallib"
echo "::notice::Metal shader compiled on Blacksmith macos-27"

- name: Install pinned Nix environment
uses: DeterminateSystems/determinate-nix-action@96c5ee93a9dddf2830d31e1da6ec719077336c28 # v3.23.3
with:
source-tag: v3.23.3
github-token: ""

- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh

- name: Build the Agent workspace (cold, compiled Metal shaders)
working-directory: apps/maple-agent
run: |
set -euo pipefail
start=$SECONDS
nix develop --no-update-lock-file . -c true
shell=$((SECONDS - start))
start=$SECONDS
nix develop --no-update-lock-file . -c cargo build --workspace --all-targets --locked
build=$((SECONDS - start))
echo "::notice::Agent dev shell ${shell}s, cold cargo build --workspace --all-targets ${build}s"
printf '| Step | Seconds |\n| --- | ---: |\n| Agent dev shell | %s |\n| Cold workspace build (compiled shaders) | %s |\n' "$shell" "$build" >> "$GITHUB_STEP_SUMMARY"

blacksmith-runtime-shaders:
name: Blacksmith macos-27, no Metal, runtime_shaders clippy
runs-on: blacksmith-6vcpu-macos-27
timeout-minutes: 90
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py

- name: Confirm no Metal Toolchain
run: |
if xcrun -sdk macosx metal --version; then
echo "::warning::Metal Toolchain present; this arm no longer proves the no-Metal path"
else
echo "::notice::No Metal Toolchain on this runner"
fi

- name: Install pinned Nix environment
uses: DeterminateSystems/determinate-nix-action@96c5ee93a9dddf2830d31e1da6ec719077336c28 # v3.23.3
with:
source-tag: v3.23.3
github-token: ""

- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh

- name: Clippy the Agent app with runtime shaders (cold)
working-directory: apps/maple-agent
run: |
set -euo pipefail
start=$SECONDS
nix develop --no-update-lock-file . -c true
shell=$((SECONDS - start))
start=$SECONDS
nix develop --no-update-lock-file . -c cargo clippy -p maple-agent-app --all-targets --locked \
-F gpui-platform/runtime_shaders -- -D warnings
clippy=$((SECONDS - start))
echo "::notice::Agent dev shell ${shell}s, cold clippy (runtime_shaders) ${clippy}s"
printf '| Step | Seconds |\n| --- | ---: |\n| Agent dev shell | %s |\n| Cold app clippy, runtime_shaders | %s |\n' "$shell" "$clippy" >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion scripts/ci/test_nix_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"run": "bash scripts/ci/verify-nix-runtime.sh",
}
# Independent Agent provider, Linux release and attestation jobs retain pinned setup.
EXPECTED_INSTALLS = 79
EXPECTED_INSTALLS = 82


@functools.cache
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci/test_select_xcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def test_no_workflow_uses_retired_mac_os_and_every_native_selector_has_checkout(
("agent-ci.yml", "desktop"),
("agent-ci.yml", "provider"),
("agent-store-performance.yml", "performance"),
("macos27-blacksmith-experiment.yml", "export-metal"),
("macos27-blacksmith-experiment.yml", "blacksmith-imported-metal"),
("macos27-blacksmith-experiment.yml", "blacksmith-runtime-shaders"),
("agent-desktop-build.yml", "macos-build"),
("agent-desktop-build.yml", "macos"),
("agent-desktop-build.yml", "macos-unsigned"),
Expand Down
Loading