Skip to content

Commit

Permalink
Add GitAction for nightly workflow (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinae-woo authored May 21, 2024
2 parents f777993 + 7fe90a9 commit 985aa1a
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions docs/examples/kueue/kueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/ci/test_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions tests/ci/test_kueue.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/ci/test_volcano.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 985aa1a

Please sign in to comment.