Skip to content

Commit 69c4797

Browse files
authored
Merge branch 'master' into test_801715791
Signed-off-by: Alex <[email protected]>
2 parents f3ad3b0 + e094b5b commit 69c4797

File tree

220 files changed

+5646
-1037
lines changed

Some content is hidden

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

220 files changed

+5646
-1037
lines changed

.github/OWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ approvers:
22
- hbelmiro
33
- DharmitD
44
- mprahl
5-
- nsingla
65
reviewers:
76
- rimolive
87
- droctothorpe
98
- gmfrasca
10-
- nsingla

.github/actions/deploy/action.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ inputs:
2727
description: "If KFP should be deployed in multi-user mode"
2828
required: false
2929
default: 'false'
30+
artifact_proxy:
31+
description: "Enables artifact proxy"
32+
required: false
33+
default: 'false'
3034
storage_backend:
3135
description: "Storage backend to use (minio or seaweedfs)"
3236
required: false
@@ -38,6 +42,10 @@ inputs:
3842
required: false
3943
default: 'true'
4044
description: "If you want to forward API server port to localhost:8888"
45+
pod_to_pod_tls_enabled:
46+
description: "If KFP should be deployed with TLS pod-to-pod communication."
47+
required: false
48+
default: 'false'
4149

4250
runs:
4351
using: "composite"
@@ -56,7 +64,7 @@ runs:
5664
- name: Load Docker Images
5765
shell: bash
5866
run: |
59-
APPS=("apiserver" "driver" "launcher" "scheduledworkflow" "persistenceagent" "frontend")
67+
APPS=("apiserver" "driver" "launcher" "scheduledworkflow" "persistenceagent" "frontend" "metadata-writer")
6068
for app in "${APPS[@]}"; do
6169
docker image load -i ${{ inputs.image_path }}/$app/$app.tar
6270
docker push ${{ inputs.image_registry }}/$app:${{ inputs.image_tag }}
@@ -90,6 +98,11 @@ runs:
9098
ARGS="${ARGS} --multi-user"
9199
fi
92100
101+
if [ "${{ inputs.artifact_proxy }}" = "true" ]; then
102+
echo "Enabling artifact proxy"
103+
ARGS="${ARGS} --artifact-proxy"
104+
fi
105+
93106
if [ "${{ inputs.storage_backend }}" != "seaweedfs" ] && [ -n "${{ inputs.storage_backend }}" ]; then
94107
echo "Deploying with artifact storage ${{ inputs.storage_backend }}"
95108
ARGS="${ARGS} --storage ${{ inputs.storage_backend }}"
@@ -99,6 +112,9 @@ runs:
99112
echo "Deploying with argo version ${{ inputs.argo_version }}"
100113
ARGS="${ARGS} --argo-version ${{ inputs.argo_version }}"
101114
fi
115+
if [ "${{inputs.pod_to_pod_tls_enabled }}" = "true" ]; then
116+
ARGS="${ARGS} --tls-enabled"
117+
fi
102118
echo "ARGS=$ARGS" >> $GITHUB_OUTPUT
103119
104120
- name: Deploy KFP

.github/actions/test-and-report/action.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ inputs:
4848
required: false
4949
default: ""
5050
description: "Override it if you want a custom name for your test report file"
51+
tls_enabled:
52+
description: "If KFP should be deployed with TLS pod-to-pod communication."
53+
required: false
54+
default: 'false'
55+
ca_cert_path:
56+
description: "Path to the CA certificate file."
57+
required: false
58+
default: ""
5159

5260

