forked from opendatahub-io/data-science-pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (124 loc) · 4.67 KB
/
Copy pathupgrade-test.yml
File metadata and controls
142 lines (124 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: KFP upgrade tests
env:
TESTS_DIR: "./backend/test/v2/api"
TESTS_LABEL: "ApiServerTests"
NUMBER_OF_PARALLEL_NODES: 15
CLUSTER_NAME: "kfp"
NAMESPACE: "kubeflow"
PYTHON_VERSION: "3.9"
on:
push:
branches: [master]
pull_request:
paths:
- '.github/workflows/upgrade-test.yml'
- '.github/workflows/image-builds.yml'
- '.github/actions/create-cluster/**'
- '.github/actions/deploy/**'
- '.github/resources/**'
- 'backend/api/v2beta1/**'
- 'backend/src/**'
- 'backend/metadata_writer/**'
- 'backend/test/v2/api/**'
- 'manifests/kustomize/**'
- 'test_data/sdk_compiled_pipelines/**'
- '!**/*.md'
- '!**/OWNERS'
jobs:
build:
uses: ./.github/workflows/image-builds.yml
upgrade-test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
k8s_version: [ "v1.34.0" ]
name: KFP upgrade tests - K8s ${{ matrix.k8s_version }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Get last release tag
shell: bash
id: get-tag
run: |
lastRelease=""
for attempt in 1 2 3; do
lastRelease=$(curl -sSL --fail-with-body --connect-timeout 10 --max-time 60 \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
"https://api.github.com/repos/kubeflow/pipelines/releases/latest" | jq -r .tag_name 2>/dev/null || echo "")
if [[ -n "$lastRelease" && "$lastRelease" != "null" ]]; then
break
fi
if [[ "$attempt" -lt 3 ]]; then
echo "Attempt $attempt: Failed to fetch release tag. Retrying in 5s..."
sleep 5
fi
done
if [[ -z "$lastRelease" || "$lastRelease" == "null" ]]; then
echo "::error::Could not fetch latest release tag from GitHub API after 3 attempts."
exit 1
fi
echo "Fetched last release tag: $lastRelease"
echo "lastRelease=$lastRelease" >> "$GITHUB_OUTPUT"
- name: Create cluster
uses: ./.github/actions/create-cluster
id: create-cluster
with:
k8s_version: ${{ matrix.k8s_version }}
- name: Deploy Last Release
shell: bash
id: deploy-release
run: |
kubectl apply -k https://github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=${{ steps.get-tag.outputs.lastRelease }}
kubectl apply -k https://github.com/kubeflow/pipelines/manifests/kustomize/env/platform-agnostic?ref=${{ steps.get-tag.outputs.lastRelease }}
source "./.github/resources/scripts/helper-functions.sh"
wait_for_pods || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Deploy unsuccessful. Not all pods running."
exit 1
fi
- name: Forward API port
id: forward-api-port
if: ${{ steps.deploy-release.outcome == 'success' }}
shell: bash
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
continue-on-error: true
- name: Prepare for Upgrade
id: prepare-upgrade
if: ${{ steps.forward-api-port.outcome == 'success' }}
working-directory: ${{ env.TESTS_DIR }}
run: |
go run github.com/onsi/ginkgo/v2/ginkgo -r -v --cover -p --keep-going --github-output=true --nodes=${{ env.NUMBER_OF_PARALLEL_NODES }} -v --label-filter="UpgradePreparation"
continue-on-error: true
- name: Stop port forwarding
run: |
pkill -f "port-forward"
continue-on-error: true
- name: Deploy from Branch
uses: ./.github/actions/deploy
if: ${{ steps.create-cluster.outcome == 'success' }}
id: deploy
with:
image_path: ${{ needs.build.outputs.IMAGE_PATH }}
image_tag: ${{ needs.build.outputs.IMAGE_TAG }}
image_registry: ${{ needs.build.outputs.IMAGE_REGISTRY }}
forward_port: 'true'
- name: Verify Upgrade
uses: ./.github/actions/test-and-report
if: ${{ steps.deploy.outcome == 'success' }}
with:
test_directory: ${{ env.TESTS_DIR }}
test_label: "UpgradeVerification"
num_parallel_nodes: ${{ env.NUMBER_OF_PARALLEL_NODES }}
default_namespace: ${{ env.NAMESPACE }}
python_version: ${{ env.PYTHON_VERSION }}
report_name: "Upgrade Verification"