Skip to content
Open
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
29 changes: 29 additions & 0 deletions .github/actions/setup-e2e-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup E2E CLI
description: Download an architecture-matched prebuilt OpenShell CLI for E2E tests

inputs:
artifact-prefix:
description: Artifact name prefix; linux-<arch> is appended automatically
required: true

runs:
using: composite
steps:
- name: Download prebuilt CLI
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ format('{0}-linux-{1}', inputs.artifact-prefix, runner.arch == 'X64' && 'amd64' || 'arm64') }}
path: .e2e/prebuilt-cli

- name: Configure prebuilt CLI
shell: bash
run: |
set -euo pipefail
cli="$GITHUB_WORKSPACE/.e2e/prebuilt-cli/openshell"
if [[ ! -f "$cli" ]]; then
echo "downloaded artifact is missing $cli" >&2
exit 1
fi
chmod +x "$cli"
"$cli" --version
echo "OPENSHELL_BIN=$cli" >> "$GITHUB_ENV"
29 changes: 29 additions & 0 deletions .github/actions/setup-e2e-gateway/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup E2E Gateway
description: Download an architecture-matched prebuilt OpenShell gateway for E2E tests

inputs:
artifact-prefix:
description: Artifact name prefix; linux-<arch> is appended automatically
required: true

runs:
using: composite
steps:
- name: Download prebuilt gateway
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ format('{0}-linux-{1}', inputs.artifact-prefix, runner.arch == 'X64' && 'amd64' || 'arm64') }}
path: .e2e/prebuilt-gateway

- name: Configure prebuilt gateway
shell: bash
run: |
set -euo pipefail
gateway="$GITHUB_WORKSPACE/.e2e/prebuilt-gateway/openshell-gateway"
if [[ ! -f "$gateway" ]]; then
echo "downloaded artifact is missing $gateway" >&2
exit 1
fi
chmod +x "$gateway"
"$gateway" --version
echo "OPENSHELL_GATEWAY_BIN=$gateway" >> "$GITHUB_ENV"
38 changes: 38 additions & 0 deletions .github/actions/setup-e2e-vm-driver/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup E2E VM Driver
description: Download a prebuilt OpenShell VM driver for E2E tests

inputs:
artifact-name:
description: Artifact name to download, such as driver-vm-linux-amd64
required: true

runs:
using: composite
steps:
- name: Download prebuilt VM driver
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.artifact-name }}
path: .e2e/prebuilt-vm-driver

- name: Configure prebuilt VM driver
shell: bash
run: |
set -euo pipefail
extract_dir="$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver/bin"
mkdir -p "$extract_dir"
archive="$(find "$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver" -maxdepth 1 -type f -name 'openshell-driver-vm-*.tar.gz' -print -quit)"
if [[ -z "$archive" ]]; then
echo "downloaded artifact is missing openshell-driver-vm-*.tar.gz" >&2
find "$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver" -maxdepth 2 -type f -print >&2 || true
exit 1
fi
tar -xzf "$archive" -C "$extract_dir"
driver="$extract_dir/openshell-driver-vm"
if [[ ! -f "$driver" ]]; then
echo "downloaded artifact is missing $driver" >&2
exit 1
fi
chmod +x "$driver"
"$driver" --version
echo "OPENSHELL_VM_DRIVER_BIN=$driver" >> "$GITHUB_ENV"
55 changes: 45 additions & 10 deletions .github/workflows/branch-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

build-gateway:
needs: [pr_metadata]
if: needs.pr_metadata.outputs.should_run == 'true' && (needs.pr_metadata.outputs.run_core_e2e == 'true' || needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true')
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true'
permissions:
contents: read
packages: write
Expand All @@ -95,38 +95,59 @@ jobs:

build-cli:
needs: [pr_metadata]
if: needs.pr_metadata.outputs.should_run == 'true'
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true'
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build.yml
with:
component: cli
platform: linux/amd64
platform: linux/amd64,linux/arm64

build-driver-vm-linux:
needs: [pr_metadata]
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
permissions:
contents: read
packages: read
uses: ./.github/workflows/driver-vm-linux.yml
with:
image-tag: ${{ github.sha }}
checkout-ref: ${{ github.sha }}
runtime-platforms: linux-x86_64
driver-targets: >-
[{"arch":"amd64","runner":"linux-amd64-cpu8","target":"x86_64-unknown-linux-gnu","zig_target":"x86_64-unknown-linux-gnu.2.28","platform":"linux-x86_64","guest_arch":"x86_64"}]

e2e:
needs: [pr_metadata, build-gateway, build-supervisor]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, build-driver-vm-linux]
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
permissions:
actions: read
contents: read
packages: read
uses: ./.github/workflows/e2e-test.yml
with:
image-tag: ${{ github.sha }}
runner: linux-arm64-cpu8
cli-artifact-prefix: rust-binary-cli
gateway-artifact-prefix: rust-binary-gateway
vm-driver-artifact-name: driver-vm-linux-amd64

