Skip to content

Commit b14eca9

Browse files
changes made to run kfp e2e tests on ppc64le
Signed-off-by: Valen Mascarenhas <[email protected]>
1 parent cb07619 commit b14eca9

File tree

52 files changed

+1091
-1191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1091
-1191
lines changed

.github/actions/kfp-cluster/action.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ runs:
1010
using: "composite"
1111
steps:
1212
- name: Create k8s Kind Cluster
13-
uses: container-tools/kind-action@v2
14-
with:
15-
cluster_name: kfp
16-
kubectl_version: ${{ inputs.k8s_version }}
17-
version: v0.25.0
18-
node_image: kindest/node:${{ inputs.k8s_version }}
19-
20-
- name: Build images
2113
shell: bash
22-
run: ./.github/resources/scripts/build-images.sh
14+
run: kind create cluster --image quay.io/powercloud/kind-node:${{ inputs.k8s_version }} --config /home/ubuntu/pipelines/config.yaml
15+
16+
# - name: Build images
17+
# shell: bash
18+
# run: ./.github/resources/scripts/build-images.sh
2319

2420
- name: Deploy KFP
2521
shell: bash

.github/workflows/e2e-test.yml

Lines changed: 23 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,15 @@ on:
1818

1919
jobs:
2020
initialization-tests-v1:
21-
runs-on: ubuntu-latest
21+
runs-on: self-hosted
2222
strategy:
2323
matrix:
24-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
24+
k8s_version: [ "v1.30.2", "v1.31.0" ]
2525
name: Initialization tests v1 - K8s ${{ matrix.k8s_version }}
2626
steps:
2727
- name: Checkout code
2828
uses: actions/checkout@v4
2929

30-
- name: Set up Python
31-
uses: actions/setup-python@v4
32-
with:
33-
python-version: 3.9
34-
3530
- name: Create KFP cluster
3631
uses: ./.github/actions/kfp-cluster
3732
with:
@@ -51,27 +46,25 @@ jobs:
5146
name: kfp-initialization-tests-v1-artifacts-k8s-${{ matrix.k8s_version }}
5247
path: /tmp/tmp.*/*
5348

49+
- name: Delete KFP cluster
50+
shell: bash
51+
run: kind delete cluster
52+
5453
initialization-tests-v2:
55-
runs-on: ubuntu-latest
54+
runs-on: self-hosted
5655
strategy:
5756
matrix:
58-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
57+
k8s_version: [ "v1.30.2", "v1.31.0" ]
5958
name: Initialization tests v2 - K8s ${{ matrix.k8s_version }}
6059
steps:
6160
- name: Checkout code
6261
uses: actions/checkout@v4
6362

64-
- name: Set up Python
65-
uses: actions/setup-python@v4
66-
with:
67-
python-version: 3.9
68-
6963
- name: Create KFP cluster
7064
uses: ./.github/actions/kfp-cluster
7165
with:
7266
k8s_version: ${{ matrix.k8s_version }}
7367

74-
7568
- name: Forward API port
7669
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
7770

@@ -86,21 +79,20 @@ jobs:
8679
name: kfp-initialization-tests-v2-artifacts-k8s-${{ matrix.k8s_version }}
8780
path: /tmp/tmp.*/*
8881

82+
- name: Delete KFP cluster
83+
shell: bash
84+
run: kind delete cluster
85+
8986
api-integration-tests-v1:
90-
runs-on: ubuntu-latest
87+
runs-on: self-hosted
9188
strategy:
9289
matrix:
93-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
90+
k8s_version: [ "v1.30.2", "v1.31.0" ]
9491
name: API integration tests v1 - K8s ${{ matrix.k8s_version }}
9592
steps:
9693
- name: Checkout code
9794
uses: actions/checkout@v4
9895

99-
- name: Set up Python
100-
uses: actions/setup-python@v4
101-
with:
102-
python-version: 3.9
103-
10496
- name: Create KFP cluster
10597
uses: ./.github/actions/kfp-cluster
10698
with:
@@ -120,21 +112,20 @@ jobs:
120112
name: kfp-api-integration-tests-v1-artifacts-k8s-${{ matrix.k8s_version }}
121113
path: /tmp/tmp.*/*
122114

115+
- name: Delete KFP cluster
116+
shell: bash
117+
run: kind delete cluster
118+
123119
api-integration-tests-v2:
124-
runs-on: ubuntu-latest
120+
runs-on: self-hosted
125121
strategy:
126122
matrix:
127-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
123+
k8s_version: [ "v1.30.2", "v1.31.0" ]
128124
name: API integration tests v2 - K8s ${{ matrix.k8s_version }}
129125
steps:
130126
- name: Checkout code
131127
uses: actions/checkout@v4
132128

133-
- name: Set up Python
134-
uses: actions/setup-python@v4
135-
with:
136-
python-version: 3.9
137-
138129
- name: Create KFP cluster
139130
uses: ./.github/actions/kfp-cluster
140131
with:
@@ -154,81 +145,6 @@ jobs:
154145
name: kfp-api-integration-tests-v2-artifacts-k8s-${{ matrix.k8s_version }}
155146
path: /tmp/tmp.*/*
156147

