diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6842a1c..ccb806c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,10 +15,6 @@ on: branches: - main -env: - KWOK_REPO: kubernetes-sigs/kwok - KWOK_LATEST_RELEASE: v0.5.2 - jobs: check: runs-on: ubuntu-latest diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..cdb6abd --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,50 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Nightly + +on: + workflow_dispatch: + schedule: + - cron: "05 07 * * *" # Everyday 07:05 AM UTC + +jobs: + test-volcano: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make build + + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1 + + - name: Run test scripts + run: | + ./tests/ci/test_volcano.sh + + test-kueue: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make build + + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1 + + - name: Run test scripts + run: | + ./tests/ci/test_kueue.sh diff --git a/docs/examples/kueue/kueue.md b/docs/examples/kueue/kueue.md index 94d7a5e..633e861 100644 --- a/docs/examples/kueue/kueue.md +++ b/docs/examples/kueue/kueue.md @@ -14,8 +14,8 @@ Install kueue by following these [instructions](https://kueue.sigs.k8s.io/docs/i ```bash KUEUE_VERSION=v0.6.2 -kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/$KUEUE_VERSION/manifests.yaml -kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/$KUEUE_VERSION/prometheus.yaml +kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/manifests.yaml +kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/prometheus.yaml ``` ## Deploy cluster and local queues diff --git a/tests/ci/test_k8s.sh b/tests/ci/test_k8s.sh index 1ec6455..546df79 100755 --- a/tests/ci/test_k8s.sh +++ b/tests/ci/test_k8s.sh @@ -6,8 +6,8 @@ REPO_HOME=$(readlink -f $(dirname $(readlink -f "$0"))/../../) KWOK_REPO=kubernetes-sigs/kwok KWOK_LATEST_RELEASE=v0.5.2 -kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml" -kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml" +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-init-container-running-failed.yaml kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-container-running-failed.yaml kubectl apply -f ${REPO_HOME}/charts/overrides/kwok/pod-complete.yml diff --git a/tests/ci/test_kueue.sh b/tests/ci/test_kueue.sh new file mode 100755 index 0000000..90a7b96 --- /dev/null +++ b/tests/ci/test_kueue.sh @@ -0,0 +1,29 @@ +#! /bin/bash -x + +REPO_HOME=$(readlink -f $(dirname $(readlink -f "$0"))/../../) + +# Install KWOK node simulator +KWOK_REPO=kubernetes-sigs/kwok +KWOK_LATEST_RELEASE=v0.5.2 + +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-init-container-running-failed.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-container-running-failed.yaml +kubectl apply -f ${REPO_HOME}/charts/overrides/kwok/pod-complete.yml + +# Install Kueue +KUEUE_VERSION=v0.6.2 + +kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/manifests.yaml +kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/prometheus.yaml + +# Wait until kueue webhook is ready +# TODO: we need a deterministric way to check if it's ready +sleep 10 + +# Deploy cluster and local queues +kubectl apply -f ${REPO_HOME}/docs/examples/kueue/queues.yml + +# Run knavigator with an example test +${REPO_HOME}/bin/knavigator -tasks ${REPO_HOME}/resources/tests/kueue/test-job.yml diff --git a/tests/ci/test_volcano.sh b/tests/ci/test_volcano.sh new file mode 100755 index 0000000..3b8138c --- /dev/null +++ b/tests/ci/test_volcano.sh @@ -0,0 +1,24 @@ +#! /bin/bash -x + +REPO_HOME=$(readlink -f $(dirname $(readlink -f "$0"))/../../) + +# Install KWOK node simulator +KWOK_REPO=kubernetes-sigs/kwok +KWOK_LATEST_RELEASE=v0.5.2 + +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-init-container-running-failed.yaml +kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-container-running-failed.yaml +kubectl apply -f ${REPO_HOME}/charts/overrides/kwok/pod-complete.yml + +# Install Volcano +helm repo add volcano-sh https://volcano-sh.github.io/helm-charts +helm install volcano volcano-sh/volcano -n volcano-system --create-namespace --wait + +# Wait until volcano webhook is ready +# TODO: we need a deterministric way to check if it's ready +sleep 10 + +# Run knavigator with an example test +${REPO_HOME}/bin/knavigator -tasks ${REPO_HOME}/resources/tests/volcano/test-job.yml