gpu-e2e:
needs: [pr_metadata, build-supervisor]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
permissions:
actions: read
contents: read
packages: read
uses: ./.github/workflows/e2e-gpu-test.yaml
with:
image-tag: ${{ github.sha }}
cli-artifact-prefix: rust-binary-cli
gateway-artifact-prefix: rust-binary-gateway

kubernetes-e2e:
needs: [pr_metadata, build-gateway, build-supervisor]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
strategy:
fail-fast: false
Expand All @@ -145,6 +166,7 @@ jobs:
topology: sidecar
extra_helm_values: deploy/helm/openshell/ci/values-sidecar.yaml
permissions:
actions: read
contents: read
packages: read
uses: ./.github/workflows/e2e-kubernetes-test.yml
Expand All @@ -153,11 +175,13 @@ jobs:
job-name: Kubernetes E2E (Rust smoke, ${{ matrix.topology }}, Agent Sandbox ${{ matrix.agent_sandbox_api }})
agent-sandbox-version: ${{ matrix.agent_sandbox_version }}
extra-helm-values: ${{ matrix.extra_helm_values }}
cli-artifact-prefix: rust-binary-cli

kubernetes-ha-e2e:
needs: [pr_metadata, build-gateway, build-supervisor]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true'
permissions:
actions: read
contents: read
packages: read
uses: ./.github/workflows/e2e-kubernetes-test.yml
Expand All @@ -166,17 +190,20 @@ jobs:
job-name: Kubernetes HA E2E (Rust smoke)
extra-helm-values: deploy/helm/openshell/ci/values-high-availability.yaml
external-postgres-secret: openshell-ha-pg
cli-artifact-prefix: rust-binary-cli

core-e2e-result:
name: Core E2E result
needs: [pr_metadata, build-gateway, build-supervisor, e2e, kubernetes-e2e]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, build-driver-vm-linux, e2e, kubernetes-e2e]
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
runs-on: ubuntu-latest
steps:
- name: Verify core E2E jobs
env:
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
BUILD_DRIVER_VM_RESULT: ${{ needs.build-driver-vm-linux.result }}
E2E_RESULT: ${{ needs.e2e.result }}
KUBERNETES_E2E_RESULT: ${{ needs.kubernetes-e2e.result }}
run: |
Expand All @@ -185,6 +212,8 @@ jobs:
for item in \
"build-gateway:$BUILD_GATEWAY_RESULT" \
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
"build-cli:$BUILD_CLI_RESULT" \
"build-driver-vm-linux:$BUILD_DRIVER_VM_RESULT" \
"e2e:$E2E_RESULT" \
"kubernetes-e2e:$KUBERNETES_E2E_RESULT"; do
name="${item%%:*}"
Expand All @@ -198,19 +227,23 @@ jobs:

gpu-e2e-result:
name: GPU E2E result
needs: [pr_metadata, build-supervisor, gpu-e2e]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, gpu-e2e]
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
runs-on: ubuntu-latest
steps:
- name: Verify GPU E2E jobs
env:
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
GPU_E2E_RESULT: ${{ needs.gpu-e2e.result }}
run: |
set -euo pipefail
failed=0
for item in \
"build-gateway:$BUILD_GATEWAY_RESULT" \
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
"build-cli:$BUILD_CLI_RESULT" \
"gpu-e2e:$GPU_E2E_RESULT"; do
name="${item%%:*}"
result="${item#*:}"
Expand All @@ -223,21 +256,23 @@ jobs:

kubernetes-ha-e2e-result:
name: Kubernetes HA E2E result
needs: [pr_metadata, build-gateway, build-supervisor, kubernetes-ha-e2e]
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, kubernetes-ha-e2e]
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true'
runs-on: ubuntu-latest
steps:
- name: Verify Kubernetes HA E2E jobs
env:
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
KUBERNETES_HA_E2E_RESULT: ${{ needs.kubernetes-ha-e2e.result }}
run: |
set -euo pipefail
failed=0
for item in \
"build-gateway:$BUILD_GATEWAY_RESULT" \
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
"build-cli:$BUILD_CLI_RESULT" \
"kubernetes-ha-e2e:$KUBERNETES_HA_E2E_RESULT"; do
name="${item%%:*}"
result="${item#*:}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
echo "arches=${arches[*]}"
echo "binary_component=$binary_component"
echo "binary_name=$binary_name"
echo "artifact_prefix=rust-binary-${component}-${binary_component}"
echo "artifact_prefix=rust-binary-${component}"
echo "image_tag_base=$image_tag_base"
echo "features=$features"
echo "has_image=$has_image"
Expand Down
52 changes: 35 additions & 17 deletions .github/workflows/driver-vm-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@ on:
workflow_call:
inputs:
cargo-version:
required: true
required: false
type: string
default: ""
image-tag:
required: true
type: string
checkout-ref:
required: true
type: string
runtime-platforms:
description: "Comma-separated VM runtime platforms to download: linux-aarch64,linux-x86_64"
required: false
type: string
default: "linux-aarch64,linux-x86_64"
driver-targets:
description: "JSON matrix entries for Linux VM driver targets"
required: false
type: string
default: >-
[{"arch":"arm64","runner":"linux-arm64-cpu8","target":"aarch64-unknown-linux-gnu","zig_target":"aarch64-unknown-linux-gnu.2.28","platform":"linux-aarch64","guest_arch":"aarch64"},{"arch":"amd64","runner":"linux-amd64-cpu8","target":"x86_64-unknown-linux-gnu","zig_target":"x86_64-unknown-linux-gnu.2.28","platform":"linux-x86_64","guest_arch":"x86_64"}]

permissions:
contents: read
Expand Down Expand Up @@ -39,11 +51,29 @@ jobs:
- name: Download Linux runtime tarballs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUNTIME_PLATFORMS: ${{ inputs['runtime-platforms'] }}
run: |
set -euo pipefail
mkdir -p runtime-artifacts

for platform in linux-aarch64 linux-x86_64; do
runtime_platforms="${RUNTIME_PLATFORMS//[[:space:]]/}"
IFS=',' read -r -a platforms <<< "$runtime_platforms"
if [ "${#platforms[@]}" -eq 0 ]; then
echo "::error::No VM runtime platforms requested"
exit 1
fi
for platform in "${platforms[@]}"; do
case "$platform" in
linux-aarch64 | linux-x86_64) ;;
*)
echo "::error::Unsupported VM runtime platform '$platform' in runtime-platforms"
exit 1
;;
esac
done
printf '%s\n' "${platforms[@]}" > runtime-artifacts/platforms.txt

for platform in "${platforms[@]}"; do
asset="vm-runtime-${platform}.tar.zst"
echo "Downloading ${asset}..."
if ! gh release download vm-runtime \
Expand All @@ -61,9 +91,9 @@ jobs:
- name: Verify downloads
run: |
set -euo pipefail
for platform in linux-aarch64 linux-x86_64; do
while IFS= read -r platform; do
test -f "runtime-artifacts/vm-runtime-${platform}.tar.zst"
done
done < runtime-artifacts/platforms.txt

- name: Upload runtime artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand All @@ -77,19 +107,7 @@ jobs:
needs: [download-kernel-runtime]
strategy:
matrix:
include:
- arch: arm64
runner: linux-arm64-cpu8
target: aarch64-unknown-linux-gnu
zig_target: aarch64-unknown-linux-gnu.2.28
platform: linux-aarch64
guest_arch: aarch64
- arch: amd64
runner: linux-amd64-cpu8
target: x86_64-unknown-linux-gnu
zig_target: x86_64-unknown-linux-gnu.2.28
platform: linux-x86_64
guest_arch: x86_64
include: ${{ fromJSON(inputs['driver-targets']) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
container:
Expand Down
Loading
Loading