157-
frontend-integration-test:
158-
runs-on: ubuntu-latest
159-
strategy:
160-
matrix:
161-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
162-
name: Frontend Integration Tests - K8s ${{ matrix.k8s_version }}
163-
steps:
164-
- name: Checkout code
165-
uses: actions/checkout@v4
166-
167-
- name: Set up Python
168-
uses: actions/setup-python@v4
169-
with:
170-
python-version: 3.9
171-
172-
- name: Create KFP cluster
173-
uses: ./.github/actions/kfp-cluster
174-
with:
175-
k8s_version: ${{ matrix.k8s_version }}
176-
177-
- name: Forward API port
178-
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
179-
180-
- name: Forward Frontend port
181-
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline-ui" 3000 3000
182-
183-
- name: Build frontend integration tests image
184-
working-directory: ./test/frontend-integration-test
185-
run: docker build . -t kfp-frontend-integration-test:local
186-
187-
- name: Frontend integration tests
188-
run: docker run --net=host kfp-frontend-integration-test:local --remote-run true
189-
190-
- name: Collect test results
191-
if: always()
192-
uses: actions/upload-artifact@v4
193-
with:
194-
name: kfp-frontend-integration-test-artifacts-k8s-${{ matrix.k8s_version }}
195-
path: /tmp/tmp.*/*
196-
197-
basic-sample-tests:
198-
runs-on: ubuntu-latest
199-
strategy:
200-
matrix:
201-
k8s_version: [ "v1.29.2", "v1.30.2", "v1.31.0" ]
202-
name: Basic Sample Tests - K8s ${{ matrix.k8s_version }}
203-
steps:
204-
- name: Checkout code
205-
uses: actions/checkout@v4
206-
207-
- name: Set up Python
208-
uses: actions/setup-python@v4
209-
with:
210-
python-version: 3.9
211-
212-
- name: Create KFP cluster
213-
uses: ./.github/actions/kfp-cluster
214-
with:
215-
k8s_version: ${{ matrix.k8s_version }}
216-
217-
- name: Forward API port
218-
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
219-
220-
- name: Install prerequisites
221-
run: pip3 install -r ./test/sample-test/requirements.txt
222-
223-
- name: Basic sample tests - sequential
224-
run: python3 ./test/sample-test/sample_test_launcher.py sample_test run_test --namespace kubeflow --test-name sequential --results-gcs-dir output
225-
226-
- name: Basic sample tests - exit_handler
227-
run: python3 ./test/sample-test/sample_test_launcher.py sample_test run_test --namespace kubeflow --test-name exit_handler --results-gcs-dir output
228-
229-
- name: Collect test results
230-
if: always()
231-
uses: actions/upload-artifact@v4
232-
with:
233-
name: kfp-basic-sample-tests-artifacts-k8s-${{ matrix.k8s_version }}
234-
path: /tmp/tmp.*/*
148+
- name: Delete KFP cluster
149+
shell: bash
150+
run: kind delete cluster

backend/src/agent/persistence/worker/persistence_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Saver interface {
3939
}
4040

4141
type EventHandler interface {
42-
AddEventHandler(handler cache.ResourceEventHandler)
42+
AddEventHandler(handler cache.ResourceEventHandler) (cache.ResourceEventHandlerRegistration, error)
4343
}
4444

4545
// PersistenceWorker is a generic worker to persist objects from a queue.

backend/src/agent/persistence/worker/persistence_worker_test.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ import (
2727
"k8s.io/client-go/tools/cache"
2828
)
2929

30+
type FakeResourceEventHandlerRegistration struct{}
31+
32+
func (h *FakeResourceEventHandlerRegistration) HasSynced() bool {
33+
return true
34+
}
35+
36+
func NewFakeResourceEventHandlerRegistration() *FakeResourceEventHandlerRegistration {
37+
return &FakeResourceEventHandlerRegistration{}
38+
}
39+
3040
type FakeEventHandler struct {
3141
handler cache.ResourceEventHandler
3242
}
@@ -35,8 +45,9 @@ func NewFakeEventHandler() *FakeEventHandler {
3545
return &FakeEventHandler{}
3646
}
3747

