Skip to content

Commit 28a02a0

Browse files
Merge remote-tracking branch 'pcf-cfo/main' into synctoODH
2 parents d82a77d + 6ccf23e commit 28a02a0

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: e2e
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'release-*'
8+
paths-ignore:
9+
- 'docs/**'
10+
- '**.adoc'
11+
- '**.md'
12+
- 'LICENSE'
13+
push:
14+
branches:
15+
- main
16+
- 'release-*'
17+
paths-ignore:
18+
- 'docs/**'
19+
- '**.adoc'
20+
- '**.md'
21+
- 'LICENSE'
22+
23+
concurrency:
24+
group: ${{ github.head_ref }}-${{ github.workflow }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
kubernetes-e2e:
29+
30+
runs-on: ubuntu-20.04-4core-gpu
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
submodules: recursive
37+
38+
- name: Checkout common repo code
39+
uses: actions/checkout@v4
40+
with:
41+
repository: 'project-codeflare/codeflare-common'
42+
ref: 'main'
43+
path: 'common'
44+
45+
- name: Set Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version-file: './go.mod'
49+
50+
- name: Set up gotestfmt
51+
uses: gotesttools/gotestfmt-action@v2
52+
with:
53+
token: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Setup NVidia GPU environment for KinD
56+
uses: ./common/github-actions/nvidia-gpu-setup
57+
58+
- name: Setup and start KinD cluster
59+
id: kind-install
60+
uses: ./common/github-actions/kind
61+
62+
- name: Install NVidia GPU operator for KinD
63+
uses: ./common/github-actions/nvidia-gpu-operator
64+
65+
- name: Deploy CodeFlare stack
66+
id: deploy
67+
run: |
68+
echo Setting up CodeFlare stack
69+
make setup-e2e
70+
71+
echo Deploying CodeFlare operator
72+
IMG=localhost/codeflare-operator:test
73+
make image-build -e IMG="${IMG}"
74+
podman save -o cfo.tar ${IMG}
75+
kind load image-archive cfo.tar --name cluster --verbosity 1000
76+
make deploy -e IMG="${IMG}" -e ENV="e2e"
77+
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager
78+
79+
- name: Run e2e tests
80+
run: |
81+
export CODEFLARE_TEST_TIMEOUT_SHORT=3m
82+
export CODEFLARE_TEST_TIMEOUT_MEDIUM=10m
83+
export CODEFLARE_TEST_TIMEOUT_LONG=20m
84+
export CODEFLARE_TEST_TIMEOUT_GPU_PROVISIONING=30m
85+
86+
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
87+
88+
set -euo pipefail
89+
go test -timeout 60m -v -skip "^Test.*Cpu$" ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
90+
91+
- name: Print CodeFlare operator logs
92+
if: always() && steps.deploy.outcome == 'success'
93+
run: |
94+
echo "Printing CodeFlare operator logs"
95+
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${TEMP_DIR}/codeflare-operator.log
96+
97+
- name: Print Kueue operator logs
98+
if: always() && steps.deploy.outcome == 'success'
99+
run: |
100+
echo "Printing Kueue operator logs"
101+
KUEUE_CONTROLLER_POD=$(kubectl get pods -n kueue-system | grep kueue-controller | awk '{print $1}')
102+
kubectl logs -n kueue-system --tail -1 ${KUEUE_CONTROLLER_POD} | tee ${TEMP_DIR}/kueue.log
103+
104+
- name: Print KubeRay operator logs
105+
if: always() && steps.deploy.outcome == 'success'
106+
run: |
107+
echo "Printing KubeRay operator logs"
108+
kubectl logs -n ray-system --tail -1 -l app.kubernetes.io/name=kuberay | tee ${TEMP_DIR}/kuberay.log
109+
110+
- name: Export all KinD pod logs
111+
uses: ./common/github-actions/kind-export-logs
112+
if: always() && steps.kind-install.outcome == 'success'
113+
with:
114+
output-directory: ${TEMP_DIR}
115+
116+
- name: Upload logs
117+
uses: actions/upload-artifact@v4
118+
if: always() && steps.kind-install.outcome == 'success'
119+
with:
120+
name: logs
121+
retention-days: 10
122+
path: |
123+
${{ env.TEMP_DIR }}/**/*.log
124+
125+
- name: Post notification about failure to a Slack channel in case of push event
126+
if: failure() && github.event_name == 'push'
127+
uses: slackapi/[email protected]
128+
with:
129+
channel-id: "codeflare-nightlies"
130+
slack-message: "e2e test on push failed, <https://github.com/project-codeflare/codeflare-operator/actions/workflows/e2e_tests.yaml|View workflow runs>"
131+
env:
132+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)