Skip to content

Commit

Permalink
[CI] Move e2e tests to buildkite (#2639)
Browse files Browse the repository at this point in the history
Signed-off-by: Chi-Sheng Liu <[email protected]>
  • Loading branch information
MortalHappiness authored Dec 12, 2024
1 parent 4bd2dab commit 353e87f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 85 deletions.
35 changes: 35 additions & 0 deletions .buildkite/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- label: 'Test E2E (nightly operator)'
instance_size: large
image: golang:1.22
commands:
- source .buildkite/setup-env.sh
- kind create cluster --wait 900s --config ./tests/framework/config/kind-config-buildkite.yml
- kubectl config set clusters.kind-kind.server https://docker:6443
# Build nightly KubeRay operator image
- pushd ray-operator
- IMG=kuberay/operator:nightly make docker-image
- kind load docker-image kuberay/operator:nightly
- IMG=kuberay/operator:nightly make deploy
- kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
# Run e2e tests
- KUBERAY_TEST_TIMEOUT_SHORT=1m KUBERAY_TEST_TIMEOUT_MEDIUM=5m KUBERAY_TEST_TIMEOUT_LONG=10m go test -timeout 30m -v ./test/e2e
# Printing KubeRay operator logs
- kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay

- label: 'Test Autoscaler E2E (nightly operator)'
instance_size: large
image: golang:1.22
commands:
- source .buildkite/setup-env.sh
- kind create cluster --wait 900s --config ./tests/framework/config/kind-config-buildkite.yml
- kubectl config set clusters.kind-kind.server https://docker:6443
# Build nightly KubeRay operator image
- pushd ray-operator
- IMG=kuberay/operator:nightly make docker-image
- kind load docker-image kuberay/operator:nightly
- IMG=kuberay/operator:nightly make deploy
- kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
# Run e2e tests
- KUBERAY_TEST_TIMEOUT_SHORT=1m KUBERAY_TEST_TIMEOUT_MEDIUM=5m KUBERAY_TEST_TIMEOUT_LONG=10m go test -timeout 30m -v ./test/e2eautoscaler
# Printing KubeRay operator logs
- kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay
19 changes: 0 additions & 19 deletions .buildkite/test-sample-yamls.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
#ci:group=:yaml: Sample YAML tests
- label: 'Test Autoscaler E2E (nightly operator)'
instance_size: large
image: golang:1.22
commands:
- source .buildkite/setup-env.sh
- kind create cluster --wait 900s --config ./tests/framework/config/kind-config-buildkite.yml
- kubectl config set clusters.kind-kind.server https://docker:6443
# Build nightly KubeRay operator image
- pushd ray-operator
- IMG=kuberay/operator:nightly make docker-image
- kind load docker-image kuberay/operator:nightly
- IMG=kuberay/operator:nightly make deploy
- kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
# Run e2e tests
- KUBERAY_TEST_TIMEOUT_SHORT=1m KUBERAY_TEST_TIMEOUT_MEDIUM=5m KUBERAY_TEST_TIMEOUT_LONG=10m go test -timeout 30m -v ./test/e2eautoscaler
# Printing KubeRay operator logs
- kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay

- label: 'Test Sample YAMLs (nightly operator)'
instance_size: large
image: golang:1.22
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/e2e-tests.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
name: e2e test reusable workflow
name: kubectl plugin e2e test

on:
workflow_call:
inputs:
plugin-test:
required: true
type: boolean
dir-to-test:
required: true
type: string
ray-version:
required: false
type: string
pull_request:
branches:
- master
- 'release-*'
paths-ignore:
- 'apiserver/**'
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
push:
branches:
- master
- 'release-*'
paths-ignore:
- 'apiserver/**'
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'

jobs:
build:
Expand All @@ -36,19 +45,16 @@ jobs:
uses: ./.github/workflows/actions/kind

- name: Set up Python
if: inputs.plugin-test
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Ray
if: inputs.plugin-test
run: |
python --version
pip install -U "ray[default]==${{ inputs.ray-version }}"
pip install -U "ray[default]==2.40.0"
- name: Build CLI and Add to PATH
if: inputs.plugin-test
run: |
cd ./kubectl-plugin
Expand All @@ -71,7 +77,6 @@ jobs:
kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
- name: Deploy Kuberay Cluster
if: inputs.plugin-test
run: |
echo Deploying Kuberay cluster
Expand All @@ -88,18 +93,12 @@ jobs:
echo "KUBERAY_TEST_OUTPUT_DIR=${KUBERAY_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
set -euo pipefail
cd ${{ inputs.dir-to-test }}
cd kubectl-plugin
go test -timeout 60m -v ./test/e2e -json 2>&1 | tee ${KUBERAY_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
- name: Print KubeRay operator logs
if: (!inputs.plugin-test) && always() && steps.deploy.outcome == 'success'
run: |
echo "Printing KubeRay operator logs"
kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay | tee ${KUBERAY_TEST_OUTPUT_DIR}/kuberay-operator.log
- name: Upload logs
uses: actions/upload-artifact@v4
if: (!inputs.plugin-test) && always() && steps.deploy.outcome == 'success'
if: always() && steps.deploy.outcome == 'success'
with:
name: logs
retention-days: 10
Expand Down

0 comments on commit 353e87f

Please sign in to comment.