5361
runs:
@@ -73,9 +81,17 @@ runs:
7381
if [ -z $MULTI_USER ]; then
7482
MULTI_USER='false'
7583
fi
84+
TLS_ENABLED=${{ inputs.tls_enabled }}
85+
if [ -z $TLS_ENABLED ]; then
86+
TLS_ENABLED='false'
87+
fi
88+
CA_CERT_PATH=${{ inputs.ca_cert_path }}
89+
if [ -z $CA_CERT_PATH ]; then
90+
CA_CERT_PATH=''
91+
fi
7692
PULL_NUMBER="${{ github.event.inputs.pull_number || github.event.pull_request.number }}"
7793
REPO_NAME="${{ github.repository }}"
78-
go run github.com/onsi/ginkgo/v2/ginkgo -r -v --cover -p --keep-going --github-output=true --nodes=${{ inputs.num_parallel_nodes }} -v --label-filter=${{ inputs.test_label }} -- -namespace=${{ inputs.default_namespace }} -multiUserMode=$MULTI_USER -useProxy=$USE_PROXY -userNamespace=${{ inputs.user_namespace }} -uploadPipelinesWithKubernetes=${{ inputs.upload_pipelines_with_kubernetes_client}} -pullNumber=$PULL_NUMBER -repoName=$REPO_NAME
94+
go run github.com/onsi/ginkgo/v2/ginkgo -r -v --cover -p --keep-going --github-output=true --nodes=${{ inputs.num_parallel_nodes }} -v --label-filter=${{ inputs.test_label }} -- -namespace=${{ inputs.default_namespace }} -multiUserMode=$MULTI_USER -useProxy=$USE_PROXY -userNamespace=${{ inputs.user_namespace }} -uploadPipelinesWithKubernetes=${{ inputs.upload_pipelines_with_kubernetes_client}} -tlsEnabled=$TLS_ENABLED -caCertPath=$CA_CERT_PATH -pullNumber=$PULL_NUMBER -repoName=$REPO_NAME
7995
continue-on-error: true
8096

8197
- name: Collect Pod logs in case of Test Failures
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../default
6+
7+
patches:
8+
- target:
9+
kind: ConfigMap
10+
name: pipeline-install-config
11+
patch: |
12+
- op: add
13+
path: /data/ARTIFACTS_PROXY_ENABLED
14+
value: "true"
15+
- target:
16+
kind: Deployment
17+
name: kubeflow-pipelines-profile-controller
18+
patch: |
19+
- op: add
20+
path: /spec/template/spec/containers/0/env/-
21+
value:
22+
name: DISABLE_ISTIO_SIDECAR
23+
value: "true" # Dangerous and only for CI/CD, not production usage
24+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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:latest
13+
- name: V2_LAUNCHER_IMAGE
14+
value: kind-registry:5000/launcher:latest
15+
- name: LOG_LEVEL
16+
value: "debug"
17+
- name: TLS_ENABLED
18+
value: "true"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../../../../manifests/kustomize/env/cert-manager/platform-agnostic-standalone-tls
6+
7+
images:
8+
- name: ghcr.io/kubeflow/kfp-api-server
9+
newName: kind-registry:5000/apiserver
10+
newTag: latest
11+
- name: ghcr.io/kubeflow/kfp-persistence-agent
12+
newName: kind-registry:5000/persistenceagent
13+
newTag: latest
14+
- name: ghcr.io/kubeflow/kfp-scheduled-workflow-controller
15+
newName: kind-registry:5000/scheduledworkflow
16+
newTag: latest
17+
- name: ghcr.io/kubeflow/kfp-frontend
18+
newName: kind-registry:5000/frontend
19+
newTag: latest
20+
- name: ghcr.io/kubeflow/kfp-metadata-writer
21+
newName: kind-registry:5000/metadata-writer
22+
newTag: latest
23+
patches:
24+
- path: apiserver-env.yaml

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

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ TEST_MANIFESTS=".github/resources/manifests"
2828
PIPELINES_STORE="database"
2929
USE_PROXY=false
3030
CACHE_DISABLED=false
31+
ARTIFACT_PROXY_ENABLED=false
3132
MULTI_USER=false
3233
STORAGE_BACKEND="seaweedfs"
3334
AWF_VERSION=""
35+
POD_TO_POD_TLS_ENABLED=false
36+
SEAWEEDFS_INIT_TIMEOUT=300s
3437

3538
# Loop over script arguments passed. This uses a single switch-case
3639
# block with default value in case we want to make alternative deployments
@@ -53,6 +56,10 @@ while [ "$#" -gt 0 ]; do
5356
MULTI_USER=true
5457
shift
5558
;;
59+
--artifact-proxy)
60+
ARTIFACT_PROXY_ENABLED=true
61+
shift
62+
;;
5663
--storage)
5764
STORAGE_BACKEND="$2"
5865
shift 2
@@ -67,6 +74,10 @@ while [ "$#" -gt 0 ]; do
6774
exit 1
6875
fi
6976
;;
77+
--tls-enabled)
78+
POD_TO_POD_TLS_ENABLED=true
79+
shift
80+
;;
7081
esac
7182
done
7283

