Skip to content

Commit be863a8

Browse files
feat(testing): use kustomize to patch deployments before deploy (#11294)
* Use kustomize to patch deployments before deploy Signed-off-by: carter.fendley <carter.fendley@gmail.com> * Relocate scripts / manifests to github directory Signed-off-by: carter.fendley <carter.fendley@gmail.com> --------- Signed-off-by: carter.fendley <carter.fendley@gmail.com>
1 parent aec2856 commit be863a8

29 files changed

+66
-49
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ runs:
1414

1515
- name: Build images
1616
shell: bash
17-
run: ./scripts/deploy/github/build-images.sh
17+
run: ./.github/resources/scripts/build-images.sh
1818

1919
- name: Deploy KFP
2020
shell: bash
21-
run: ./scripts/deploy/github/deploy-kfp.sh
21+
run: ./.github/resources/scripts/deploy-kfp.sh

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ runs:
1414

1515
- name: Build images
1616
shell: bash
17-
run: ./scripts/deploy/github/build-images.sh
17+
run: ./.github/resources/scripts/build-images.sh
1818

1919
- name: Deploy KFP
2020
shell: bash
21-
run: ./scripts/deploy/github/deploy-kfp-tekton.sh
21+
run: ./.github/resources/scripts/deploy-kfp-tekton.sh
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../../../manifests/kustomize/env/platform-agnostic
6+
7+
images:
8+
- name: gcr.io/ml-pipeline/api-server
9+
newName: kind-registry:5000/apiserver
10+
newTag: latest
11+
- name: gcr.io/ml-pipeline/persistenceagent
12+
newName: kind-registry:5000/persistenceagent
13+
newTag: latest
14+
- name: gcr.io/ml-pipeline/scheduledworkflow
15+
newName: kind-registry:5000/scheduledworkflow
16+
newTag: latest
17+
18+
patchesStrategicMerge:
19+
- overlays/apiserver-env.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: ml-pipeline
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: ml-pipeline-api-server
10+
env:
11+
- name: V2_DRIVER_IMAGE
12+
value: kind-registry:5000/driver
13+
- name: V2_LAUNCHER_IMAGE
14+
value: kind-registry:5000/launcher

scripts/deploy/github/deploy-kfp-tekton.sh renamed to .github/resources/scripts/deploy-kfp-tekton.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ then
3333
fi
3434

3535
# Deploy manifest
36-
kubectl apply -k "scripts/deploy/github/manifests" || EXIT_CODE=$?
36+
TEST_MANIFESTS=".github/resources/manifests/tekton"
37+
kubectl apply -k "${TEST_MANIFESTS}" || EXIT_CODE=$?
3738
if [[ $EXIT_CODE -ne 0 ]]
3839
then
3940
echo "Deploy unsuccessful. Failure applying $KUSTOMIZE_DIR."

scripts/deploy/github/deploy-kfp.sh renamed to .github/resources/scripts/deploy-kfp.sh

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,15 @@ then
3232
exit $EXIT_CODE
3333
fi
3434

35-
PLATFORM_AGNOSTIC_MANIFESTS="manifests/kustomize/env/platform-agnostic"
36-
37-
kubectl apply -k "${PLATFORM_AGNOSTIC_MANIFESTS}" || EXIT_CODE=$?
35+
# Deploy manifest
36+
TEST_MANIFESTS=".github/resources/manifests/argo"
37+
kubectl apply -k "${TEST_MANIFESTS}" || EXIT_CODE=$?
3838
if [[ $EXIT_CODE -ne 0 ]]
3939
then
40-
echo "Deploy unsuccessful. Failure applying ${PLATFORM_AGNOSTIC_MANIFESTS}."
40+
echo "Deploy unsuccessful. Failure applying ${TEST_MANIFESTS}."
4141
exit 1
4242
fi
4343

44-
echo "Patching deployments to use built docker images..."
45-
# Patch API server
46-
kubectl patch deployment ml-pipeline -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-api-server", "image": "kind-registry:5000/apiserver"}]}}}}' -n kubeflow
47-
# Patch persistence agent
48-
kubectl patch deployment.apps/ml-pipeline-persistenceagent -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-persistenceagent", "image": "kind-registry:5000/persistenceagent"}]}}}}' -n kubeflow
49-
# Patch scheduled workflow
50-
kubectl patch deployment.apps/ml-pipeline-scheduledworkflow -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-scheduledworkflow", "image": "kind-registry:5000/scheduledworkflow"}]}}}}' -n kubeflow
51-
52-
# Update environment variables to override driver / launcher
53-
kubectl set env deployments/ml-pipeline V2_DRIVER_IMAGE=kind-registry:5000/driver -n kubeflow
54-
kubectl set env deployments/ml-pipeline V2_LAUNCHER_IMAGE=kind-registry:5000/launcher -n kubeflow
55-
5644
# Check if all pods are running - (10 minutes)
5745
wait_for_pods || EXIT_CODE=$?
5846
if [[ $EXIT_CODE -ne 0 ]]
File renamed without changes.

.github/workflows/backend.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '.github/workflows/backend.yml'
1111
- 'go.mod'
1212
- 'backend/**'
13-
- 'scripts/deploy/github/**'
13+
- '.github/resources/**'
1414
- 'manifests/kustomize/**'
1515

1616
env:
@@ -48,23 +48,23 @@ jobs:
4848
- name: "flip coin test"
4949
run: |
5050
. .venv/bin/activate
51-
TEST_SCRIPT="test-flip-coin.sh" ./scripts/deploy/github/e2e-test.sh
51+
TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh
5252
- name: "static loop test"
5353
run: |
5454
. .venv/bin/activate
55-
TEST_SCRIPT="test-static-loop.sh" ./scripts/deploy/github/e2e-test.sh
55+
TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh
5656
- name: "dynamic loop test"
5757
run: |
5858
. .venv/bin/activate
59-
TEST_SCRIPT="test-dynamic-loop.sh" ./scripts/deploy/github/e2e-test.sh
59+
TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh
6060
- name: "use env"
6161
run: |
6262
. .venv/bin/activate
63-
TEST_SCRIPT="test-env.sh" ./scripts/deploy/github/e2e-test.sh
63+
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh
6464
- name: "use volume"
6565
run: |
6666
. .venv/bin/activate
67-
TEST_SCRIPT="test-volume.sh" ./scripts/deploy/github/e2e-test.sh
67+
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh
6868
- name: Collect test results
6969
if: always()
7070
uses: actions/upload-artifact@v4

.github/workflows/e2e-test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
paths:
99
- '.github/workflows/e2e-test.yml'
10-
- 'scripts/deploy/github/**'
10+
- '.github/resources/**'
1111
- 'go.mod'
1212
- 'go.sum'
1313
- 'backend/**'
@@ -32,7 +32,7 @@ jobs:
3232
uses: ./.github/actions/kfp-cluster
3333

3434
- name: Forward API port
35-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
35+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
3636

3737
- name: Initialization tests v1
3838
working-directory: ./backend/test/initialization
@@ -60,7 +60,7 @@ jobs:
6060
uses: ./.github/actions/kfp-cluster
6161

6262
- name: Forward API port
63-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
63+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
6464

6565
- name: Initialization tests v2
6666
working-directory: ./backend/test/v2/initialization
@@ -88,7 +88,7 @@ jobs:
8888
uses: ./.github/actions/kfp-cluster
8989

9090
- name: Forward API port
91-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
91+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
9292

9393
- name: API integration tests v1
9494
working-directory: ./backend/test/integration
@@ -116,7 +116,7 @@ jobs:
116116
uses: ./.github/actions/kfp-cluster
117117

118118
- name: Forward API port
119-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
119+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
120120

121121
- name: API integration tests v2
122122
working-directory: ./backend/test/v2/integration
@@ -144,10 +144,10 @@ jobs:
144144
uses: ./.github/actions/kfp-cluster
145145

146146
- name: Forward API port
147-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
147+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
148148

149149
- name: Forward Frontend port
150-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline-ui" 3000 3000
150+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline-ui" 3000 3000
151151

152152
- name: Build frontend integration tests image
153153
working-directory: ./test/frontend-integration-test
@@ -178,7 +178,7 @@ jobs:
178178
uses: ./.github/actions/kfp-cluster
179179

180180
- name: Forward API port
181-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
181+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
182182

183183
- name: Install prerequisites
184184
run: pip3 install -r ./test/sample-test/requirements.txt

.github/workflows/kfp-kubernetes-execution-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
paths:
99
- '.github/workflows/kfp-kubernetes-execution-tests.yml'
10-
- 'scripts/deploy/github/**'
10+
- '.github/resources/**'
1111
- 'sdk/python/**'
1212
- 'api/v2alpha1/**'
1313
- 'kubernetes_platform/**'
@@ -28,7 +28,7 @@ jobs:
2828
uses: ./.github/actions/kfp-cluster
2929

3030
- name: Forward API port
31-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
31+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
3232

3333
- name: apt-get update
3434
run: sudo apt-get update

.github/workflows/kfp-samples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
pull_request:
88
paths:
9-
- 'scripts/deploy/github/**'
9+
- '.github/resources/**'
1010
- 'samples/**'
1111
- 'backend/src/v2/**'
1212
- '.github/workflows/kfp-samples.yml'
@@ -28,7 +28,7 @@ jobs:
2828
uses: ./.github/actions/kfp-cluster
2929

3030
- name: Forward API port
31-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
31+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
3232

3333
- name: Run Samples Tests
3434
run: |

.github/workflows/kubeflow-pipelines-integration-v2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
paths:
99
- '.github/workflows/kubeflow-pipelines-integration-v2.yml'
10-
- 'scripts/deploy/github/**'
10+
- '.github/resources/**'
1111
- 'samples/core/parameterized_tfx_oss/**'
1212
- 'samples/core/dataflow/**'
1313
- 'backend/**'
@@ -32,7 +32,7 @@ jobs:
3232
uses: ./.github/actions/kfp-cluster
3333

3434
- name: Forward API port
35-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
35+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
3636

3737
- name: Run the Integration Tests
3838
run: |

.github/workflows/sdk-execution.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
paths:
99
- '.github/workflows/sdk-execution.yml'
10-
- 'scripts/deploy/github/**'
10+
- '.github/resources/**'
1111
- 'sdk/python/**'
1212
- 'api/v2alpha1/**'
1313

@@ -27,7 +27,7 @@ jobs:
2727
uses: ./.github/actions/kfp-cluster
2828

2929
- name: Forward API port
30-
run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
30+
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
3131

3232
- name: apt-get update
3333
run: sudo apt-get update

.github/workflows/upgrade-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
paths:
99
- '.github/workflows/upgrade-test.yml'
10-
- 'scripts/deploy/github/**'
10+
- '.github/resources/**'
1111
- 'backend/**'
1212
- 'manifests/kustomize/**'
1313

scripts/OWNERS

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)