From 4ab82d6998a9e379afefbfb17926cb762b4f8c11 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Thu, 15 May 2025 20:19:33 +0530 Subject: [PATCH 01/14] updated test file naming scheme Signed-off-by: kunal-511 --- .github/workflows/admission_webhook_test.yaml | 12 ++-- .github/workflows/centraldashboard_test.yaml | 8 +-- .github/workflows/dex_oauth2-proxy_test.yaml | 30 ++++----- .../full_kubeflow_integration_test.yaml | 66 +++++++++---------- .../jupyter_web_application_test.yaml | 8 +-- .github/workflows/katib_test.yaml | 32 ++++----- .github/workflows/kserve_test.yaml | 44 ++++++------- .github/workflows/manifests_example_test.yaml | 2 +- .github/workflows/model_registry_test.yaml | 16 ++--- .../workflows/notebook_controller_test.yaml | 18 ++--- .../workflows/pipeline_run_from_notebook.yaml | 32 ++++----- .github/workflows/pipeline_swfs_test.yaml | 34 +++++----- .github/workflows/pipeline_test.yaml | 40 +++++------ .github/workflows/profiles_test.yaml | 8 +-- .github/workflows/ray_test.yaml | 18 ++--- .github/workflows/spark_test.yaml | 28 ++++---- .../tensorboard_controller_test.yaml | 8 +-- .../tensorboards_web_application_test.yaml | 8 +-- .github/workflows/training_operator_test.yaml | 34 +++++----- .github/workflows/trivy.yaml | 8 +-- .../volumes_web_application_test.yaml | 32 ++++----- ...nstall_argo_cli.sh => argo_cli_install.sh} | 0 ...baseline_PSS.sh => baseline_PSS_enable.sh} | 0 ...hboard.sh => central_dashboard_install.sh} | 0 ...ert_manager.sh => cert_manager_install.sh} | 0 .../install_dex.sh => dex_install.sh} | 0 .../test_dex_login.py => dex_login_test.py} | 0 ...D_create_KinD_cluster_install_kustomize.sh | 0 ...tall_istio-cni.sh => istio-cni_install.sh} | 0 .../install_katib.sh => katib_install.sh} | 0 .../kf-objects => }/katib_test.yaml | 0 ..._knative-cni.sh => knative-cni_install.sh} | 0 .../kserve/data/iris_input.json | 0 .../{gh-actions => }/kserve/requirements.txt | 0 .../sklearn_test.py} | 0 tests/{gh-actions => }/kserve/utils.py | 0 .../install_kserve.sh => kserve_install.sh} | 0 .../test_kserve.sh => kserve_test.sh} | 0 .../kf-objects => }/kserve_test.yaml | 0 .../install_kubectl.sh => kubectl_install.sh} | 0 ...profile.sh => kubeflow_profile_install.sh} | 0 ...tall_kustomize.sh => kustomize_install.sh} | 0 ...ti_tenancy.sh => multi_tenancy_install.sh} | 0 ...tebook.test.kubeflow-user-example.com.yaml | 0 ...auth2-proxy.sh => oauth2-proxy_install.sh} | 0 .../oauth2_dex_credentials.sh | 0 .../test_pipeline.py => pipeline_test.py} | 0 ...est_pipeline_v1.py => pipeline_v1_test.py} | 0 ...est_pipeline_v2.py => pipeline_v2_test.py} | 0 ...tall_pipelines.sh => pipelines_install.sh} | 0 ...ines_swfs.sh => pipelines_swfs_install.sh} | 0 ...ml-pipeline.kubeflow-user-example-com.yaml | 0 .../{gh-actions => }/port_forward_gateway.sh | 0 ...ricted_PSS.sh => restricted_PSS_enable.sh} | 0 .../run_and_wait_kubeflow_pipeline.py | 0 tests/{gh-actions => }/runasnonroot.sh | 0 .../install_spark.sh => spark_install.sh} | 0 .../test_spark.sh => spark_test.sh} | 0 ...erator.sh => training_operator_install.sh} | 0 .../training_operator_job.yaml | 0 ..._operator.sh => training_operator_test.sh} | 0 .../install_trivy.sh => trivy_install.sh} | 0 tests/{gh-actions => }/trivy_scan.py | 0 ....sh => volumes_web_application_install.sh} | 0 ...ion.sh => volumes_web_application_test.sh} | 0 65 files changed, 243 insertions(+), 243 deletions(-) rename tests/{gh-actions/install_argo_cli.sh => argo_cli_install.sh} (100%) rename tests/{gh-actions/enable_baseline_PSS.sh => baseline_PSS_enable.sh} (100%) rename tests/{gh-actions/install_central_dashboard.sh => central_dashboard_install.sh} (100%) rename tests/{gh-actions/install_cert_manager.sh => cert_manager_install.sh} (100%) rename tests/{gh-actions/install_dex.sh => dex_install.sh} (100%) rename tests/{gh-actions/test_dex_login.py => dex_login_test.py} (100%) rename tests/{gh-actions => }/install_KinD_create_KinD_cluster_install_kustomize.sh (100%) rename tests/{gh-actions/install_istio-cni.sh => istio-cni_install.sh} (100%) rename tests/{gh-actions/install_katib.sh => katib_install.sh} (100%) rename tests/{gh-actions/kf-objects => }/katib_test.yaml (100%) rename tests/{gh-actions/install_knative-cni.sh => knative-cni_install.sh} (100%) rename tests/{gh-actions => }/kserve/data/iris_input.json (100%) rename tests/{gh-actions => }/kserve/requirements.txt (100%) rename tests/{gh-actions/kserve/test_sklearn.py => kserve/sklearn_test.py} (100%) rename tests/{gh-actions => }/kserve/utils.py (100%) rename tests/{gh-actions/install_kserve.sh => kserve_install.sh} (100%) rename tests/{gh-actions/test_kserve.sh => kserve_test.sh} (100%) rename tests/{gh-actions/kf-objects => }/kserve_test.yaml (100%) rename tests/{gh-actions/install_kubectl.sh => kubectl_install.sh} (100%) rename tests/{gh-actions/install_kubeflow_profile.sh => kubeflow_profile_install.sh} (100%) rename tests/{gh-actions/install_kustomize.sh => kustomize_install.sh} (100%) rename tests/{gh-actions/install_multi_tenancy.sh => multi_tenancy_install.sh} (100%) rename tests/{gh-actions/kf-objects => }/notebook.test.kubeflow-user-example.com.yaml (100%) rename tests/{gh-actions/install_oauth2-proxy.sh => oauth2-proxy_install.sh} (100%) rename tests/{gh-actions => }/oauth2_dex_credentials.sh (100%) rename tests/{gh-actions/kf-objects/test_pipeline.py => pipeline_test.py} (100%) rename tests/{gh-actions/test_pipeline_v1.py => pipeline_v1_test.py} (100%) rename tests/{gh-actions/test_pipeline_v2.py => pipeline_v2_test.py} (100%) rename tests/{gh-actions/install_pipelines.sh => pipelines_install.sh} (100%) rename tests/{gh-actions/install_pipelines_swfs.sh => pipelines_swfs_install.sh} (100%) rename tests/{gh-actions/kf-objects => }/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml (100%) rename tests/{gh-actions => }/port_forward_gateway.sh (100%) rename tests/{gh-actions/enable_restricted_PSS.sh => restricted_PSS_enable.sh} (100%) rename tests/{gh-actions => }/run_and_wait_kubeflow_pipeline.py (100%) rename tests/{gh-actions => }/runasnonroot.sh (100%) rename tests/{gh-actions/install_spark.sh => spark_install.sh} (100%) rename tests/{gh-actions/test_spark.sh => spark_test.sh} (100%) rename tests/{gh-actions/install_training_operator.sh => training_operator_install.sh} (100%) rename tests/{gh-actions/kf-objects => }/training_operator_job.yaml (100%) rename tests/{gh-actions/test_training_operator.sh => training_operator_test.sh} (100%) rename tests/{gh-actions/install_trivy.sh => trivy_install.sh} (100%) rename tests/{gh-actions => }/trivy_scan.py (100%) rename tests/{gh-actions/install_volumes_web_application.sh => volumes_web_application_install.sh} (100%) rename tests/{gh-actions/test_volumes_web_application.sh => volumes_web_application_test.sh} (100%) diff --git a/.github/workflows/admission_webhook_test.yaml b/.github/workflows/admission_webhook_test.yaml index 4804cada08..5666a31cf4 100644 --- a/.github/workflows/admission_webhook_test.yaml +++ b/.github/workflows/admission_webhook_test.yaml @@ -2,11 +2,11 @@ name: Test Admission Webhook on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/admission_webhook_test.yaml - apps/admission-webhook/upstream/** - - tests/gh-actions/install_istio.sh - - tests/gh-actions/install_cert_manager.sh + - tests/istio-cni_install.sh + - tests/cert_manager_install.sh - common/cert-manager/** - common/istio*/** @@ -18,13 +18,13 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/centraldashboard_test.yaml b/.github/workflows/centraldashboard_test.yaml index 9c65b434d2..241a314b2b 100644 --- a/.github/workflows/centraldashboard_test.yaml +++ b/.github/workflows/centraldashboard_test.yaml @@ -2,10 +2,10 @@ name: Test Central Dashboard on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/centraldashboard_test.yaml - apps/centraldashboard/upstream/** - - tests/gh-actions/install_istio*.sh + - tests/istio*.sh - common/istio*/** jobs: @@ -16,10 +16,10 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - diff --git a/.github/workflows/dex_oauth2-proxy_test.yaml b/.github/workflows/dex_oauth2-proxy_test.yaml index 0f3d871bd6..e63a4f6daf 100644 --- a/.github/workflows/dex_oauth2-proxy_test.yaml +++ b/.github/workflows/dex_oauth2-proxy_test.yaml @@ -2,15 +2,15 @@ name: Test Dex and OAuth2 Proxy on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/dex_oauth2-proxy.yaml - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** - experimental/security/PSS/* - common/dex/base/** - - tests/gh-actions/install_istio*.sh - - tests/gh-actions/test_dex_login.py + - tests/istio*.sh + - tests/test_dex_login.py jobs: build: @@ -20,16 +20,16 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - @@ -38,19 +38,19 @@ jobs: run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install dex - run: ./tests/gh-actions/install_dex.sh + run: ./tests/dex_install.sh - name: Install central-dashboard - run: ./tests/gh-actions/install_central_dashboard.sh + run: ./tests/central_dashboard_install.sh - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Port forward the istio-ingress gateway - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: Test dex login run: | @@ -58,12 +58,12 @@ jobs: pip3 install -q requests # Run the Dex login test - python3 tests/gh-actions/test_dex_login.py + python3 tests/dex_login_test.py echo "Dex login test completed successfully." - name: Apply Pod Security Standards baseline levels for static namespaces - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -75,4 +75,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels for static namespaces - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/full_kubeflow_integration_test.yaml b/.github/workflows/full_kubeflow_integration_test.yaml index 94e7b87ed6..3d6c9ecb8b 100644 --- a/.github/workflows/full_kubeflow_integration_test.yaml +++ b/.github/workflows/full_kubeflow_integration_test.yaml @@ -23,46 +23,46 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create Kubeflow Namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Certificate Manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install OAuth2 Proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install Kubeflow Istio Resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install Multi-Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install Dex - run: ./tests/gh-actions/install_dex.sh + run: ./tests/dex_install.sh - name: Install Central Dashboard - run: ./tests/gh-actions/install_central_dashboard.sh + run: ./tests/central_dashboard_install.sh - name: Install Knative - run: ./tests/gh-actions/install_knative-cni.sh + run: ./tests/knative-cni_install.sh - name: Install KServe - run: ./tests/gh-actions/install_kserve.sh + run: ./tests/kserve_install.sh - name: Install Pipelines - run: ./tests/gh-actions/install_pipelines.sh + run: ./tests/pipelines_install.sh - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Install Jupyter Web Application run: kustomize build apps/jupyter/jupyter-web-app/upstream/overlays/istio/ | kubectl apply -f - @@ -77,13 +77,13 @@ jobs: run: kubectl get crd poddefaults.kubeflow.org || kubectl apply -f https://raw.githubusercontent.com/kubeflow/kubeflow/master/components/admission-webhook/manifests/base/crd.yaml - name: Install Volumes Web Application - run: ./tests/gh-actions/install_volumes_web_application.sh + run: ./tests/volumes_web_application_install.sh - name: Install Katib - run: ./tests/gh-actions/install_katib.sh + run: ./tests/katib_install.sh - name: Install Training Operator - run: ./tests/gh-actions/install_training_operator.sh + run: ./tests/training_operator_install.sh - name: Install Model Registry run: | @@ -95,56 +95,56 @@ jobs: kustomize build apps/model-registry/upstream/options/ui/overlays/istio | kubectl apply -f - - name: Install Spark - run: chmod u+x tests/gh-actions/*.sh && ./tests/gh-actions/install_spark.sh + run: chmod u+x tests/*.sh && ./tests/spark_install.sh - name: Wait for All Pods to be Ready run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 60s --field-selector=status.phase!=Succeeded - name: Port-forward the istio-ingress gateway - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh # name: Setup OAuth2 and Dex Credentials - # run: chmod +x tests/gh-actions/oauth2_dex_credentials.sh && ./tests/gh-actions/oauth2_dex_credentials.sh + # run: chmod +x tests/oauth2_dex_credentials.sh && ./tests/oauth2_dex_credentials.sh - name: Test Dex Login run: | pip3 install -q requests - python3 tests/gh-actions/test_dex_login.py + python3 tests/dex_login_test.py echo "Dex login test completed successfully." - name: V1 Pipeline Test run: | pip3 install "kfp>=1.8.22,<2.0.0" TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" - python3 tests/gh-actions/test_pipeline_v1.py "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_v1_test.py "${TOKEN}" "${KF_PROFILE}" - name: V2 Pipeline Test run: | pip3 install -U "kfp>=2.13.0" TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" - python3 tests/gh-actions/test_pipeline_v2.py run_pipeline "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_v2_test.py run_pipeline "${TOKEN}" "${KF_PROFILE}" - name: Test Pipeline Access with Unauthorized Token run: | kubectl create namespace test-unauthorized kubectl create serviceaccount test-unauthorized -n test-unauthorized UNAUTHORIZED_TOKEN=$(kubectl -n test-unauthorized create token test-unauthorized) - python3 tests/gh-actions/test_pipeline_v2.py test_unauthorized_access "$UNAUTHORIZED_TOKEN" "${KF_PROFILE}" + python3 tests/pipeline_v2_test.py test_unauthorized_access "$UNAUTHORIZED_TOKEN" "${KF_PROFILE}" - name: Test Volumes Web Application API - run: ./tests/gh-actions/test_volumes_web_application.sh "${KF_PROFILE}" + run: ./tests/volumes_web_application_test.sh "${KF_PROFILE}" - name: Apply PodDefault for Pipeline Access Token - run: sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/gh-actions/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml | kubectl apply -f - + run: sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml | kubectl apply -f - - name: Create Test Notebook run: | - sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/gh-actions/kf-objects/notebook.test.kubeflow-user-example.com.yaml | kubectl apply -f - + sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/kf-objects/notebook.test.kubeflow-user-example.com.yaml | kubectl apply -f - kubectl wait --for=condition=Ready pod -l app=test -n $KF_PROFILE --timeout=300s - name: Copy and execute the pipeline run script in KF Notebook run: | - cp tests/gh-actions/run_and_wait_kubeflow_pipeline.py /tmp/run_pipeline_temp.py + cp tests/run_and_wait_kubeflow_pipeline.py /tmp/run_pipeline_temp.py sed -i "s/experiment_namespace = \"kubeflow-user-example-com\"/experiment_namespace = \"$KF_PROFILE\"/g" /tmp/run_pipeline_temp.py sed -i 's/except Exception:/except Exception as e:/g' /tmp/run_pipeline_temp.py sed -i 's/logger.info("Experiment not found, trying to create experiment.")/logger.info("Experiment not found, trying to create experiment. Error: " + str(e))/g' /tmp/run_pipeline_temp.py @@ -155,7 +155,7 @@ jobs: - name: Run Katib Test run: | - kubectl apply -f tests/gh-actions/kf-objects/katib_test.yaml + kubectl apply -f tests/katib_test.yaml kubectl wait --for=condition=Running experiments.kubeflow.org -n $KF_PROFILE --all --timeout=300s echo "Waiting for all Trials to be Completed..." kubectl wait --for=condition=Created trials.kubeflow.org -n $KF_PROFILE --all --timeout=60s @@ -164,14 +164,14 @@ jobs: kubectl get trials.kubeflow.org -n $KF_PROFILE - name: Run Training Operator Test - run: ./tests/gh-actions/test_training_operator.sh "${KF_PROFILE}" + run: ./tests/test_training_operator.sh "${KF_PROFILE}" - name: Run KServe Test run: | - ./tests/gh-actions/test_kserve.sh ${KF_PROFILE} + ./tests/kserve_test.sh ${KF_PROFILE} - name: Run Spark Test - run: chmod u+x tests/gh-actions/*.sh && ./tests/gh-actions/test_spark.sh "${KF_PROFILE}" + run: chmod u+x tests/*.sh && ./tests/test_spark.sh "${KF_PROFILE}" - name: Test Model Registry Deployment run: | @@ -210,7 +210,7 @@ jobs: fi - name: Apply Pod Security Standards Baseline - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Remove Pod Security Labels run: | @@ -220,11 +220,11 @@ jobs: done - name: Apply Pod Security Standards Restricted - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh - name: Run Non-Root Test run: | - [ -f "tests/gh-actions/runasnonroot.sh" ] && chmod +x tests/gh-actions/runasnonroot.sh && ./tests/gh-actions/runasnonroot.sh + [ -f "tests/runasnonroot.sh" ] && chmod +x tests/runasnonroot.sh && ./tests/runasnonroot.sh - name: Verify Components run: kubectl get pods --all-namespaces | grep -E '(Error|CrashLoopBackOff)' && exit 1 || true diff --git a/.github/workflows/jupyter_web_application_test.yaml b/.github/workflows/jupyter_web_application_test.yaml index 046660cd2c..0799e6d9b6 100644 --- a/.github/workflows/jupyter_web_application_test.yaml +++ b/.github/workflows/jupyter_web_application_test.yaml @@ -2,10 +2,10 @@ name: Test Jupyter Web Application on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/jupyter_web_application_test.yaml - apps/jupyter/jupyter-web-app/upstream/** - - tests/gh-actions/install_istio.sh + - tests/istio-cni_install.sh - common/istio*/** jobs: @@ -16,10 +16,10 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/katib_test.yaml b/.github/workflows/katib_test.yaml index 62f80e6832..778fa28c9f 100644 --- a/.github/workflows/katib_test.yaml +++ b/.github/workflows/katib_test.yaml @@ -2,13 +2,13 @@ name: Deploy and Test Katib on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh - - tests/gh-actions/install_katib.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/katib_install.sh - .github/workflows/katib_test.yaml - apps/katib/upstream/** - - tests/gh-actions/install_istio-cni.sh + - tests/istio-cni_install.sh - common/istio*/** - - tests/gh-actions/install_cert_manager.sh + - tests/cert_manager_install.sh - common/cert-manager/** - experimental/security/PSS/* @@ -23,45 +23,45 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create Kubeflow Namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Certificate Manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install OAuth2 Proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install Kubeflow Istio Resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install Multi-Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Install Katib - run: ./tests/gh-actions/install_katib.sh + run: ./tests/katib_install.sh - name: Install Dependencies run: pip install pytest kubernetes kfp==2.13.0 requests - name: Port-forward the istio-ingress gateway - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: Run Katib Test run: | - kubectl apply -f tests/gh-actions/kf-objects/katib_test.yaml + kubectl apply -f tests/katib_test.yaml kubectl wait --for=condition=Running experiments.kubeflow.org -n $KF_PROFILE --all --timeout=300s echo "Waiting for all Trials to be Completed..." kubectl wait --for=condition=Created trials.kubeflow.org -n $KF_PROFILE --all --timeout=60s @@ -80,7 +80,7 @@ jobs: kubectl get experiments.kubeflow.org -n $KF_PROFILE --token="$UNAUTHORIZED_TOKEN" >/dev/null - name: Apply Pod Security Standards baseline levels - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -92,4 +92,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/kserve_test.yaml b/.github/workflows/kserve_test.yaml index 4ba69f0a42..8306353b27 100644 --- a/.github/workflows/kserve_test.yaml +++ b/.github/workflows/kserve_test.yaml @@ -2,20 +2,20 @@ name: Test KServe on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/kserve_m2m_test.yaml - apps/kserve/** - - tests/gh-actions/kserve/** - - tests/gh-actions/test_kserve.sh - - tests/gh-actions/install_kserve.sh + - tests/kserve/** + - tests/test_kserve.sh + - tests/install_kserve.sh - common/istio*/** - - tests/gh-actions/install_istio*.sh + - tests/istio-cni_install.sh - common/oauth2-proxy/** - - tests/gh-actions/install_oauth2-proxy.sh + - tests/oauth2-proxy_install.sh - common/cert-manager/** - - tests/gh-actions/install_cert_manager.sh + - tests/cert_manager_install.sh - common/knative/** - - tests/gh-actions/install_knative*.sh + - tests/knative-cni_install.sh jobs: build: @@ -25,37 +25,37 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install knative CNI - run: ./tests/gh-actions/install_knative-cni.sh + run: ./tests/knative-cni_install.sh - name: Install KServe - run: ./tests/gh-actions/install_kserve.sh + run: ./tests/kserve_install.sh - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install kubeflow-istio-resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Setup python 3.12 uses: actions/setup-python@v4 @@ -63,10 +63,10 @@ jobs: python-version: 3.12 - name: Port forward - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: Run KServe tests - run: ./tests/gh-actions/test_kserve.sh kubeflow-user-example-com + run: ./tests/kserve_test.sh kubeflow-user-example-com - name: Detailed KServe Access Diagnostics run: | @@ -88,7 +88,7 @@ jobs: #- name: Run and fail kserve tests without kserve m2m token #run: | # export KSERVE_INGRESS_HOST_PORT=localhost:8080 - # cd ./tests/gh-actions/kserve + # cd ./tests/kserve # if pytest . -vs --log-level info; then # echo "This test should fail with an HTTP redirect to oauth2-proxy/dex auth."; exit 1 # else @@ -120,7 +120,7 @@ jobs: kubectl wait --for=condition=Available --timeout=300s -n kubeflow deployment/kserve-models-web-app - name: Apply Pod Security Standards baseline levels - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -132,4 +132,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/manifests_example_test.yaml b/.github/workflows/manifests_example_test.yaml index 6f4bb32a0a..819a74ca0c 100644 --- a/.github/workflows/manifests_example_test.yaml +++ b/.github/workflows/manifests_example_test.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Install kustomize - run: ./tests/gh-actions/install_kustomize.sh + run: ./tests/kustomize_install.sh - name: Unit Test run: | diff --git a/.github/workflows/model_registry_test.yaml b/.github/workflows/model_registry_test.yaml index 854c2ad10e..81b9d0f9cb 100644 --- a/.github/workflows/model_registry_test.yaml +++ b/.github/workflows/model_registry_test.yaml @@ -4,10 +4,10 @@ name: Test Model Registry on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/model_registry_test.yaml - apps/model-registry/upstream/** - - tests/gh-actions/install_istio.sh + - tests/istio-cni_install.sh - common/istio*/** jobs: @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Remove AppArmor profile for mysql in KinD on GHA # https://github.com/kubeflow/manifests/issues/2507 run: | @@ -27,22 +27,22 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install kubeflow-istio-resources run: kustomize build common/istio-1-24/kubeflow-istio-resources/base | kubectl apply -f - diff --git a/.github/workflows/notebook_controller_test.yaml b/.github/workflows/notebook_controller_test.yaml index 80b8cd9263..47ba673bcc 100644 --- a/.github/workflows/notebook_controller_test.yaml +++ b/.github/workflows/notebook_controller_test.yaml @@ -2,14 +2,14 @@ name: Test Notebook Controller on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/notebook_controller_m2m_test.yaml - apps/jupyter/** - common/oauth2-proxy/** - common/istio*/** - - tests/gh-actions/install_istio.sh - - tests/gh-actions/install_oauth2-proxy.sh - - tests/gh-actions/install_multi_tenancy.sh + - tests/istio-cni_install.sh + - tests/oauth2-proxy_install.sh + - tests/multi_tenancy_install.sh jobs: build: @@ -19,25 +19,25 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install kubeflow-istio-resources run: kustomize build common/istio-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/pipeline_run_from_notebook.yaml b/.github/workflows/pipeline_run_from_notebook.yaml index 0bcf3bafae..321f7d360f 100644 --- a/.github/workflows/pipeline_run_from_notebook.yaml +++ b/.github/workflows/pipeline_run_from_notebook.yaml @@ -2,12 +2,12 @@ name: Test Pipeline run from Jupyterlab on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/pipeline_run_from_notebook.yaml - apps/jupyter/notebook-controller/upstream/** - apps/pipeline/upstream/** - - tests/gh-actions/install_istio*.sh - - tests/gh-actions/install_cert_manager.sh + - tests/install_istio*.sh + - tests/cert_manager_install.sh - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** @@ -22,16 +22,16 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - @@ -40,10 +40,10 @@ jobs: run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install KF Pipelines - run: ./tests/gh-actions/install_pipelines.sh + run: ./tests/pipelines_install.sh - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Build & Apply manifests run: | @@ -54,29 +54,29 @@ jobs: --field-selector=status.phase!=Succeeded - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Apply PodDefaults to access ml-pipeline with projected token - run: kubectl apply -f tests/gh-actions/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml + run: kubectl apply -f tests/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml - name: Create Kubeflow Notebook with PodDefaults run: | - kubectl apply -f tests/gh-actions/kf-objects/notebook.test.kubeflow-user-example.com.yaml + kubectl apply -f tests/notebook.test.kubeflow-user-example.com.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 \ - -f tests/gh-actions/kf-objects/notebook.test.kubeflow-user-example.com.yaml \ + -f tests/notebook.test.kubeflow-user-example.com.yaml \ --timeout 600s - name: Copy and execute the pipeline run script in KF Notebook run: | kubectl -n kubeflow-user-example-com cp \ - ./tests/gh-actions/run_and_wait_kubeflow_pipeline.py \ + ./tests/run_and_wait_kubeflow_pipeline.py \ test-0:/home/jovyan/run_and_wait_kubeflow_pipeline.py kubectl -n kubeflow-user-example-com exec -ti \ test-0 -- python /home/jovyan/run_and_wait_kubeflow_pipeline.py - name: Apply Pod Security Standards baseline levels - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -88,4 +88,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/pipeline_swfs_test.yaml b/.github/workflows/pipeline_swfs_test.yaml index db97b4a5dd..60b6a35b34 100644 --- a/.github/workflows/pipeline_swfs_test.yaml +++ b/.github/workflows/pipeline_swfs_test.yaml @@ -3,12 +3,12 @@ on: workflow_dispatch: pull_request: paths: - # - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + # - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/pipeline_swfs_test.yaml - apps/pipeline/upstream/** - # - tests/gh-actions/install_istio.sh - # - tests/gh-actions/install_cert_manager.sh - # - tests/gh-actions/install_oauth2-proxy.sh + # - tests/install_istio.sh + # - tests/install_cert_manager.sh + # - tests/install_oauth2-proxy.sh # - common/cert-manager/** # - common/oauth2-proxy/** # - common/istio*/** @@ -24,34 +24,34 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install KF Pipelines - run: ./tests/gh-actions/install_pipelines_swfs.sh + run: ./tests/pipelines_install.sh - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install kubeflow-istio-resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Verify Pipeline Integration run: | @@ -63,26 +63,26 @@ jobs: kubectl get secret mlpipeline-minio-artifact -n "$KF_PROFILE" -o json | jq -r '.data | keys[] as $k | "\($k): \(. | .[$k] | @base64d)"' | tr '\n' ' ' - name: Port forward - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: List and deploy test pipeline with authorized ServiceAccount Token run: | pip3 install kfp==2.13.0 KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" - python3 tests/gh-actions/test_pipeline.py run_pipeline "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_test.py run_pipeline "${TOKEN}" "${KF_PROFILE}" - name: Fail to list pipelines with unauthorized ServiceAccount Token run: | pip3 install kfp==2.13.0 KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n default create token default)" - python3 tests/gh-actions/test_pipeline.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_test.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" echo "Test succeeded. Token from unauthorized ServiceAccount cannot list pipelines in $KF_PROFILE namespace." - name: Apply Pod Security Standards baseline levels for static namespaces - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -94,7 +94,7 @@ jobs: done - name: Applying Pod Security Standards restricted levels for static namespaces - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh - name: Collect Logs on Failure if: failure() diff --git a/.github/workflows/pipeline_test.yaml b/.github/workflows/pipeline_test.yaml index 11e37ed3c1..e5923233ea 100644 --- a/.github/workflows/pipeline_test.yaml +++ b/.github/workflows/pipeline_test.yaml @@ -2,17 +2,17 @@ name: Test Pipelines on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/pipeline_test.yaml - apps/pipeline/upstream/** - - tests/gh-actions/install_istio*.sh - - tests/gh-actions/install_cert_manager.sh - - tests/gh-actions/install_oauth2-proxy.sh + - tests/istio-cni_install.sh + - tests/cert_manager_install.sh + - tests/oauth2-proxy_install.sh - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** - - tests/gh-actions/test_pipeline_v1.py - - tests/gh-actions/test_pipeline_v2.py + - tests/pipeline_v1_test.py + - tests/pipeline_v2_test.py - experimental/security/PSS/* env: @@ -27,34 +27,34 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install KF Pipelines - run: ./tests/gh-actions/install_pipelines.sh + run: ./tests/pipelines_install.sh - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Install kubeflow-istio-resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Verify Pipeline Integration run: | @@ -68,28 +68,28 @@ jobs: run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 60s --field-selector=status.phase!=Succeeded - name: Port forward - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: V1 Pipeline Test run: | pip3 install "kfp>=1.8.22,<2.0.0" TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" - python3 tests/gh-actions/test_pipeline_v1.py "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_v1_test.py "${TOKEN}" "${KF_PROFILE}" - name: V2 Pipeline Test run: | pip3 install "kfp>=2.13.0" TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" - python3 tests/gh-actions/test_pipeline_v2.py run_pipeline "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_v2_test.py run_pipeline "${TOKEN}" "${KF_PROFILE}" - name: Test unauthorized access run: | TOKEN="$(kubectl -n default create token default)" - python3 tests/gh-actions/test_pipeline_v2.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" + python3 tests/pipeline_v2_test.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" echo "Test succeeded. Token from unauthorized ServiceAccount cannot list pipelines in $KF_PROFILE namespace." - name: Apply Pod Security Standards baseline levels for static namespaces - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -101,4 +101,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels for static namespaces - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/profiles_test.yaml b/.github/workflows/profiles_test.yaml index 0b7ba1ce62..52bda6f0c5 100644 --- a/.github/workflows/profiles_test.yaml +++ b/.github/workflows/profiles_test.yaml @@ -2,10 +2,10 @@ name: Test Profiles on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/profiles_test.yaml - apps/profiles/upstream/** - - tests/gh-actions/install_istio.sh + - tests/istio-cni_install.sh - common/istio*/** jobs: @@ -16,10 +16,10 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/ray_test.yaml b/.github/workflows/ray_test.yaml index 4a0f5174c4..f293e88439 100644 --- a/.github/workflows/ray_test.yaml +++ b/.github/workflows/ray_test.yaml @@ -2,12 +2,12 @@ name: Test Ray on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/ray_test.yaml - experimental/ray/** - - tests/gh-actions/install_istio.sh - - tests/gh-actions/install_cert_manager.sh - - tests/gh-actions/install_oauth2-proxy.sh + - tests/istio-cni_install.sh + - tests/cert_manager_install.sh + - tests/oauth2-proxy_install.sh - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** @@ -21,22 +21,22 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Create KF Profile run: kustomize build common/user-namespace/base | kubectl apply -f - diff --git a/.github/workflows/spark_test.yaml b/.github/workflows/spark_test.yaml index 1d83251483..2a8af5914c 100644 --- a/.github/workflows/spark_test.yaml +++ b/.github/workflows/spark_test.yaml @@ -2,13 +2,13 @@ name: Test Spark on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/test_spark.yaml - apps/spark/** - - tests/gh-actions/spark*.sh - - tests/gh-actions/install_istio.sh - - tests/gh-actions/install_cert_manager.sh - - tests/gh-actions/install_oauth2-proxy.sh + - tests/spark*.sh + - tests/istio-cni_install.sh + - tests/cert_manager_install.sh + - tests/oauth2-proxy_install.sh - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** @@ -22,22 +22,22 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install oauth2-proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install cert-manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Create kubeflow namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install KF Multi Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Create KF Profile run: kustomize build common/user-namespace/base | kubectl apply -f - @@ -46,7 +46,7 @@ jobs: run: | cd apps/spark # TODO remove the debugging lines - ls -lah ../../tests/gh-actions/ - chmod u+x ../../tests/gh-actions/*.sh - ../../tests/gh-actions/install_spark.sh - ../../tests/gh-actions/test_spark.sh "kubeflow-user-example-com" + ls -lah ../../tests/ + chmod u+x ../../tests/*.sh + ../../tests/install_spark.sh + ../../tests/test_spark.sh "kubeflow-user-example-com" diff --git a/.github/workflows/tensorboard_controller_test.yaml b/.github/workflows/tensorboard_controller_test.yaml index 19d8eddc06..5776020adc 100644 --- a/.github/workflows/tensorboard_controller_test.yaml +++ b/.github/workflows/tensorboard_controller_test.yaml @@ -2,10 +2,10 @@ name: Test Tensorboard Controller on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/tensorboard_controller_test.yaml - apps/tensorboard/tensorboard-controller/upstream/** - - tests/gh-actions/install_istio.sh + - tests/istio-cni_install.sh - common/istio*/** jobs: @@ -17,10 +17,10 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/tensorboards_web_application_test.yaml b/.github/workflows/tensorboards_web_application_test.yaml index f3176b423d..09c610e4f8 100644 --- a/.github/workflows/tensorboards_web_application_test.yaml +++ b/.github/workflows/tensorboards_web_application_test.yaml @@ -2,10 +2,10 @@ name: Test Tensorboards Web Application on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/tensorboards_web_application_test.yaml - apps/tensorboard/tensorboards-web-app/upstream/** - - tests/gh-actions/install_istio.sh + - tests/istio-cni_install.sh - common/istio*/** jobs: @@ -17,10 +17,10 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install Istio - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Build & Apply manifests run: | diff --git a/.github/workflows/training_operator_test.yaml b/.github/workflows/training_operator_test.yaml index 1de0e81949..dc6b0d4aee 100644 --- a/.github/workflows/training_operator_test.yaml +++ b/.github/workflows/training_operator_test.yaml @@ -2,13 +2,13 @@ name: Deploy and Test Training Operator on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/training_operator_test.yaml - apps/training-operator/upstream/** - - tests/gh-actions/kf-objects/training_operator_job.yaml - - tests/gh-actions/install_istio-cni.sh - - tests/gh-actions/install_cert_manager.sh - - tests/gh-actions/install_oauth2-proxy.sh + - tests/training_operator_job.yaml + - tests/istio-cni_install.sh + - tests/cert_manager_install.sh + - tests/oauth2-proxy_install.sh - common/cert-manager/** - common/oauth2-proxy/** - common/istio*/** @@ -25,34 +25,34 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create Kubeflow Namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Certificate Manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install OAuth2 Proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install Kubeflow Istio Resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install Multi-Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Install Training Operator - run: ./tests/gh-actions/install_training_operator.sh + run: ./tests/training_operator_install.sh - name: Verify CRDs are ready run: | @@ -63,10 +63,10 @@ jobs: run: pip install pytest kubernetes requests - name: Port-forward the istio-ingress gateway - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: Run Training Operator Test - run: ./tests/gh-actions/test_training_operator.sh "${KF_PROFILE}" + run: ./tests/training_operator_test.sh "${KF_PROFILE}" - name: Test with Authorized Token run: kubectl get pytorchjobs -n $KF_PROFILE --token="$(kubectl -n $KF_PROFILE create token default-editor)" @@ -79,7 +79,7 @@ jobs: kubectl get pytorchjobs -n $KF_PROFILE --token="$UNAUTHORIZED_TOKEN" >/dev/null - name: Apply Pod Security Standards baseline levels - run: ./tests/gh-actions/enable_baseline_PSS.sh + run: ./tests/baseline_PSS_enable.sh - name: Unapply applied baseline labels run: | @@ -91,4 +91,4 @@ jobs: done - name: Applying Pod Security Standards restricted levels - run: ./tests/gh-actions/enable_restricted_PSS.sh + run: ./tests/restricted_PSS_enable.sh diff --git a/.github/workflows/trivy.yaml b/.github/workflows/trivy.yaml index e5dc62319e..8ca1e8c63c 100644 --- a/.github/workflows/trivy.yaml +++ b/.github/workflows/trivy.yaml @@ -7,7 +7,7 @@ on: pull_request: paths: - '.github/workflows/trivy.yaml' - - 'tests/gh-actions/trivy_scan.py' + - 'tests/trivy_scan.py' jobs: image-extraction-and-security-scan: @@ -20,12 +20,12 @@ jobs: # Install kustomize - name: Install kustomize run: | - bash tests/gh-actions/install_kustomize.sh + bash tests/kustomize_install.sh # Install trivy - name: Install trivy run: | - bash tests/gh-actions/install_trivy.sh + bash tests/trivy_install.sh # Install Python - name: Setup Python @@ -40,7 +40,7 @@ jobs: - name: Run image extracting and security scanning script run: | - cd tests/gh-actions + cd tests python3 trivy_scan.py - name: Upload trivy scanned_results diff --git a/.github/workflows/volumes_web_application_test.yaml b/.github/workflows/volumes_web_application_test.yaml index 4e960a1323..51ccd5211c 100644 --- a/.github/workflows/volumes_web_application_test.yaml +++ b/.github/workflows/volumes_web_application_test.yaml @@ -2,16 +2,16 @@ name: Deploy and Test Volumes Web Application on: pull_request: paths: - - tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + - tests/install_KinD_create_KinD_cluster_install_kustomize.sh - .github/workflows/volumes_web_application_test.yaml - apps/volumes-web-app/upstream/** - - tests/gh-actions/install_istio-cni.sh + - tests/istio-cni_install.sh - common/istio*/** - common/oauth2-proxy/** - - tests/gh-actions/install_oauth2-proxy.sh - - tests/gh-actions/install_multi_tenancy.sh - - tests/gh-actions/install_volumes_web_application.sh - - tests/gh-actions/test_volumes_web_application.sh + - tests/oauth2-proxy_install.sh + - tests/multi_tenancy_install.sh + - tests/volumes_web_application_install.sh + - tests/volumes_web_application_test.sh env: KF_PROFILE: kubeflow-user-example-com @@ -25,34 +25,34 @@ jobs: uses: actions/checkout@v4 - name: Install KinD, Create KinD cluster and Install kustomize - run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh - name: Install kubectl - run: ./tests/gh-actions/install_kubectl.sh + run: ./tests/kubectl_install.sh - name: Create Kubeflow Namespace run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - - name: Install Certificate Manager - run: ./tests/gh-actions/install_cert_manager.sh + run: ./tests/cert_manager_install.sh - name: Install Istio CNI - run: ./tests/gh-actions/install_istio-cni.sh + run: ./tests/istio-cni_install.sh - name: Install OAuth2 Proxy - run: ./tests/gh-actions/install_oauth2-proxy.sh + run: ./tests/oauth2-proxy_install.sh - name: Install Kubeflow Istio Resources run: kustomize build common/istio-cni-1-24/kubeflow-istio-resources/base | kubectl apply -f - - name: Install Multi-Tenancy - run: ./tests/gh-actions/install_multi_tenancy.sh + run: ./tests/multi_tenancy_install.sh - name: Create KF Profile - run: ./tests/gh-actions/install_kubeflow_profile.sh + run: ./tests/kubeflow_profile_install.sh - name: Install Volumes Web Application - run: ./tests/gh-actions/install_volumes_web_application.sh + run: ./tests/volumes_web_application_install.sh - name: Wait for VWA Pods run: | @@ -60,7 +60,7 @@ jobs: sleep 15 - name: Port-forward the istio-ingress gateway - run: ./tests/gh-actions/port_forward_gateway.sh + run: ./tests/port_forward_gateway.sh - name: Test Volumes Web Application API - run: ./tests/gh-actions/test_volumes_web_application.sh "${KF_PROFILE}" + run: ./tests/volumes_web_application_test.sh "${KF_PROFILE}" diff --git a/tests/gh-actions/install_argo_cli.sh b/tests/argo_cli_install.sh similarity index 100% rename from tests/gh-actions/install_argo_cli.sh rename to tests/argo_cli_install.sh diff --git a/tests/gh-actions/enable_baseline_PSS.sh b/tests/baseline_PSS_enable.sh similarity index 100% rename from tests/gh-actions/enable_baseline_PSS.sh rename to tests/baseline_PSS_enable.sh diff --git a/tests/gh-actions/install_central_dashboard.sh b/tests/central_dashboard_install.sh similarity index 100% rename from tests/gh-actions/install_central_dashboard.sh rename to tests/central_dashboard_install.sh diff --git a/tests/gh-actions/install_cert_manager.sh b/tests/cert_manager_install.sh similarity index 100% rename from tests/gh-actions/install_cert_manager.sh rename to tests/cert_manager_install.sh diff --git a/tests/gh-actions/install_dex.sh b/tests/dex_install.sh similarity index 100% rename from tests/gh-actions/install_dex.sh rename to tests/dex_install.sh diff --git a/tests/gh-actions/test_dex_login.py b/tests/dex_login_test.py similarity index 100% rename from tests/gh-actions/test_dex_login.py rename to tests/dex_login_test.py diff --git a/tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh b/tests/install_KinD_create_KinD_cluster_install_kustomize.sh similarity index 100% rename from tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh rename to tests/install_KinD_create_KinD_cluster_install_kustomize.sh diff --git a/tests/gh-actions/install_istio-cni.sh b/tests/istio-cni_install.sh similarity index 100% rename from tests/gh-actions/install_istio-cni.sh rename to tests/istio-cni_install.sh diff --git a/tests/gh-actions/install_katib.sh b/tests/katib_install.sh similarity index 100% rename from tests/gh-actions/install_katib.sh rename to tests/katib_install.sh diff --git a/tests/gh-actions/kf-objects/katib_test.yaml b/tests/katib_test.yaml similarity index 100% rename from tests/gh-actions/kf-objects/katib_test.yaml rename to tests/katib_test.yaml diff --git a/tests/gh-actions/install_knative-cni.sh b/tests/knative-cni_install.sh similarity index 100% rename from tests/gh-actions/install_knative-cni.sh rename to tests/knative-cni_install.sh diff --git a/tests/gh-actions/kserve/data/iris_input.json b/tests/kserve/data/iris_input.json similarity index 100% rename from tests/gh-actions/kserve/data/iris_input.json rename to tests/kserve/data/iris_input.json diff --git a/tests/gh-actions/kserve/requirements.txt b/tests/kserve/requirements.txt similarity index 100% rename from tests/gh-actions/kserve/requirements.txt rename to tests/kserve/requirements.txt diff --git a/tests/gh-actions/kserve/test_sklearn.py b/tests/kserve/sklearn_test.py similarity index 100% rename from tests/gh-actions/kserve/test_sklearn.py rename to tests/kserve/sklearn_test.py diff --git a/tests/gh-actions/kserve/utils.py b/tests/kserve/utils.py similarity index 100% rename from tests/gh-actions/kserve/utils.py rename to tests/kserve/utils.py diff --git a/tests/gh-actions/install_kserve.sh b/tests/kserve_install.sh similarity index 100% rename from tests/gh-actions/install_kserve.sh rename to tests/kserve_install.sh diff --git a/tests/gh-actions/test_kserve.sh b/tests/kserve_test.sh similarity index 100% rename from tests/gh-actions/test_kserve.sh rename to tests/kserve_test.sh diff --git a/tests/gh-actions/kf-objects/kserve_test.yaml b/tests/kserve_test.yaml similarity index 100% rename from tests/gh-actions/kf-objects/kserve_test.yaml rename to tests/kserve_test.yaml diff --git a/tests/gh-actions/install_kubectl.sh b/tests/kubectl_install.sh similarity index 100% rename from tests/gh-actions/install_kubectl.sh rename to tests/kubectl_install.sh diff --git a/tests/gh-actions/install_kubeflow_profile.sh b/tests/kubeflow_profile_install.sh similarity index 100% rename from tests/gh-actions/install_kubeflow_profile.sh rename to tests/kubeflow_profile_install.sh diff --git a/tests/gh-actions/install_kustomize.sh b/tests/kustomize_install.sh similarity index 100% rename from tests/gh-actions/install_kustomize.sh rename to tests/kustomize_install.sh diff --git a/tests/gh-actions/install_multi_tenancy.sh b/tests/multi_tenancy_install.sh similarity index 100% rename from tests/gh-actions/install_multi_tenancy.sh rename to tests/multi_tenancy_install.sh diff --git a/tests/gh-actions/kf-objects/notebook.test.kubeflow-user-example.com.yaml b/tests/notebook.test.kubeflow-user-example.com.yaml similarity index 100% rename from tests/gh-actions/kf-objects/notebook.test.kubeflow-user-example.com.yaml rename to tests/notebook.test.kubeflow-user-example.com.yaml diff --git a/tests/gh-actions/install_oauth2-proxy.sh b/tests/oauth2-proxy_install.sh similarity index 100% rename from tests/gh-actions/install_oauth2-proxy.sh rename to tests/oauth2-proxy_install.sh diff --git a/tests/gh-actions/oauth2_dex_credentials.sh b/tests/oauth2_dex_credentials.sh similarity index 100% rename from tests/gh-actions/oauth2_dex_credentials.sh rename to tests/oauth2_dex_credentials.sh diff --git a/tests/gh-actions/kf-objects/test_pipeline.py b/tests/pipeline_test.py similarity index 100% rename from tests/gh-actions/kf-objects/test_pipeline.py rename to tests/pipeline_test.py diff --git a/tests/gh-actions/test_pipeline_v1.py b/tests/pipeline_v1_test.py similarity index 100% rename from tests/gh-actions/test_pipeline_v1.py rename to tests/pipeline_v1_test.py diff --git a/tests/gh-actions/test_pipeline_v2.py b/tests/pipeline_v2_test.py similarity index 100% rename from tests/gh-actions/test_pipeline_v2.py rename to tests/pipeline_v2_test.py diff --git a/tests/gh-actions/install_pipelines.sh b/tests/pipelines_install.sh similarity index 100% rename from tests/gh-actions/install_pipelines.sh rename to tests/pipelines_install.sh diff --git a/tests/gh-actions/install_pipelines_swfs.sh b/tests/pipelines_swfs_install.sh similarity index 100% rename from tests/gh-actions/install_pipelines_swfs.sh rename to tests/pipelines_swfs_install.sh diff --git a/tests/gh-actions/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml b/tests/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml similarity index 100% rename from tests/gh-actions/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml rename to tests/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml diff --git a/tests/gh-actions/port_forward_gateway.sh b/tests/port_forward_gateway.sh similarity index 100% rename from tests/gh-actions/port_forward_gateway.sh rename to tests/port_forward_gateway.sh diff --git a/tests/gh-actions/enable_restricted_PSS.sh b/tests/restricted_PSS_enable.sh similarity index 100% rename from tests/gh-actions/enable_restricted_PSS.sh rename to tests/restricted_PSS_enable.sh diff --git a/tests/gh-actions/run_and_wait_kubeflow_pipeline.py b/tests/run_and_wait_kubeflow_pipeline.py similarity index 100% rename from tests/gh-actions/run_and_wait_kubeflow_pipeline.py rename to tests/run_and_wait_kubeflow_pipeline.py diff --git a/tests/gh-actions/runasnonroot.sh b/tests/runasnonroot.sh similarity index 100% rename from tests/gh-actions/runasnonroot.sh rename to tests/runasnonroot.sh diff --git a/tests/gh-actions/install_spark.sh b/tests/spark_install.sh similarity index 100% rename from tests/gh-actions/install_spark.sh rename to tests/spark_install.sh diff --git a/tests/gh-actions/test_spark.sh b/tests/spark_test.sh similarity index 100% rename from tests/gh-actions/test_spark.sh rename to tests/spark_test.sh diff --git a/tests/gh-actions/install_training_operator.sh b/tests/training_operator_install.sh similarity index 100% rename from tests/gh-actions/install_training_operator.sh rename to tests/training_operator_install.sh diff --git a/tests/gh-actions/kf-objects/training_operator_job.yaml b/tests/training_operator_job.yaml similarity index 100% rename from tests/gh-actions/kf-objects/training_operator_job.yaml rename to tests/training_operator_job.yaml diff --git a/tests/gh-actions/test_training_operator.sh b/tests/training_operator_test.sh similarity index 100% rename from tests/gh-actions/test_training_operator.sh rename to tests/training_operator_test.sh diff --git a/tests/gh-actions/install_trivy.sh b/tests/trivy_install.sh similarity index 100% rename from tests/gh-actions/install_trivy.sh rename to tests/trivy_install.sh diff --git a/tests/gh-actions/trivy_scan.py b/tests/trivy_scan.py similarity index 100% rename from tests/gh-actions/trivy_scan.py rename to tests/trivy_scan.py diff --git a/tests/gh-actions/install_volumes_web_application.sh b/tests/volumes_web_application_install.sh similarity index 100% rename from tests/gh-actions/install_volumes_web_application.sh rename to tests/volumes_web_application_install.sh diff --git a/tests/gh-actions/test_volumes_web_application.sh b/tests/volumes_web_application_test.sh similarity index 100% rename from tests/gh-actions/test_volumes_web_application.sh rename to tests/volumes_web_application_test.sh From e9fd38e7939331e1ceeb638f3617ff840b61780e Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Thu, 15 May 2025 20:31:11 +0530 Subject: [PATCH 02/14] Updated file paths Signed-off-by: kunal-511 --- tests/training_operator_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/training_operator_test.sh b/tests/training_operator_test.sh index fefe6617ce..8a8c99bb11 100755 --- a/tests/training_operator_test.sh +++ b/tests/training_operator_test.sh @@ -2,7 +2,7 @@ set -euxo pipefail KF_PROFILE=${1:-kubeflow-user-example-com} -cat tests/gh-actions/kf-objects/training_operator_job.yaml | \ +cat tests/training_operator_job.yaml | \ sed 's/name: pytorch-simple/name: pytorch-simple\n namespace: '"$KF_PROFILE"'/g' > /tmp/pytorch-job.yaml kubectl apply -f /tmp/pytorch-job.yaml From d738a6d89c0ae173accd196e3206db7baca6e398 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Thu, 15 May 2025 20:31:32 +0530 Subject: [PATCH 03/14] Updated file paths Signed-off-by: kunal-511 --- .github/workflows/full_kubeflow_integration_test.yaml | 4 ++-- .github/workflows/spark_test.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/full_kubeflow_integration_test.yaml b/.github/workflows/full_kubeflow_integration_test.yaml index 3d6c9ecb8b..ef5c8007f9 100644 --- a/.github/workflows/full_kubeflow_integration_test.yaml +++ b/.github/workflows/full_kubeflow_integration_test.yaml @@ -135,11 +135,11 @@ jobs: run: ./tests/volumes_web_application_test.sh "${KF_PROFILE}" - name: Apply PodDefault for Pipeline Access Token - run: sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/kf-objects/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml | kubectl apply -f - + run: sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/poddefaults.access-ml-pipeline.kubeflow-user-example-com.yaml | kubectl apply -f - - name: Create Test Notebook run: | - sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/kf-objects/notebook.test.kubeflow-user-example.com.yaml | kubectl apply -f - + sed "s/kubeflow-user-example-com/$KF_PROFILE/g" tests/notebook.test.kubeflow-user-example.com.yaml | kubectl apply -f - kubectl wait --for=condition=Ready pod -l app=test -n $KF_PROFILE --timeout=300s - name: Copy and execute the pipeline run script in KF Notebook diff --git a/.github/workflows/spark_test.yaml b/.github/workflows/spark_test.yaml index 2a8af5914c..437ad8adba 100644 --- a/.github/workflows/spark_test.yaml +++ b/.github/workflows/spark_test.yaml @@ -48,5 +48,5 @@ jobs: # TODO remove the debugging lines ls -lah ../../tests/ chmod u+x ../../tests/*.sh - ../../tests/install_spark.sh - ../../tests/test_spark.sh "kubeflow-user-example-com" + ../../tests/spark_install.sh + ../../tests/spark_test.sh "kubeflow-user-example-com" From e5e471cc4924b6960ac25bc663029e548aaba3ef Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Thu, 15 May 2025 20:42:21 +0530 Subject: [PATCH 04/14] Updated file paths Signed-off-by: kunal-511 --- .github/workflows/dex_oauth2-proxy_test.yaml | 2 +- .github/workflows/pipeline_swfs_test.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dex_oauth2-proxy_test.yaml b/.github/workflows/dex_oauth2-proxy_test.yaml index e63a4f6daf..521dec1a42 100644 --- a/.github/workflows/dex_oauth2-proxy_test.yaml +++ b/.github/workflows/dex_oauth2-proxy_test.yaml @@ -10,7 +10,7 @@ on: - experimental/security/PSS/* - common/dex/base/** - tests/istio*.sh - - tests/test_dex_login.py + - tests/dex_login_test.py jobs: build: diff --git a/.github/workflows/pipeline_swfs_test.yaml b/.github/workflows/pipeline_swfs_test.yaml index 60b6a35b34..7a14a07e81 100644 --- a/.github/workflows/pipeline_swfs_test.yaml +++ b/.github/workflows/pipeline_swfs_test.yaml @@ -67,14 +67,14 @@ jobs: - name: List and deploy test pipeline with authorized ServiceAccount Token run: | - pip3 install kfp==2.13.0 + pip3 install kfp>=2.13.0 KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" python3 tests/pipeline_test.py run_pipeline "${TOKEN}" "${KF_PROFILE}" - name: Fail to list pipelines with unauthorized ServiceAccount Token run: | - pip3 install kfp==2.13.0 + pip3 install kfp>=2.13.0 KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n default create token default)" python3 tests/pipeline_test.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" From 8daa2f06bf1ed0ae2a71cd71041bef7363e14a70 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 09:41:35 +0530 Subject: [PATCH 05/14] Updated file paths Signed-off-by: kunal-511 --- .github/workflows/full_kubeflow_integration_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/full_kubeflow_integration_test.yaml b/.github/workflows/full_kubeflow_integration_test.yaml index ef5c8007f9..f9b8ec8e06 100644 --- a/.github/workflows/full_kubeflow_integration_test.yaml +++ b/.github/workflows/full_kubeflow_integration_test.yaml @@ -164,7 +164,7 @@ jobs: kubectl get trials.kubeflow.org -n $KF_PROFILE - name: Run Training Operator Test - run: ./tests/test_training_operator.sh "${KF_PROFILE}" + run: ./tests/training_operator_test.sh "${KF_PROFILE}" - name: Run KServe Test run: | From fd4bd4a3524bd3855504fe16c3bbbe7ce9442b36 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 09:55:04 +0530 Subject: [PATCH 06/14] Updated pipeline to use latest version Signed-off-by: kunal-511 --- .github/workflows/pipeline_swfs_test.yaml | 4 +- tests/pipeline_test.py | 53 ++++++++++++++++++----- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pipeline_swfs_test.yaml b/.github/workflows/pipeline_swfs_test.yaml index 7a14a07e81..2970c96eab 100644 --- a/.github/workflows/pipeline_swfs_test.yaml +++ b/.github/workflows/pipeline_swfs_test.yaml @@ -67,14 +67,14 @@ jobs: - name: List and deploy test pipeline with authorized ServiceAccount Token run: | - pip3 install kfp>=2.13.0 + pip3 install "kfp>=2.13.0" KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n $KF_PROFILE create token default-editor)" python3 tests/pipeline_test.py run_pipeline "${TOKEN}" "${KF_PROFILE}" - name: Fail to list pipelines with unauthorized ServiceAccount Token run: | - pip3 install kfp>=2.13.0 + pip3 install "kfp>=2.13.0" KF_PROFILE=kubeflow-user-example-com TOKEN="$(kubectl -n default create token default)" python3 tests/pipeline_test.py test_unauthorized_access "${TOKEN}" "${KF_PROFILE}" diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 6755d30ff4..6cfbf41a95 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -1,9 +1,9 @@ import kfp from kfp import dsl -import kfp.components as comp +import sys -@comp.create_component_from_func +@dsl.component def echo_op(): print("Test pipeline") @@ -13,17 +13,50 @@ def hello_world_pipeline(): echo_task = echo_op() -if __name__ == "__main__": - # Run the Kubeflow Pipeline in the user's namespace. +def run_pipeline(token, namespace): kfp_client = kfp.Client( - host="http://localhost:3000", namespace="kubeflow-user-example-com" + host="http://localhost:3000", + namespace=namespace, + cookies="" ) kfp_client.runs.api_client.default_headers.update( - {"kubeflow-userid": "kubeflow-user-example-com"} + {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} ) - # create the KFP run - run_id = kfp_client.create_run_from_pipeline_func( + kfp_client.create_run_from_pipeline_func( hello_world_pipeline, - namespace="kubeflow-user-example-com", + namespace=namespace, arguments={}, - ).run_id + ) + + +def test_unauthorized_access(token, namespace): + try: + kfp_client = kfp.Client( + host="http://localhost:3000", + namespace=namespace, + cookies="" + ) + kfp_client.runs.api_client.default_headers.update( + {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} + ) + + kfp_client.list_pipelines() + sys.exit(1) + except Exception: + sys.exit(0) + + +if __name__ == "__main__": + if len(sys.argv) < 3: + sys.exit(1) + + action = sys.argv[1] + token = sys.argv[2] + namespace = sys.argv[3] + + if action == "run_pipeline": + run_pipeline(token, namespace) + elif action == "test_unauthorized_access": + test_unauthorized_access(token, namespace) + else: + sys.exit(1) From 96a4bb2ad352d2cf0ff8d7cce8d33963ae4b2780 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 10:03:12 +0530 Subject: [PATCH 07/14] Updated port number Signed-off-by: kunal-511 --- tests/pipeline_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 6cfbf41a95..7df17951f4 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -15,7 +15,7 @@ def hello_world_pipeline(): def run_pipeline(token, namespace): kfp_client = kfp.Client( - host="http://localhost:3000", + host="http://localhost:8080", namespace=namespace, cookies="" ) @@ -32,7 +32,7 @@ def run_pipeline(token, namespace): def test_unauthorized_access(token, namespace): try: kfp_client = kfp.Client( - host="http://localhost:3000", + host="http://localhost:8080", namespace=namespace, cookies="" ) From 70772034947da7b08cb87ffe08c3346b8486be4d Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 10:14:51 +0530 Subject: [PATCH 08/14] updated api path Signed-off-by: kunal-511 --- tests/pipeline_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 7df17951f4..37e6d4fef7 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -15,7 +15,7 @@ def hello_world_pipeline(): def run_pipeline(token, namespace): kfp_client = kfp.Client( - host="http://localhost:8080", + host="http://localhost:8080/pipeline", namespace=namespace, cookies="" ) @@ -32,7 +32,7 @@ def run_pipeline(token, namespace): def test_unauthorized_access(token, namespace): try: kfp_client = kfp.Client( - host="http://localhost:8080", + host="http://localhost:8080/pipeline", namespace=namespace, cookies="" ) From 4edc776328d6197e9b2506f4dfb6973ed6699b5a Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 10:24:37 +0530 Subject: [PATCH 09/14] Improved handling Signed-off-by: kunal-511 --- tests/pipeline_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 37e6d4fef7..997bac3290 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -41,9 +41,9 @@ def test_unauthorized_access(token, namespace): ) kfp_client.list_pipelines() - sys.exit(1) + return False except Exception: - sys.exit(0) + return True if __name__ == "__main__": @@ -57,6 +57,8 @@ def test_unauthorized_access(token, namespace): if action == "run_pipeline": run_pipeline(token, namespace) elif action == "test_unauthorized_access": - test_unauthorized_access(token, namespace) + success = test_unauthorized_access(token, namespace) + if not success: + sys.exit(1) else: sys.exit(1) From 4b8ae85f8a210fbfb291747fa9233c9debfb8ff6 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 10:32:54 +0530 Subject: [PATCH 10/14] Removed the unnecessary return values and if/else logic in the main section Signed-off-by: kunal-511 --- tests/pipeline_test.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 997bac3290..37e6d4fef7 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -41,9 +41,9 @@ def test_unauthorized_access(token, namespace): ) kfp_client.list_pipelines() - return False + sys.exit(1) except Exception: - return True + sys.exit(0) if __name__ == "__main__": @@ -57,8 +57,6 @@ def test_unauthorized_access(token, namespace): if action == "run_pipeline": run_pipeline(token, namespace) elif action == "test_unauthorized_access": - success = test_unauthorized_access(token, namespace) - if not success: - sys.exit(1) + test_unauthorized_access(token, namespace) else: sys.exit(1) From 4f08b865ddebceca2753a6c7e27444d67aa1a819 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 10:51:59 +0530 Subject: [PATCH 11/14] Improved error handling Signed-off-by: kunal-511 --- tests/pipeline_test.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 37e6d4fef7..6f86762cab 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -2,17 +2,14 @@ from kfp import dsl import sys - @dsl.component def echo_op(): print("Test pipeline") - @dsl.pipeline(name="test-pipeline", description="A test pipeline.") def hello_world_pipeline(): echo_task = echo_op() - def run_pipeline(token, namespace): kfp_client = kfp.Client( host="http://localhost:8080/pipeline", @@ -28,11 +25,10 @@ def run_pipeline(token, namespace): arguments={}, ) - def test_unauthorized_access(token, namespace): try: kfp_client = kfp.Client( - host="http://localhost:8080/pipeline", + host="http://localhost:8080/pipeline", namespace=namespace, cookies="" ) @@ -40,12 +36,15 @@ def test_unauthorized_access(token, namespace): {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} ) - kfp_client.list_pipelines() - sys.exit(1) + pipelines = kfp_client.list_pipelines() + + if pipelines and len(pipelines.pipelines or []) > 0: + sys.exit(1) + else: + sys.exit(0) except Exception: sys.exit(0) - if __name__ == "__main__": if len(sys.argv) < 3: sys.exit(1) @@ -59,4 +58,4 @@ def test_unauthorized_access(token, namespace): elif action == "test_unauthorized_access": test_unauthorized_access(token, namespace) else: - sys.exit(1) + sys.exit(1) \ No newline at end of file From b8cd2efef10c168422c813c9e7f0a97fd4eac7d8 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 11:04:39 +0530 Subject: [PATCH 12/14] Now using existing_token instead of manually setting headers Signed-off-by: kunal-511 --- tests/pipeline_test.py | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 6f86762cab..64bb7f0e50 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -11,37 +11,23 @@ def hello_world_pipeline(): echo_task = echo_op() def run_pipeline(token, namespace): - kfp_client = kfp.Client( - host="http://localhost:8080/pipeline", - namespace=namespace, - cookies="" - ) - kfp_client.runs.api_client.default_headers.update( - {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} - ) - kfp_client.create_run_from_pipeline_func( + client = kfp.Client(host="http://localhost:8080/pipeline", existing_token=token) + + experiment = client.create_experiment("default", namespace=namespace) + + client.create_run_from_pipeline_func( hello_world_pipeline, + experiment_name=experiment.name, namespace=namespace, arguments={}, ) def test_unauthorized_access(token, namespace): try: - kfp_client = kfp.Client( - host="http://localhost:8080/pipeline", - namespace=namespace, - cookies="" - ) - kfp_client.runs.api_client.default_headers.update( - {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} - ) - - pipelines = kfp_client.list_pipelines() + client = kfp.Client(host="http://localhost:8080/pipeline", existing_token=token) - if pipelines and len(pipelines.pipelines or []) > 0: - sys.exit(1) - else: - sys.exit(0) + client.list_runs(namespace=namespace) + sys.exit(1) except Exception: sys.exit(0) From 104a5848e85315d0516c0c285282d0a517285a38 Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 11:32:58 +0530 Subject: [PATCH 13/14] Added detail logging to know the error Signed-off-by: kunal-511 --- tests/pipeline_test.py | 75 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 64bb7f0e50..10057e07b1 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -1,6 +1,8 @@ import kfp from kfp import dsl import sys +import time +import traceback @dsl.component def echo_op(): @@ -11,37 +13,82 @@ def hello_world_pipeline(): echo_task = echo_op() def run_pipeline(token, namespace): - client = kfp.Client(host="http://localhost:8080/pipeline", existing_token=token) - - experiment = client.create_experiment("default", namespace=namespace) - - client.create_run_from_pipeline_func( - hello_world_pipeline, - experiment_name=experiment.name, - namespace=namespace, - arguments={}, - ) + print(f"[DEBUG] Starting run_pipeline for namespace: {namespace}") + try: + print("[DEBUG] Creating KFP client") + kfp_client = kfp.Client( + host="http://localhost:8080/pipeline", + namespace=namespace, + cookies="" + ) + + print("[DEBUG] Setting up authentication headers") + kfp_client.runs.api_client.default_headers.update( + {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} + ) + + print("[DEBUG] Creating pipeline run") + kfp_client.create_run_from_pipeline_func( + hello_world_pipeline, + namespace=namespace, + arguments={}, + ) + print("[DEBUG] Pipeline run created successfully") + except Exception as e: + print(f"[ERROR] Failed to run pipeline: {e}") + print(f"[ERROR] Exception type: {type(e).__name__}") + traceback.print_exc() + sys.exit(1) def test_unauthorized_access(token, namespace): + print(f"[DEBUG] Starting test_unauthorized_access for namespace: {namespace}") try: - client = kfp.Client(host="http://localhost:8080/pipeline", existing_token=token) + print("[DEBUG] Creating KFP client for unauthorized test") + kfp_client = kfp.Client( + host="http://localhost:8080/pipeline", + namespace=namespace, + cookies="" + ) - client.list_runs(namespace=namespace) - sys.exit(1) - except Exception: + print("[DEBUG] Setting up authentication headers") + kfp_client.runs.api_client.default_headers.update( + {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} + ) + + print("[DEBUG] Attempting to list pipelines (should fail for unauthorized users)") + pipelines = kfp_client.list_pipelines() + + print(f"[WARNING] Successfully accessed {len(pipelines.pipelines or [])} pipelines - this should have failed!") + if pipelines and len(pipelines.pipelines or []) > 0: + print("[ERROR] Unauthorized access was allowed - security issue detected") + sys.exit(1) + else: + print("[INFO] No pipelines were returned, but request should have been denied") + sys.exit(0) + except Exception as e: + print(f"[DEBUG] Expected exception encountered: {e}") + print(f"[DEBUG] Exception type: {type(e).__name__}") + if 'ApiException' in str(type(e).__name__): + print(f"[DEBUG] Status code: {getattr(e, 'status', 'unknown')}") + print("[INFO] Request was properly denied as expected") sys.exit(0) if __name__ == "__main__": + print(f"[DEBUG] Starting pipeline_test.py with args: {sys.argv}") if len(sys.argv) < 3: + print("[ERROR] Missing required arguments") + print("Usage: python pipeline_test.py [run_pipeline|test_unauthorized_access] TOKEN NAMESPACE") sys.exit(1) action = sys.argv[1] token = sys.argv[2] namespace = sys.argv[3] + print(f"[DEBUG] Running action: {action}") if action == "run_pipeline": run_pipeline(token, namespace) elif action == "test_unauthorized_access": test_unauthorized_access(token, namespace) else: + print(f"[ERROR] Unknown action: {action}") sys.exit(1) \ No newline at end of file From d0b38a685682be3cc32c02adcde1de05fa44c0ca Mon Sep 17 00:00:00 2001 From: kunal-511 Date: Fri, 16 May 2025 12:40:17 +0530 Subject: [PATCH 14/14] Removed logs Signed-off-by: kunal-511 --- tests/pipeline_test.py | 61 ++++++++++-------------------------------- 1 file changed, 14 insertions(+), 47 deletions(-) diff --git a/tests/pipeline_test.py b/tests/pipeline_test.py index 10057e07b1..6f86762cab 100755 --- a/tests/pipeline_test.py +++ b/tests/pipeline_test.py @@ -1,8 +1,6 @@ import kfp from kfp import dsl import sys -import time -import traceback @dsl.component def echo_op(): @@ -13,82 +11,51 @@ def hello_world_pipeline(): echo_task = echo_op() def run_pipeline(token, namespace): - print(f"[DEBUG] Starting run_pipeline for namespace: {namespace}") - try: - print("[DEBUG] Creating KFP client") - kfp_client = kfp.Client( - host="http://localhost:8080/pipeline", - namespace=namespace, - cookies="" - ) - - print("[DEBUG] Setting up authentication headers") - kfp_client.runs.api_client.default_headers.update( - {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} - ) - - print("[DEBUG] Creating pipeline run") - kfp_client.create_run_from_pipeline_func( - hello_world_pipeline, - namespace=namespace, - arguments={}, - ) - print("[DEBUG] Pipeline run created successfully") - except Exception as e: - print(f"[ERROR] Failed to run pipeline: {e}") - print(f"[ERROR] Exception type: {type(e).__name__}") - traceback.print_exc() - sys.exit(1) + kfp_client = kfp.Client( + host="http://localhost:8080/pipeline", + namespace=namespace, + cookies="" + ) + kfp_client.runs.api_client.default_headers.update( + {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} + ) + kfp_client.create_run_from_pipeline_func( + hello_world_pipeline, + namespace=namespace, + arguments={}, + ) def test_unauthorized_access(token, namespace): - print(f"[DEBUG] Starting test_unauthorized_access for namespace: {namespace}") try: - print("[DEBUG] Creating KFP client for unauthorized test") kfp_client = kfp.Client( host="http://localhost:8080/pipeline", namespace=namespace, cookies="" ) - - print("[DEBUG] Setting up authentication headers") kfp_client.runs.api_client.default_headers.update( {"Authorization": f"Bearer {token}", "kubeflow-userid": namespace} ) - print("[DEBUG] Attempting to list pipelines (should fail for unauthorized users)") pipelines = kfp_client.list_pipelines() - print(f"[WARNING] Successfully accessed {len(pipelines.pipelines or [])} pipelines - this should have failed!") if pipelines and len(pipelines.pipelines or []) > 0: - print("[ERROR] Unauthorized access was allowed - security issue detected") sys.exit(1) else: - print("[INFO] No pipelines were returned, but request should have been denied") sys.exit(0) - except Exception as e: - print(f"[DEBUG] Expected exception encountered: {e}") - print(f"[DEBUG] Exception type: {type(e).__name__}") - if 'ApiException' in str(type(e).__name__): - print(f"[DEBUG] Status code: {getattr(e, 'status', 'unknown')}") - print("[INFO] Request was properly denied as expected") + except Exception: sys.exit(0) if __name__ == "__main__": - print(f"[DEBUG] Starting pipeline_test.py with args: {sys.argv}") if len(sys.argv) < 3: - print("[ERROR] Missing required arguments") - print("Usage: python pipeline_test.py [run_pipeline|test_unauthorized_access] TOKEN NAMESPACE") sys.exit(1) action = sys.argv[1] token = sys.argv[2] namespace = sys.argv[3] - print(f"[DEBUG] Running action: {action}") if action == "run_pipeline": run_pipeline(token, namespace) elif action == "test_unauthorized_access": test_unauthorized_access(token, namespace) else: - print(f"[ERROR] Unknown action: {action}") sys.exit(1) \ No newline at end of file