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: 24 additions & 0 deletions .github/actions/e2e-boot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ runs:
echo "$K3S_INSTALL_SHA256 /tmp/k3s-install.sh" | sha256sum -c -
chmod +x /tmp/k3s-install.sh
INSTALL_K3S_VERSION="$K3S_VERSION" INSTALL_K3S_EXEC="--disable=traefik --bind-address 0.0.0.0 --tls-san host.docker.internal" /tmp/k3s-install.sh

- name: Pre-pull executor images and Kueue manifest (background)
shell: bash
run: |
KUEUE_VERSION="${KUEUE_VERSION:-v0.16.1}"

nohup bash -c '
curl -fsSL -o /tmp/kueue-manifests.yaml \
"https://github.com/kubernetes-sigs/kueue/releases/download/'"$KUEUE_VERSION"'/manifests.yaml"
echo $? > /tmp/kueue-download.exit
' > /tmp/kueue-download.log 2>&1 &
echo $! > /tmp/kueue-download.pid

nohup bash -c '
sudo k3s crictl pull docker.io/library/python:3.11-slim
echo $? > /tmp/crictl-python.exit
' > /tmp/crictl-python.log 2>&1 &
echo $! > /tmp/crictl-python.pid

nohup bash -c '
sudo k3s crictl pull docker.io/library/busybox:1.36
echo $? > /tmp/crictl-busybox.exit
' > /tmp/crictl-busybox.log 2>&1 &
echo $! > /tmp/crictl-busybox.pid
Comment thread
HardMax71 marked this conversation as resolved.
56 changes: 28 additions & 28 deletions .github/actions/e2e-ready/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Also wait for frontend health check (default: false)'
required: false
default: 'false'
install-kueue:
description: 'Install Kueue CRDs for executor pods (default: true)'
required: false
default: 'true'

runs:
using: 'composite'
Expand All @@ -26,18 +30,26 @@ runs:
/home/runner/.kube/config > backend/kubeconfig.yaml
chmod 644 backend/kubeconfig.yaml

- name: Install Kueue
- name: Install Kueue and wait for executor image pulls
if: inputs.install-kueue == 'true'
shell: bash
run: |
set -e

KUEUE_VERSION="${KUEUE_VERSION:-v0.16.1}"
KUEUE_MANIFEST_SHA256="${KUEUE_MANIFEST_SHA256:-3201a66ff731be440ecfcf3c0fa5979d001b834f68389208fe7ee18017fbcfe8}"
KUEUE_MANIFEST="/tmp/kueue-manifests.yaml"
curl -fsSL -o "$KUEUE_MANIFEST" "https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/manifests.yaml"

timeout 120 tail --pid="$(cat /tmp/kueue-download.pid)" -f /dev/null 2>/dev/null || true
cat /tmp/kueue-download.log 2>/dev/null || true
[ "$(cat /tmp/kueue-download.exit)" = "0" ]

echo "${KUEUE_MANIFEST_SHA256} ${KUEUE_MANIFEST}" | sha256sum -c -
kubectl apply --server-side -f "$KUEUE_MANIFEST"
rm -f "$KUEUE_MANIFEST"
kubectl wait --for=condition=Available --timeout=120s \
deployment/kueue-controller-manager -n kueue-system

kubectl apply --server-side -f - <<'EOF'
apiVersion: kueue.x-k8s.io/v1beta1
kind: ResourceFlavor
Expand Down Expand Up @@ -69,34 +81,23 @@ runs:
clusterQueue: executor-queue
EOF

- name: Use test environment config
shell: bash
run: cp backend/config.test.toml backend/config.toml
timeout 120 tail --pid="$(cat /tmp/crictl-python.pid)" -f /dev/null 2>/dev/null || true
cat /tmp/crictl-python.log 2>/dev/null || true
[ "$(cat /tmp/crictl-python.exit)" = "0" ]

- name: Pre-pull test runtime images into K3s
shell: bash
run: |
sudo k3s crictl pull docker.io/library/python:3.11-slim
sudo k3s crictl pull docker.io/library/busybox:1.36
timeout 120 tail --pid="$(cat /tmp/crictl-busybox.pid)" -f /dev/null 2>/dev/null || true
cat /tmp/crictl-busybox.log 2>/dev/null || true
[ "$(cat /tmp/crictl-busybox.exit)" = "0" ]

