Skip to content

Commit a1eb452

Browse files
authored
fix: use correct principal for dashboard v2 (#158)
* fix: use correct principal for dashboard v2 Signed-off-by: Kimonas Sotirchos <[email protected]> * feat: add test for ensuring dashboard to KFAM communication Signed-off-by: Kimonas Sotirchos <[email protected]> * review: use the test-dashboard command from test_service.sh Signed-off-by: Kimonas Sotirchos <[email protected]> * chore: simplify the integration tests action Signed-off-by: Kimonas Sotirchos <[email protected]> --------- Signed-off-by: Kimonas Sotirchos <[email protected]>
1 parent 69447bd commit a1eb452

File tree

3 files changed

+26
-78
lines changed

3 files changed

+26
-78
lines changed

.github/workflows/central_dashboard_integration_test.yaml

Lines changed: 14 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
pull_request:
44
paths:
55
- components/centraldashboard/**
6-
- components/access-management/**
7-
- components/profile-controller/**
6+
- components/access-management/**
7+
- components/profile-controller/**
88
- releasing/version/VERSION
99
- .github/workflows/central_dashboard_integration_test.yaml
1010
branches:
@@ -15,12 +15,6 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
1616
cancel-in-progress: true
1717

18-
env:
19-
DASHBOARD_IMG: ghcr.io/kubeflow/dashboard/dashboard
20-
ACCESS_MANAGEMENT_IMG: ghcr.io/kubeflow/dashboard/access-management
21-
PROFILE_CONTROLLER_IMG: ghcr.io/kubeflow/dashboard/profile-controller
22-
TAG: integration-test
23-
2418
jobs:
2519
integration-test:
2620
runs-on: ubuntu-22.04
@@ -48,53 +42,28 @@ jobs:
4842
- name: Create Kubeflow Namespace
4943
run: kubectl create namespace kubeflow
5044

51-
- name: Build KFAM Image
52-
run: |
53-
cd components/access-management
54-
make docker-build-multi-arch IMG="${ACCESS_MANAGEMENT_IMG}" TAG="${TAG}"
55-
kind load docker-image "${ACCESS_MANAGEMENT_IMG}:${TAG}"
56-
cd ../..
45+
- name: Deploy Profile Controller with KFAM
46+
run: ./testing/shared/install_profile_controller.sh
5747

58-
- name: Build and Deploy Profile Controller with KFAM
59-
run: |
60-
cd components/profile-controller
61-
make docker-build-multi-arch IMG="${PROFILE_CONTROLLER_IMG}" TAG="${TAG}"
62-
kind load docker-image "${PROFILE_CONTROLLER_IMG}:${TAG}"
63-
cd config
64-
kustomize build overlays/kubeflow \
65-
| sed "s|ghcr.io/kubeflow/dashboard/profile-controller:[a-zA-Z0-9_.-]*|${PROFILE_CONTROLLER_IMG}:${TAG}|g" \
66-
| sed "s|ghcr.io/kubeflow/dashboard/access-management:[a-zA-Z0-9_.-]*|${ACCESS_MANAGEMENT_IMG}:${TAG}|g" \
67-
| kubectl apply -f -
68-
kubectl wait --for=condition=Available deployment -n kubeflow profiles-deployment --timeout=300s
69-
kubectl wait --for=condition=Ready pods -n kubeflow -l kustomize.component=profiles --timeout=300s
70-
71-
- name: Build and Deploy Central Dashboard
72-
run: |
73-
./testing/shared/deploy_component.sh \
74-
"components/centraldashboard" \
75-
"${DASHBOARD_IMG}" \
76-
"${TAG}" \
77-
"manifests" \
78-
"overlays/kserve"
79-
kubectl wait --for=condition=Ready pods -n kubeflow -l app=dashboard --timeout=300s
80-
kubectl wait --for=condition=Available deployment -n kubeflow dashboard --timeout=300s
48+
- name: Deploy CentralDashboard Component
49+
run: ./testing/shared/install_centraldashboard.sh
8150

8251
- name: Create Test Profile for Dashboard Testing
8352
run: |
8453
kubectl apply -f components/profile-controller/integration/resources/profile-dashboard-test.yaml
85-
54+
8655
for i in {1..60}; do
8756
if kubectl get namespace test-dashboard-profile >/dev/null 2>&1; then
8857
break
8958
fi
9059
echo "Waiting for namespace... (attempt $i/60)"
9160
sleep 5
9261
done
93-
62+
9463
if ! kubectl get namespace test-dashboard-profile >/dev/null 2>&1; then
9564
exit 1
9665
fi
97-
66+
9867
kubectl get profile test-dashboard-profile
9968
kubectl get namespace test-dashboard-profile
10069
@@ -110,46 +79,24 @@ jobs:
11079
run: |
11180
./testing/shared/test_service.sh test-health dashboard kubeflow 8082
11281
113-
- name: Test Dashboard Web Interface
82+
- name: Integration Tests
11483
run: |
115-
curl -f "http://localhost:8082/" >/dev/null 2>&1
116-
117-
curl -f "http://localhost:8082/healthz" >/dev/null 2>&1
118-
119-
RESPONSE=$(curl -s "http://localhost:8082/" | head -c 100)
120-
if [[ -n "$RESPONSE" ]]; then
121-
echo "Dashboard is serving content: ${RESPONSE:0:50}..."
122-
else
123-
exit 1
124-
fi
125-
12684
kubectl get service dashboard -n kubeflow
12785
kubectl get pods -n kubeflow -l app=dashboard
128-
129-
- name: Test Dashboard Performance
130-
run: |
86+
./testing/shared/test_service.sh test-dashboard dashboard kubeflow 8082
13187
./testing/shared/test_service.sh performance-test dashboard kubeflow 8082 80 10
132-
133-
- name: Test Dashboard Metrics
134-
run: |
13588
./testing/shared/test_service.sh test-metrics dashboard kubeflow 8082
136-
137-
- name: Check Dashboard Logs
138-
run: |
13989
./testing/shared/test_service.sh check-logs dashboard kubeflow 50
140-
141-
- name: Check for Errors in Logs
142-
run: |
14390
./testing/shared/test_service.sh check-errors dashboard kubeflow
14491
14592
- name: Test Dashboard Configuration
14693
run: |
147-
kubectl get configmap dashboard-config -n kubeflow
148-
kubectl describe configmap dashboard-config -n kubeflow
94+
kubectl get configmap dashboard-config -n kubeflow
95+
kubectl describe configmap dashboard-config -n kubeflow
14996
15097
- name: Test Virtual Service (if Istio is configured)
15198
run: |
152-
kubectl get virtualservice dashboard -n kubeflow
99+
kubectl get virtualservice dashboard -n kubeflow
153100
154101
- name: Stop Port Forward
155102
run: |

components/profile-controller/config/overlays/kubeflow/authorizationpolicy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
- from:
99
- source:
1010
principals:
11-
- cluster.local/ns/kubeflow/sa/centraldashboard
11+
- cluster.local/ns/kubeflow/sa/dashboard
1212
selector:
1313
matchLabels:
1414
kustomize.component: profiles

testing/shared/test_service.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ case "$OPERATION" in
2222
"stop-port-forward")
2323
if [ -f "/tmp/portforward_${SERVICE_NAME}_${PORT}.pid" ]; then
2424
PF_PID=$(cat /tmp/portforward_${SERVICE_NAME}_${PORT}.pid)
25-
kill "${PF_PID}"
25+
kill "${PF_PID}"
2626
rm -f /tmp/portforward_${SERVICE_NAME}_${PORT}.pid
2727
fi
2828
;;
@@ -33,24 +33,25 @@ case "$OPERATION" in
3333

3434
"test-dashboard")
3535
curl -f "http://localhost:${PORT}/" >/dev/null 2>&1
36-
curl -f "http://localhost:${PORT}/assets/dashboard.js" >/dev/null 2>&1
37-
curl -f "http://localhost:${PORT}/api/v1/namespaces" >/dev/null 2>&1
38-
curl -L "http://localhost:${PORT}/jupyter" >/dev/null 2>&1
39-
curl -L "http://localhost:${PORT}/pipeline" >/dev/null 2>&1
40-
curl -L "http://localhost:${PORT}/katib" >/dev/null 2>&1
36+
curl -f "http://localhost:${PORT}/assets/dashboard.js" >/dev/null 2>&1
37+
# test communication between dashboard and access-management
38+
curl -f \
39+
-H "kubeflow-userid: test-user" \
40+
"http://localhost:${PORT}/api/workgroup/exists" \
41+
>/dev/null 2>&1
4142
;;
4243

4344
"test-kfam")
4445
curl -f "http://localhost:${PORT}/healthz" >/dev/null 2>&1
45-
curl "http://localhost:${PORT}/version" 2>/dev/null
46+
curl "http://localhost:${PORT}/version" 2>/dev/null
4647
;;
4748

4849
"test-api-with-user")
4950
USER_EMAIL="${6:-test-user@example.com}"
5051
PROFILE_NAMESPACE="${7:-test-profile}"
5152
curl -H "kubeflow-userid: ${USER_EMAIL}" \
5253
"http://localhost:${PORT}/kfam/v1/bindings?namespace=${PROFILE_NAMESPACE}" \
53-
2>/dev/null
54+
2>/dev/null
5455
;;
5556

5657
"performance-test")
@@ -62,7 +63,7 @@ case "$OPERATION" in
6263
;;
6364

6465
"test-metrics")
65-
curl "http://localhost:${PORT}/metrics" 2>/dev/null
66+
curl "http://localhost:${PORT}/metrics" 2>/dev/null
6667
;;
6768

6869
"validate-service")
@@ -94,4 +95,4 @@ case "$OPERATION" in
9495
echo "Valid operations: port-forward, stop-port-forward, test-health, test-dashboard, test-kfam, test-api-with-user, performance-test, test-metrics, validate-service, check-logs, check-errors"
9596
exit 1
9697
;;
97-
esac
98+
esac

0 commit comments

Comments
 (0)