@@ -80,11 +91,6 @@ if [ "${MULTI_USER}" == "true" ] && [ "${USE_PROXY}" == "true" ]; then
8091
exit 1
8192
fi
8293

83-
if [ "${STORAGE_BACKEND}" != "minio" ] && [ "${STORAGE_BACKEND}" != "seaweedfs" ]; then
84-
echo "ERROR: Storage backend must be either 'minio' or 'seaweedfs'."
85-
exit 1
86-
fi
87-
8894
if [ -n "${AWF_VERSION}" ]; then
8995
echo "NOTE: Argo version ${AWF_VERSION} specified, updating Argo Workflow manifests..."
9096
echo "${AWF_VERSION}" > third_party/argo/VERSION
@@ -100,8 +106,8 @@ if [[ $EXIT_CODE -ne 0 ]]; then
100106
exit $EXIT_CODE
101107
fi
102108

103-
# If pipelines store is set to 'kubernetes', cert-manager must be deployed
104-
if [ "${PIPELINES_STORE}" == "kubernetes" ]; then
109+
# If pipelines store is set to 'kubernetes' or pod-to-pod TLS is set to 'true', cert-manager must be deployed
110+
if [ "${PIPELINES_STORE}" == "kubernetes" ] || [ "${POD_TO_POD_TLS_ENABLED}" == "true" ]; then
105111
#Install cert-manager
106112
make -C ./backend install-cert-manager || EXIT_CODE=$?
107113
if [[ $EXIT_CODE -ne 0 ]]
@@ -128,15 +134,6 @@ if [ "${MULTI_USER}" == "true" ]; then
128134
echo "Installing Profile Controller Resources..."
129135
kubectl apply -k https://github.com/kubeflow/manifests/applications/profiles/upstream/overlays/kubeflow?ref=master
130136
kubectl -n kubeflow wait --for=condition=Ready pods -l kustomize.component=profiles --timeout 180s
131-
132-
echo "Creating KF Profile..."
133-
kubectl apply -f test_data/kubernetes/seaweedfs/test-profiles.yaml
134-
135-
echo "Applying kubeflow-edit ClusterRole with proper aggregation..."
136-
kubectl apply -f test_data/kubernetes/seaweedfs/kubeflow-edit-clusterrole.yaml
137-
138-
echo "Applying network policy to allow user namespace access to kubeflow services..."
139-
kubectl apply -f test_data/kubernetes/seaweedfs/allow-user-namespace-access.yaml
140137
fi
141138

142139
# Manifests will be deployed according to the flag provided
@@ -156,6 +153,8 @@ if [ "${MULTI_USER}" == "false" ] && [ "${PIPELINES_STORE}" != "kubernetes" ]; t
156153
TEST_MANIFESTS="${TEST_MANIFESTS}/proxy-minio"
157154
elif $CACHE_DISABLED && $USE_PROXY && [ "${STORAGE_BACKEND}" == "minio" ]; then
158155
TEST_MANIFESTS="${TEST_MANIFESTS}/cache-disabled-proxy-minio"
156+
elif $POD_TO_POD_TLS_ENABLED; then
157+
TEST_MANIFESTS="${TEST_MANIFESTS}/tls-enabled"
159158
else
160159
TEST_MANIFESTS="${TEST_MANIFESTS}/default"
161160
fi
@@ -168,17 +167,20 @@ elif [ "${MULTI_USER}" == "false" ] && [ "${PIPELINES_STORE}" == "kubernetes" ];
168167
fi
169168
elif [ "${MULTI_USER}" == "true" ]; then
170169
TEST_MANIFESTS="${TEST_MANIFESTS}/multiuser"
171-
if [ "${STORAGE_BACKEND}" == "minio" ]; then
170+
if $ARTIFACT_PROXY_ENABLED && [ "${STORAGE_BACKEND}" == "seaweedfs" ]; then
171+
TEST_MANIFESTS="${TEST_MANIFESTS}/artifact-proxy"
172+
elif [ "${STORAGE_BACKEND}" == "minio" ]; then
172173
TEST_MANIFESTS="${TEST_MANIFESTS}/minio"
173-
elif $CACHE_DISABLED; then
174-
TEST_MANIFESTS="${TEST_MANIFESTS}/cache-disabled"
175174
elif $CACHE_DISABLED && [ "${STORAGE_BACKEND}" == "minio" ]; then
176175
TEST_MANIFESTS="${TEST_MANIFESTS}/cache-disabled-minio"
176+
elif $CACHE_DISABLED; then
177+
TEST_MANIFESTS="${TEST_MANIFESTS}/cache-disabled"
177178
else
178179
TEST_MANIFESTS="${TEST_MANIFESTS}/default"
179180
fi
180181
fi
181182