- name: Wait for image pull and infra
- name: Prepare config, wait for infra
shell: bash
run: |
if [ -f /tmp/infra-pull.pid ]; then
PID=$(cat /tmp/infra-pull.pid)
if kill -0 "$PID" 2>/dev/null; then
echo "Waiting for image pull + infra startup..."
tail --pid="$PID" -f /dev/null 2>/dev/null || true
fi
fi
set -e
cp backend/config.test.toml backend/config.toml

timeout 120 tail --pid="$(cat /tmp/infra-pull.pid)" -f /dev/null 2>/dev/null || true
cat /tmp/infra-pull.log 2>/dev/null || true
if [ -f /tmp/infra-pull.exit ]; then
EXIT_CODE=$(cat /tmp/infra-pull.exit)
if [ "$EXIT_CODE" != "0" ]; then
echo "::error::Background image pull / infra pre-warm failed (exit $EXIT_CODE)"
exit 1
fi
fi
[ "$(cat /tmp/infra-pull.exit)" = "0" ]

- name: Start stack
shell: bash
Expand All @@ -110,11 +111,10 @@ runs:
WAIT_FOR_FRONTEND: ${{ inputs.wait-for-frontend }}
run: |
echo "Waiting for backend health..."
timeout 120 bash -c 'until curl -ksf https://localhost/api/v1/health/live 2>/dev/null; do sleep 2; done'
timeout 120 bash -c 'until curl -ksf https://localhost/api/v1/health/live 2>/dev/null; do sleep 1; done'
echo "Backend ready"
if [ "$WAIT_FOR_FRONTEND" = "true" ]; then
echo "Waiting for frontend health..."
timeout 60 bash -c 'until curl -ksf https://localhost:5001 2>/dev/null; do sleep 2; done'
timeout 60 bash -c 'until curl -ksf https://localhost:5001 2>/dev/null; do sleep 1; done'
echo "Frontend ready"
fi

2 changes: 1 addition & 1 deletion .github/workflows/grimp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Run grimp orphan module check
run: |
cd backend
uv run python scripts/check_orphan_modules.py
uv run --no-sync python scripts/check_orphan_modules.py
4 changes: 2 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
run: |
cd backend
uv python install 3.12
uv sync --frozen --group lint --no-dev
uv sync --frozen --group lint --group test --no-dev

- name: Run mypy
env:
SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }}
run: |
cd backend
uv run mypy --config-file pyproject.toml --strict .
uv run --no-sync mypy --config-file pyproject.toml --strict .
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Run ruff
run: |
cd backend
uv run ruff check . --config pyproject.toml
uv run --no-sync ruff check . --config pyproject.toml
15 changes: 10 additions & 5 deletions .github/workflows/stack-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
timeout-minutes: 5
run: |
cd backend
uv run pytest tests/unit -v -rs \
uv run --no-sync pytest tests/unit -v -rs \
--durations=0 \
--cov=app \
--cov-report=xml --cov-report=term
Expand Down Expand Up @@ -236,12 +236,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: ./.github/actions/e2e-boot
- name: Boot E2E environment
uses: ./.github/actions/e2e-boot
with:
image-tag: ${{ needs.build-images.outputs.sha-tag }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/e2e-ready
- name: Finalize k3s & start stack
uses: ./.github/actions/e2e-ready
with:
image-tag: ${{ needs.build-images.outputs.sha-tag }}

Expand Down Expand Up @@ -305,7 +307,8 @@ jobs:
- uses: actions/checkout@v6

# Phase 1: kick off image pull + infra + k3s in background
- uses: ./.github/actions/e2e-boot
- name: Boot E2E environment
uses: ./.github/actions/e2e-boot
with:
image-tag: ${{ needs.build-images.outputs.sha-tag }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -339,10 +342,12 @@ jobs:
run: npx playwright install chromium

# Phase 3: finalize k3s + start stack (k3s has been booting since e2e-boot)
- uses: ./.github/actions/e2e-ready
- name: Finalize k3s & start stack
uses: ./.github/actions/e2e-ready
with:
image-tag: ${{ needs.build-images.outputs.sha-tag }}
wait-for-frontend: 'true'
install-kueue: 'false'

- name: Run Playwright tests
timeout-minutes: 10
Expand Down
Loading
Loading