|
3 | 3 | pull_request: |
4 | 4 | paths: |
5 | 5 | - tests/install_KinD_create_KinD_cluster_install_kustomize.sh |
6 | | - - .github/workflows/kserve_m2m_test.yaml |
| 6 | + - .github/workflows/kserve_test.yaml |
7 | 7 | - applications/kserve/** |
| 8 | + - apps/kserve/** |
8 | 9 | - tests/kserve/** |
9 | 10 | - tests/kserve_test.sh |
10 | 11 | - tests/kserve_install.sh |
| 12 | + - tests/kserve_jwt_authentication_test.sh |
11 | 13 | - common/istio*/** |
12 | 14 | - common/oauth2-proxy/** |
13 | 15 | - tests/oauth2-proxy_install.sh |
14 | 16 | - common/cert-manager/** |
15 | 17 | - tests/istio* |
16 | 18 | - common/knative/** |
17 | 19 | - tests/knative_install.sh |
| 20 | + - tests/*authentication*test.sh |
| 21 | + - tests/final_validation.sh |
18 | 22 |
|
19 | 23 | permissions: |
20 | 24 | contents: read |
21 | 25 | actions: read |
22 | 26 |
|
23 | 27 | jobs: |
24 | | - build: |
| 28 | + test-basic-kserve: |
25 | 29 | runs-on: ubuntu-latest |
26 | 30 | steps: |
27 | 31 | - name: Checkout |
@@ -93,3 +97,140 @@ jobs: |
93 | 97 |
|
94 | 98 | - name: Apply Pod Security Standards restricted levels |
95 | 99 | run: ./tests/PSS_enable.sh |
| 100 | + |
| 101 | + test-jwt-authentication: |
| 102 | + runs-on: ubuntu-latest |
| 103 | + steps: |
| 104 | + - name: Checkout |
| 105 | + uses: actions/checkout@v4 |
| 106 | + |
| 107 | + - name: Install KinD, Create KinD cluster and Install kustomize |
| 108 | + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh |
| 109 | + |
| 110 | + - name: Install kubectl |
| 111 | + run: ./tests/kubectl_install.sh |
| 112 | + |
| 113 | + - name: Create kubeflow namespace |
| 114 | + run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - |
| 115 | + |
| 116 | + - name: Install Istio CNI |
| 117 | + run: ./tests/istio-cni_install.sh |
| 118 | + |
| 119 | + - name: Install oauth2-proxy |
| 120 | + run: ./tests/oauth2-proxy_install.sh |
| 121 | + |
| 122 | + - name: Install knative CNI with secure cluster-local-gateway |
| 123 | + run: ./tests/knative_install.sh |
| 124 | + |
| 125 | + - name: Verify secure cluster-local-gateway configuration |
| 126 | + run: | |
| 127 | + kubectl get authorizationpolicy,requestauthentication -n istio-system | grep cluster-local-gateway |
| 128 | + kubectl get requestauthentication cluster-local-gateway-jwt -n istio-system -o yaml |
| 129 | + kubectl get authorizationpolicy cluster-local-gateway -n istio-system -o yaml |
| 130 | + kubectl get authorizationpolicy cluster-local-gateway-require-jwt -n istio-system -o yaml |
| 131 | +
|
| 132 | + - name: Setup python 3.12 |
| 133 | + uses: actions/setup-python@v4 |
| 134 | + with: |
| 135 | + python-version: 3.12 |
| 136 | + |
| 137 | + - name: Port forward |
| 138 | + run: ./tests/port_forward_gateway.sh |
| 139 | + |
| 140 | + - name: Wait for cluster-local-gateway to be ready |
| 141 | + run: | |
| 142 | + kubectl wait --for=condition=Available --timeout=120s deployment/cluster-local-gateway -n istio-system |
| 143 | + sleep 100 |
| 144 | +
|
| 145 | + - name: Run Basic JWT Authentication Tests |
| 146 | + run: | |
| 147 | + export KSERVE_INGRESS_HOST_PORT=localhost:8080 |
| 148 | + curl -s -o /dev/null -w "%{http_code}" -H "Host: test.example.com" "http://localhost:8080/" | grep -q "403" |
| 149 | +
|
| 150 | + - name: Run Knative Service JWT Authentication Tests |
| 151 | + run: | |
| 152 | + export KSERVE_INGRESS_HOST_PORT=localhost:8080 |
| 153 | + ./tests/knative_authentication_test.sh |
| 154 | +
|
| 155 | + - name: Test External Access Configuration |
| 156 | + run: | |
| 157 | + export KSERVE_INGRESS_HOST_PORT=localhost:8080 |
| 158 | + ./tests/kserve_setup_external_access.sh kubeflow-user-example-com secure-model-predictor |
| 159 | + # Test external access pattern |
| 160 | + TOKEN=$(kubectl -n kubeflow-user-example-com create token default-editor) |
| 161 | + RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" \ |
| 162 | + -H "Authorization: Bearer $TOKEN" \ |
| 163 | + -H "Content-Type: application/json" \ |
| 164 | + "http://localhost:8080/kserve/kubeflow-user-example-com/secure-model-predictor/" \ |
| 165 | + 2>/dev/null || echo "404") |
| 166 | + if [ "$RESPONSE" != "404" ] && [ "$RESPONSE" != "200" ] && [ "$RESPONSE" != "503" ]; then |
| 167 | + exit 1 |
| 168 | + fi |
| 169 | +
|
| 170 | + - name: Apply Pod Security Standards restricted levels |
| 171 | + run: ./tests/PSS_enable.sh |
| 172 | + |
| 173 | + test-secure-authentication: |
| 174 | + runs-on: ubuntu-latest |
| 175 | + steps: |
| 176 | + - name: Checkout |
| 177 | + uses: actions/checkout@v4 |
| 178 | + |
| 179 | + - name: Install KinD, Create KinD cluster and Install kustomize |
| 180 | + run: ./tests/install_KinD_create_KinD_cluster_install_kustomize.sh |
| 181 | + |
| 182 | + - name: Install kubectl |
| 183 | + run: ./tests/kubectl_install.sh |
| 184 | + |
| 185 | + - name: Create kubeflow namespace |
| 186 | + run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - |
| 187 | + |
| 188 | + - name: Install Istio CNI |
| 189 | + run: ./tests/istio-cni_install.sh |
| 190 | + |
| 191 | + - name: Install oauth2-proxy |
| 192 | + run: ./tests/oauth2-proxy_install.sh |
| 193 | + |
| 194 | + - name: Install cert-manager |
| 195 | + run: ./tests/cert_manager_install.sh |
| 196 | + |
| 197 | + - name: Install knative CNI (with secure cluster-local-gateway) |
| 198 | + run: ./tests/knative_install.sh |
| 199 | + |
| 200 | + - name: Install KServe |
| 201 | + run: ./tests/kserve_install.sh |
| 202 | + |
| 203 | + - name: Install KF Multi Tenancy |
| 204 | + run: ./tests/multi_tenancy_install.sh |
| 205 | + |
| 206 | + - name: Install kubeflow-istio-resources |
| 207 | + run: kustomize build common/istio/kubeflow-istio-resources/base | kubectl apply -f - |
| 208 | + |
| 209 | + - name: Create KF Profile |
| 210 | + run: ./tests/kubeflow_profile_install.sh |
| 211 | + |
| 212 | + - name: Setup python 3.12 |
| 213 | + uses: actions/setup-python@v4 |
| 214 | + with: |
| 215 | + python-version: 3.12 |
| 216 | + |
| 217 | + - name: Port forward |
| 218 | + run: ./tests/port_forward_gateway.sh |
| 219 | + |
| 220 | + - name: Verify JWT authentication policies are applied |
| 221 | + run: | |
| 222 | + kubectl get authorizationpolicy cluster-local-gateway-require-jwt -n istio-system |
| 223 | + kubectl get requestauthentication cluster-local-gateway-jwt -n istio-system |
| 224 | + kubectl get authorizationpolicy cluster-local-gateway -n istio-system |
| 225 | + kubectl get deployment cluster-local-gateway -n istio-system |
| 226 | + kubectl wait --for=condition=Available deployment/cluster-local-gateway -n istio-system --timeout=120s |
| 227 | + kubectl get pods -n istio-system -l app=cluster-jwks-proxy | grep -q Running || kubectl get pods -n istio-system -l app=cluster-jwks-proxy |
| 228 | +
|
| 229 | + - name: Wait for configurations to propagate |
| 230 | + run: sleep 60 |
| 231 | + |
| 232 | + - name: Run KServe secure authentication tests |
| 233 | + run: ./tests/kserve_jwt_authentication_test.sh kubeflow-user-example-com |
| 234 | + |
| 235 | + - name: Apply Pod Security Standards restricted levels |
| 236 | + run: ./tests/PSS_enable.sh |
0 commit comments