183+
182184
echo "Deploying ${TEST_MANIFESTS}..."
183185

184186
kubectl apply -k "${TEST_MANIFESTS}" || EXIT_CODE=$?
@@ -196,6 +198,29 @@ then
196198
exit 1
197199
fi
198200

201+
# Ensure SeaweedFS S3 auth is configured before proceeding
202+
if [ "${STORAGE_BACKEND}" == "seaweedfs" ]; then
203+
wait_for_seaweedfs_init kubeflow "${SEAWEEDFS_INIT_TIMEOUT}" || EXIT_CODE=$?
204+
if [[ $EXIT_CODE -ne 0 ]]
205+
then
206+
echo "SeaweedFS init job did not complete successfully."
207+
exit 1
208+
fi
209+
echo "SeaweedFS init job completed successfully."
210+
fi
211+
212+
if [ "${MULTI_USER}" == "true" ]; then
213+
echo "Creating KF Profile..."
214+
kubectl apply -f test_data/kubernetes/seaweedfs/test-profiles.yaml
215+
sleep 30 # Let the profile controler reconcile the namespace
216+
217+
echo "Applying kubeflow-edit ClusterRole with proper aggregation..."
218+
kubectl apply -f test_data/kubernetes/seaweedfs/kubeflow-edit-clusterrole.yaml
219+
220+
echo "Applying network policy to allow user namespace access to kubeflow services..."
221+
kubectl apply -f test_data/kubernetes/seaweedfs/allow-user-namespace-access.yaml
222+
fi
223+
199224
# Verify pipeline integration for multi-user mode
200225
if [ "${MULTI_USER}" == "true" ]; then
201226
echo "Verifying Pipeline Integration..."

.github/resources/scripts/forward-port.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ APP_NAME=$2
2323
LOCAL_PORT=$3
2424
REMOTE_PORT=$4
2525

26-
POD_NAME=$(kubectl get pods -n "$KUBEFLOW_NS" -l "app=$APP_NAME" -o jsonpath='{.items[0].metadata.name}')
26+
POD_NAME=$(kubectl get pods -n "$KUBEFLOW_NS" -l "app=$APP_NAME" --field-selector=status.phase=Running --sort-by='.metadata.creationTimestamp' -o jsonpath='{.items[-1].metadata.name}')
2727
echo "POD_NAME=$POD_NAME"
2828

2929
if [ $QUIET -eq 1 ]; then

.github/resources/scripts/helper-functions.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ wait_for_pods () {
6161
python "${C_DIR}"/kfp-readiness/wait_for_pods.py
6262
}
6363

64+
wait_for_seaweedfs_init () {
65+
# Wait for SeaweedFS init job to complete to ensure S3 auth is configured
66+
local namespace="$1"
67+
local timeout="$2"
68+
if kubectl -n "$namespace" get job init-seaweedfs > /dev/null 2>&1; then
69+
if ! kubectl -n "$namespace" wait --for=condition=complete --timeout="$timeout" job/init-seaweedfs; then
70+
return 1
71+
fi
72+
fi
73+
}
74+
6475
deploy_with_retries () {
6576
if [[ $# -ne 4 ]]
6677
then

0 commit comments

Comments
 (0)