Skip to content

[RayCluster][CI] add e2e tests for the RayClusterSuspended status condition #122

[RayCluster][CI] add e2e tests for the RayClusterSuspended status condition

[RayCluster][CI] add e2e tests for the RayClusterSuspended status condition #122

name: kubectl plugin e2e test
on:
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:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: v1.22
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup and start KinD cluster
uses: ./.github/workflows/actions/kind
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Ray
run: |
python --version
pip install -U "ray[default]==2.40.0"
- name: Build CLI and Add to PATH
run: |
cd ./kubectl-plugin
go mod download
go build -o kubectl-ray -a ./cmd/kubectl-ray.go
cp ./kubectl-ray /usr/local/bin
- name: Deploy Kuberay operator
id: deploy
run: |
echo Deploying Kuberay operator
cd ray-operator
IMG="${REGISTRY_ADDRESS}"/kuberay
make docker-build -e IMG="${IMG}" -e ENGINE=podman
make docker-push -e IMG="${IMG}" -e ENGINE=podman
make deploy -e IMG="${IMG}"
kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
- name: Deploy Kuberay Cluster
run: |
echo Deploying Kuberay cluster
kubectl apply -f ./ray-operator/config/samples/ray-cluster.sample.yaml
kubectl wait --timeout=300s --for=condition=ready pod -l ray.io/cluster=raycluster-kuberay
- name: Run e2e tests
run: |
export KUBERAY_TEST_TIMEOUT_SHORT=1m
export KUBERAY_TEST_TIMEOUT_MEDIUM=5m
export KUBERAY_TEST_TIMEOUT_LONG=10m
export KUBERAY_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
echo "KUBERAY_TEST_OUTPUT_DIR=${KUBERAY_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
set -euo pipefail
cd kubectl-plugin
go test -timeout 60m -v ./test/e2e -json 2>&1 | tee ${KUBERAY_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
- name: Upload logs
uses: actions/upload-artifact@v4
if: always() && steps.deploy.outcome == 'success'
with:
name: logs
retention-days: 10
path: |
${{ env.KUBERAY_TEST_OUTPUT_DIR }}/**/*.log