Skip to content

Commit 4b19c24

Browse files
committed
ci: add centraldashboard-angular tests
Part of #74 Please note this PR makes a few modifications to the workflows: - `node-version: 16` has been set for backend (previously `node-version: 12` in `kubeflow/kubeflow` although we build on a `node16` base image) - `frontend` workflows have a reworked `Install dependencies` step that builds off PR #92 to ensure `kubeflow-common-lib` built and available - paths updated now that the `testing` folder does not live **under** the `components/` folder - various manifests that reside in `kubeflow/kubeflow` under `components/notebook-controller` and `components/crud-web-apps` are provided to `kustomize` via their GitHub URL as those components weren't migrated to `kubeflow/dashboard` TODO: Add .github/workflows/centraldb_angular_docker_publish.yaml once we are ready for publish/release. Signed-off-by: Andy Stoneberg <[email protected]>
1 parent bf28ef1 commit 4b19c24

File tree

5 files changed

+290
-0
lines changed

5 files changed

+290
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CentralDashboard-angular Backend Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- components/centraldashboard-angular/backend/**
6+
- releasing/version/VERSION
7+
branches:
8+
- main
9+
- v*-branch
10+
11+
jobs:
12+
run-backend-unittests:
13+
name: Unit tests
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 16
21+
22+
- name: Run unit tests
23+
run: |
24+
cd components/centraldashboard-angular/backend/
25+
npm i
26+
npm run test
27+
28+
run-backend-tslint:
29+
name: TSLint
30+
runs-on: ubuntu-22.04
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 16
37+
38+
- name: Run tslint
39+
run: |
40+
cd components/centraldashboard-angular/backend/
41+
npm i
42+
npm run tslint
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: CentralDashboard-angular Frontend Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- components/centraldashboard-angular/frontend/**
6+
- releasing/version/VERSION
7+
branches:
8+
- main
9+
- v*-branch
10+
11+
jobs:
12+
frontend-format-lint-check:
13+
name: Check code format and lint
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 16
23+
24+
- name: Check frontend code formatting
25+
run: |
26+
cd components/centraldashboard-angular/frontend/
27+
npm i
28+
npm run format:check
29+
30+
- name: Check frontend code linting
31+
run: |
32+
cd components/centraldashboard-angular/frontend
33+
npm i
34+
npm run lint-check
35+
36+
run-frontend-unittests:
37+
name: Unit tests
38+
runs-on: ubuntu-22.04
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: 16
46+
47+
- name: Install dependecies
48+
run: |
49+
BASE="${{ github.workspace }}/components/centraldashboard-angular"
50+
cd "$BASE/frontend"
51+
npm i
52+
cd "$BASE"
53+
make build-common-lib
54+
cd "$BASE/frontend"
55+
npm link kubeflow
56+
57+
- name: Run unit tests
58+
run: |
59+
cd components/centraldashboard-angular/frontend/
60+
npm run test:prod
61+
62+
run-ui-tests:
63+
name: UI tests in chrome and firefox
64+
runs-on: ubuntu-22.04
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Setup node version to 16
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 16
73+
74+
- name: Install KinD
75+
run: ./testing/gh-actions/install_kind.sh
76+
77+
- name: Create KinD Cluster
78+
run: kind create cluster --config testing/gh-actions/kind-1-25.yaml
79+
80+
- name: Install kustomize
81+
run: ./testing/gh-actions/install_kustomize.sh
82+
83+
- name: Install Istio
84+
run: ./testing/gh-actions/install_istio.sh
85+
86+
- name: Apply KF Controllers
87+
run: |
88+
cd components
89+
kubectl create namespace kubeflow
90+
kustomize build profile-controller/config/overlays/kubeflow | kubectl apply -f -
91+
kustomize build https://github.com/kubeflow/kubeflow//components/notebook-controller/config/overlays/kubeflow?ref=master | kubectl apply -f -
92+
kubectl wait pods -n kubeflow -l kustomize.component=profiles --for=condition=Ready --timeout=300s
93+
kubectl wait pods -n kubeflow -l app=notebook-controller --for=condition=Ready --timeout=300s
94+
95+
- name: Apply JWA manifests
96+
run: |
97+
kustomize build https://github.com/kubeflow/kubeflow//components/crud-web-apps/jupyter/manifests/overlays/istio?ref=master | kubectl apply -f -
98+
kubectl wait pods -n kubeflow -l app=jupyter-web-app --for=condition=Ready --timeout=300s
99+
kubectl port-forward -n kubeflow svc/jupyter-web-app-service 8085:80 &
100+
101+
- name: Apply VWA manifests
102+
run: |
103+
kustomize build https://github.com/kubeflow/kubeflow//components/crud-web-apps/volumes/manifests/overlays/istio?ref=master | kubectl apply -f -
104+
kubectl wait pods -n kubeflow -l app=volumes-web-app --for=condition=Ready --timeout=300s
105+
kubectl port-forward -n kubeflow svc/volumes-web-app-service 8087:80 &
106+
107+
- name: Apply necessary CRs
108+
run: |
109+
kustomize build https://github.com/kubeflow/manifests//common/kubeflow-roles/base?ref=master | kubectl apply -f -
110+
cd testing/gh-actions/resources
111+
kubectl apply -f user-profile.yaml
112+
while ! kubectl get ns kubeflow-user; do sleep 1; done
113+
kubectl apply -f test-notebook.yaml
114+
kubectl wait notebooks -n kubeflow-user -l app=test-notebook --for=condition=Ready --timeout=300s
115+
116+
- name: Test proxied apps
117+
run: |
118+
curl -H "kubeflow-userid: user" localhost:8085
119+
curl -H "kubeflow-userid: user" localhost:8087
120+
121+
- name: Install dependecies
122+
run: |
123+
BASE="${{ github.workspace }}/components/centraldashboard-angular"
124+
cd "$BASE/frontend"
125+
npm i
126+
cd "$BASE"
127+
make build-common-lib
128+
cd "$BASE/frontend"
129+
npm link kubeflow
130+
131+
- name: Serve UI & run Cypress tests in Chrome and Firefox
132+
run: |
133+
cd components/centraldashboard-angular/frontend
134+
npm run serve & npx wait-on http://localhost:4200
135+
npm run ui-test-ci-all
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CentralDashboard-Angular Integration Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/centraldashboard-angular/**
6+
- releasing/version/VERSION
7+
branches:
8+
- main
9+
- v*-branch
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
13+
cancel-in-progress: true
14+
15+
env:
16+
IMG: ghcr.io/kubeflow/kubeflow/centraldashboard-angular
17+
TAG: integration-test
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Build CentralDashboard-Angular Image
29+
run: |
30+
cd components/centraldashboard-angular
31+
make docker-build
32+
33+
- name: Install KinD
34+
run: ./testing/gh-actions/install_kind.sh
35+
36+
- name: Create KinD Cluster
37+
run: kind create cluster --config testing/gh-actions/kind-1-25.yaml
38+
39+
- name: Load Images into KinD Cluster
40+
run: |
41+
kind load docker-image "${IMG}:${TAG}"
42+
43+
- name: Install kustomize
44+
run: ./testing/gh-actions/install_kustomize.sh
45+
46+
- name: Install Istio
47+
run: ./testing/gh-actions/install_istio.sh
48+
49+
- name: Build & Apply manifests
50+
run: |
51+
cd components/centraldashboard-angular/manifests
52+
kubectl create ns kubeflow
53+
54+
export CURRENT_IMAGE="${IMG}"
55+
export PR_IMAGE="${IMG}:${TAG}"
56+
57+
# escape "." in the image names, as it is a special characters in sed
58+
export CURRENT_IMAGE=$(echo "$CURRENT_IMAGE" | sed 's|\.|\\.|g')
59+
export PR_IMAGE=$(echo "$PR_IMAGE" | sed 's|\.|\\.|g')
60+
61+
kustomize build overlays/kserve \
62+
| sed "s|${CURRENT_IMAGE}:[a-zA-Z0-9_.-]*|${PR_IMAGE}|g" \
63+
| kubectl apply -f -
64+
65+
kubectl wait pods -n kubeflow -l app=centraldashboard-angular --for=condition=Ready --timeout=300s
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: kubeflow.org/v1beta1
2+
kind: Notebook
3+
metadata:
4+
labels:
5+
app: test-notebook
6+
name: test-notebook
7+
namespace: kubeflow-user
8+
spec:
9+
template:
10+
spec:
11+
containers:
12+
- image: nginx
13+
imagePullPolicy: IfNotPresent
14+
name: test-notebook
15+
resources:
16+
requests:
17+
cpu: 500m
18+
memory: 1Gi
19+
volumeMounts:
20+
- mountPath: /home/jovyan
21+
name: test-notebook-workspace
22+
serviceAccountName: default-editor
23+
volumes:
24+
- name: test-notebook-workspace
25+
persistentVolumeClaim:
26+
claimName: test-notebook-workspace
27+
---
28+
apiVersion: v1
29+
kind: PersistentVolumeClaim
30+
metadata:
31+
name: test-notebook-workspace
32+
namespace: kubeflow-user
33+
spec:
34+
accessModes:
35+
- ReadWriteOnce
36+
resources:
37+
requests:
38+
storage: 5Gi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kubeflow.org/v1
2+
kind: Profile
3+
metadata:
4+
name: kubeflow-user
5+
spec:
6+
owner:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: User
9+
name: user
10+
resourceQuotaSpec: {}

0 commit comments

Comments
 (0)