Skip to content

Commit 0ea96ab

Browse files
authored
feat: Migrate JWA test-related workflows from kubeflow/kubeflow to notebooks-v1 branch #587 (#599)
Signed-off-by: Yehudit Kerido <yehudit1987@gmail.com>
1 parent 88e00b4 commit 0ea96ab

File tree

8 files changed

+245
-5
lines changed

8 files changed

+245
-5
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: JWA Backend Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/jupyter/backend/**
6+
- releasing/version/VERSION
7+
branches:
8+
- main
9+
- notebooks-v1
10+
- 'v*-branch'
11+
12+
jobs:
13+
run-backend-unittests:
14+
name: Unittests
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install KinD
21+
run: ./components/testing/gh-actions/install_kind.sh
22+
23+
- name: Create KinD Cluster
24+
run: kind create cluster --config components/testing/gh-actions/kind-1-25.yaml
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.7"
29+
30+
- name: Setup Python environment
31+
run: |
32+
cd components/crud-web-apps/jupyter/backend
33+
make install-deps
34+
35+
- name: Run unittests
36+
run: |
37+
cd components/crud-web-apps/jupyter/backend
38+
make unittest
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: JWA Frontend Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/jupyter/frontend/**
6+
- releasing/version/VERSION
7+
branches:
8+
- main
9+
- notebooks-v1
10+
- 'v*-branch'
11+
12+
jobs:
13+
frontend-format-linting-check:
14+
name: Check code format and lint
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: components/crud-web-apps/jupyter/frontend
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v4
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 16
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Check frontend formatting
29+
run: npm run format:check
30+
- name: Check frontend code linting
31+
run: npm run lint-check
32+
33+
frontend-unit-tests:
34+
runs-on: ubuntu-22.04
35+
name: Unit tests
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Setup node version to 16
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 16
44+
45+
- name: Install Kubeflow common library dependecies
46+
run: |
47+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
48+
npm i
49+
npm run build
50+
npm link ./dist/kubeflow
51+
52+
- name: Install JWA dependencies
53+
run: |
54+
cd components/crud-web-apps/jupyter/frontend
55+
npm i
56+
npm link kubeflow
57+
58+
- name: Run unit tests
59+
run: |
60+
cd components/crud-web-apps/jupyter/frontend
61+
npm run test:prod
62+
63+
run-ui-tests:
64+
name: UI tests with Playwright
65+
runs-on: ubuntu-22.04
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Setup node version to 16
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 16
74+
75+
- name: Install Kubeflow common library dependecies
76+
run: |
77+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
78+
npm i
79+
npm run build
80+
npm link ./dist/kubeflow
81+
82+
- name: Install JWA dependencies
83+
run: |
84+
cd components/crud-web-apps/jupyter/frontend
85+
npm i
86+
npm link kubeflow
87+
88+
- name: Serve UI & run Playwright tests in Chrome and Firefox
89+
run: |
90+
cd components/crud-web-apps/jupyter/frontend
91+
npm run serve > serve.log 2>&1 & npx wait-on http://localhost:4200
92+
npx playwright install
93+
npm run ui-test-ci-all
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: JWA Integration Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/jupyter/**
6+
- components/crud-web-apps/common/**
7+
- releasing/version/VERSION
8+
branches:
9+
- main
10+
- notebooks-v1
11+
- 'v*-branch'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
15+
cancel-in-progress: true
16+
17+
env:
18+
IMG: ghcr.io/kubeflow/notebooks/jupyter-web-app
19+
TAG: integration-test
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Build JWA Image
32+
run: |
33+
cd components/crud-web-apps/jupyter
34+
make docker-build-multi-arch
35+
36+
- name: Install KinD
37+
run: ./components/testing/gh-actions/install_kind.sh
38+
39+
- name: Create KinD Cluster
40+
run: kind create cluster --config components/testing/gh-actions/kind-1-25.yaml
41+
42+
- name: Load Image into KinD Cluster
43+
run: |
44+
kind load docker-image "${IMG}:${TAG}"
45+
46+
- name: Install kustomize
47+
run: ./components/testing/gh-actions/install_kustomize.sh
48+
49+
- name: Install Istio
50+
run: ./components/testing/gh-actions/install_istio.sh
51+
52+
- name: Build & Apply manifests
53+
run: |
54+
cd components/crud-web-apps/jupyter/manifests
55+
kubectl create ns kubeflow
56+
57+
export CURRENT_IMAGE="${IMG}"
58+
export PR_IMAGE="${IMG}:${TAG}"
59+
60+
# escape "." in the image names, as it is a special characters in sed
61+
export CURRENT_IMAGE=$(echo "$CURRENT_IMAGE" | sed 's|\.|\\.|g')
62+
export PR_IMAGE=$(echo "$PR_IMAGE" | sed 's|\.|\\.|g')
63+
64+
kustomize build overlays/istio \
65+
| sed "s|${CURRENT_IMAGE}:[a-zA-Z0-9_.-]*|${PR_IMAGE}|g" \
66+
| kubectl apply -f -
67+
68+
kubectl wait pods -n kubeflow -l app=jupyter-web-app --for=condition=Ready --timeout=300s
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: JWA Multi-Arch Build Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/jupyter/**
6+
- components/crud-web-apps/common/**
7+
- releasing/version/VERSION
8+
branches:
9+
- main
10+
- notebooks-v1
11+
- 'v*-branch'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
15+
cancel-in-progress: true
16+
17+
env:
18+
IMG: ghcr.io/kubeflow/notebooks/jupyter-web-app
19+
PLATFORMS: linux/amd64,linux/ppc64le,linux/arm64
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Setup Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Build multi-arch images
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: components/crud-web-apps/
38+
file: components/crud-web-apps/jupyter/Dockerfile
39+
platforms: ${{ env.PLATFORMS }}
40+
tags: ${{ env.IMG }}:${{ github.sha }}
41+

components/crud-web-apps/jupyter/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IMG ?= ghcr.io/kubeflow/kubeflow/jupyter-web-app
1+
IMG ?= ghcr.io/kubeflow/notebooks/jupyter-web-app
22
TAG ?= $(shell git describe --tags --always --dirty)
33
DOCKERFILE ?= jupyter/Dockerfile
44
ARCH ?= linux/amd64
@@ -14,7 +14,6 @@ docker-push:
1414
docker-build-multi-arch: ## Build multi-arch docker images with docker buildx
1515
cd ../ && docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG} -f ${DOCKERFILE} .
1616

17-
1817
.PHONY: docker-build-push-multi-arch
1918
docker-build-push-multi-arch: ## Build multi-arch docker images with docker buildx and push to docker registry
2019
cd ../ && docker buildx build --platform ${ARCH} --tag ${IMG}:${TAG} --push -f ${DOCKERFILE} .

components/crud-web-apps/jupyter/manifests/base/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
spec:
99
containers:
1010
- name: jupyter-web-app
11-
image: ghcr.io/kubeflow/kubeflow/jupyter-web-app
11+
image: ghcr.io/kubeflow/notebooks/jupyter-web-app
1212
ports:
1313
- containerPort: 5000
1414
volumeMounts:

components/crud-web-apps/jupyter/manifests/base/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ commonLabels:
2121
app: jupyter-web-app
2222
kustomize.component: jupyter-web-app
2323
images:
24-
- name: ghcr.io/kubeflow/kubeflow/jupyter-web-app
25-
newName: ghcr.io/kubeflow/kubeflow/jupyter-web-app
24+
- name: ghcr.io/kubeflow/notebooks/jupyter-web-app
25+
newName: ghcr.io/kubeflow/notebooks/jupyter-web-app
2626
newTag: latest
2727
# We need the name to be unique without the suffix because the original name is what
2828
# gets used with patches

releasing/version/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
latest

0 commit comments

Comments
 (0)