38-
func (h *FakeEventHandler) AddEventHandler(handler cache.ResourceEventHandler) {
48+
func (h *FakeEventHandler) AddEventHandler(handler cache.ResourceEventHandler) (cache.ResourceEventHandlerRegistration, error) {
3949
h.handler = handler
50+
return NewFakeResourceEventHandlerRegistration(), nil
4051
}
4152

4253
func TestPersistenceWorker_Success(t *testing.T) {
@@ -65,7 +76,7 @@ func TestPersistenceWorker_Success(t *testing.T) {
6576
saver)
6677

6778
// Test
68-
eventHandler.handler.OnAdd(workflow)
79+
eventHandler.handler.OnAdd(workflow, true)
6980
worker.processNextWorkItem()
7081
assert.Equal(t, workflow, pipelineClient.GetWorkflow("MY_NAMESPACE", "MY_NAME"))
7182
assert.Equal(t, 0, worker.Len())
@@ -95,7 +106,7 @@ func TestPersistenceWorker_NotFoundError(t *testing.T) {
95106
saver)
96107

97108
// Test
98-
eventHandler.handler.OnAdd(workflow)
109+
eventHandler.handler.OnAdd(workflow, true)
99110
worker.processNextWorkItem()
100111
assert.Nil(t, pipelineClient.GetWorkflow("MY_NAMESPACE", "MY_NAME"))
101112
assert.Equal(t, 0, worker.Len())
@@ -126,7 +137,7 @@ func TestPersistenceWorker_GetWorklowError(t *testing.T) {
126137
saver)
127138

128139
// Test
129-
eventHandler.handler.OnAdd(workflow)
140+
eventHandler.handler.OnAdd(workflow, true)
130141
worker.processNextWorkItem()
131142
assert.Nil(t, pipelineClient.GetWorkflow("MY_NAMESPACE", "MY_NAME"))
132143
assert.Equal(t, 1, worker.Len())
@@ -160,7 +171,7 @@ func TestPersistenceWorker_ReportWorkflowRetryableError(t *testing.T) {
160171
saver)
161172

162173
// Test
163-
eventHandler.handler.OnAdd(workflow)
174+
eventHandler.handler.OnAdd(workflow, true)
164175
worker.processNextWorkItem()
165176
assert.Nil(t, pipelineClient.GetWorkflow("MY_NAMESPACE", "MY_NAME"))
166177
assert.Equal(t, 1, worker.Len())
@@ -193,7 +204,7 @@ func TestPersistenceWorker_ReportWorkflowNonRetryableError(t *testing.T) {
193204
saver)
194205

195206
// Test
196-
eventHandler.handler.OnAdd(workflow)
207+
eventHandler.handler.OnAdd(workflow, true)
197208
worker.processNextWorkItem()
198209
assert.Nil(t, pipelineClient.GetWorkflow("MY_NAMESPACE", "MY_NAME"))
199210
assert.Equal(t, 0, worker.Len())
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2024 The Kubeflow Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
package model
15+
16+
type CronSchedule struct {
17+
// Time at which scheduling starts.
18+
// If no start time is specified, the StartTime is the creation time of the schedule.
19+
CronScheduleStartTimeInSec *int64 `gorm:"column:CronScheduleStartTimeInSec;"`
20+
21+
// Time at which scheduling ends.
22+
// If no end time is specified, the EndTime is the end of time.
23+
CronScheduleEndTimeInSec *int64 `gorm:"column:CronScheduleEndTimeInSec;"`
24+
25+
// Cron string describing when a workflow should be created within the
26+
// time interval defined by StartTime and EndTime.
27+
Cron *string `gorm:"column:Schedule;"`
28+
}
29+
30+
func (c CronSchedule) IsEmpty() bool {
31+
return (c.CronScheduleStartTimeInSec == nil || *c.CronScheduleStartTimeInSec == 0) &&
32+
(c.CronScheduleEndTimeInSec == nil || *c.CronScheduleEndTimeInSec == 0) &&
33+
(c.Cron == nil || *c.Cron == "")
34+
}

backend/src/apiserver/model/job.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -189,34 +189,6 @@ type Trigger struct {
189189
PeriodicSchedule
190190
}
191191

192-
type CronSchedule struct {
193-
// Time at which scheduling starts.
194-
// If no start time is specified, the StartTime is the creation time of the schedule.
195-
CronScheduleStartTimeInSec *int64 `gorm:"column:CronScheduleStartTimeInSec;"`
196-
197-
// Time at which scheduling ends.
198-
// If no end time is specified, the EndTime is the end of time.
199-
CronScheduleEndTimeInSec *int64 `gorm:"column:CronScheduleEndTimeInSec;"`
200-
201-
// Cron string describing when a workflow should be created within the
202-
// time interval defined by StartTime and EndTime.
203-
Cron *string `gorm:"column:Schedule;"`
204-
}
205-
206-
type PeriodicSchedule struct {
207-
// Time at which scheduling starts.
208-
// If no start time is specified, the StartTime is the creation time of the schedule.
209-
PeriodicScheduleStartTimeInSec *int64 `gorm:"column:PeriodicScheduleStartTimeInSec;"`
210-
211-
// Time at which scheduling ends.
212-
// If no end time is specified, the EndTime is the end of time.
213-
PeriodicScheduleEndTimeInSec *int64 `gorm:"column:PeriodicScheduleEndTimeInSec;"`
214-
215-
// Interval describing when a workflow should be created within the
216-
// time interval defined by StartTime and EndTime.
217-
IntervalSecond *int64 `gorm:"column:IntervalSecond;"`
218-
}
219-
220192
func (j Job) GetValueOfPrimaryKey() string {
221193
return fmt.Sprint(j.UUID)
222194
}

0 commit comments

Comments
 (0)