Skip to content

Commit 0ac0946

Browse files
committed
feat: Migrate JWA test-related workflows from kubeflow/kubeflow to notebooks-v1 branch #587
Signed-off-by: Yehudit Kerido <yehudit1987@gmail.com>
1 parent 290935a commit 0ac0946

File tree

12 files changed

+384
-5
lines changed

12 files changed

+384
-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+
- master
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: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
- master
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+
17+
steps:
18+
- name: Check out code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 16
25+
26+
- name: Check frontend formatting
27+
run: |
28+
cd components/crud-web-apps/jupyter/frontend
29+
npm i
30+
npm run format:check
31+
32+
- name: Check frontend code linting
33+
run: |
34+
cd components/crud-web-apps/jupyter/frontend
35+
npm i
36+
npm run lint-check
37+
38+
frontend-unit-tests:
39+
runs-on: ubuntu-22.04
40+
name: Unit tests
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Setup node version to 16
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: 16
49+
50+
- name: Install Kubeflow common library dependecies
51+
run: |
52+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
53+
npm i
54+
npm run build
55+
npm link ./dist/kubeflow
56+
57+
- name: Install JWA dependencies
58+
run: |
59+
cd components/crud-web-apps/jupyter/frontend
60+
npm i
61+
npm link kubeflow
62+
63+
- name: Run unit tests
64+
run: |
65+
cd components/crud-web-apps/jupyter/frontend
66+
npm run test:prod
67+
68+
run-ui-tests:
69+
name: UI tests with Playwright
70+
runs-on: ubuntu-22.04
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Setup node version to 16
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: 16
79+
80+
- name: Install Kubeflow common library dependecies
81+
run: |
82+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
83+
npm i
84+
npm run build
85+
npm link ./dist/kubeflow
86+
87+
- name: Install JWA dependencies
88+
run: |
89+
cd components/crud-web-apps/jupyter/frontend
90+
npm i
91+
npm link kubeflow
92+
93+
- name: Serve UI & run Playwright tests in Chrome and Firefox
94+
run: |
95+
cd components/crud-web-apps/jupyter/frontend
96+
npm run serve > serve.log 2>&1 & npx wait-on http://localhost:4200
97+
npx playwright install
98+
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+
- master
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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
- master
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+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup QEMU
28+
uses: docker/setup-qemu-action@v3
29+
30+
- name: Setup Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Build multi-arch Images (AMD64 & PPC64LE)
34+
run: |
35+
cd components/crud-web-apps/jupyter
36+
37+
echo "Starting linux/amd64 build..."
38+
ARCH=linux/amd64 make docker-build-multi-arch
39+
echo "Completed linux/amd64 build!"
40+
41+
echo "Starting linux/ppc64le build..."
42+
ARCH=linux/ppc64le make docker-build-multi-arch
43+
echo "Completed linux/ppc64le build!"
44+
45+
- name: Build ARM64 Image (Optional)
46+
timeout-minutes: 60
47+
continue-on-error: true
48+
run: |
49+
cd components/crud-web-apps/jupyter
50+
51+
echo "Starting linux/arm64/v8 build..."
52+
ARCH=linux/arm64/v8 make docker-build-multi-arch
53+
echo "Completed linux/arm64/v8 build!"
54+
55+
- name: Verify multi-arch builds
56+
run: |
57+
echo "Verifying multi-arch build results:"
58+
echo "Listing all jupyter-web-app images:"
59+
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedAt}}" | grep jupyter-web-app || echo "No jupyter-web-app images found"
60+
61+
echo ""
62+
echo "Checking individual architectures:"
63+
TAG=$(git describe --tags --always --dirty)
64+
echo "Base TAG: $TAG"
65+
66+
# Check each architecture
67+
if docker images | grep -q "jupyter-web-app.*${TAG}-linux-amd64"; then
68+
echo "✅ AMD64: SUCCESS"
69+
else
70+
echo "❌ AMD64: FAILED"
71+
fi
72+
73+
if docker images | grep -q "jupyter-web-app.*${TAG}-linux-ppc64le"; then
74+
echo "✅ PPC64LE: SUCCESS"
75+
else
76+
echo "❌ PPC64LE: FAILED"
77+
fi
78+
79+
if docker images | grep -q "jupyter-web-app.*${TAG}-linux-arm64-v8"; then
80+
echo "✅ ARM64: SUCCESS"
81+
else
82+
echo "ℹ️ ARM64: Not built (expected if timeout occurred)"
83+
fi
84+
85+
echo ""
86+
echo "Total images built:"
87+
docker images | grep jupyter-web-app | wc -l

components/crud-web-apps/jupyter/Makefile

Lines changed: 21 additions & 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
@@ -12,7 +12,26 @@ docker-push:
1212

1313
.PHONY: docker-build-multi-arch
1414
docker-build-multi-arch: ## Build multi-arch docker images with docker buildx
15-
cd ../ && docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG} -f ${DOCKERFILE} .
15+
$(eval ARCH_SAFE := $(shell echo ${ARCH} | sed 's|/|-|g'))
16+
@echo "=== Docker Build Multi-Arch Debug Info ==="
17+
@echo "IMG: ${IMG}"
18+
@echo "TAG: ${TAG}"
19+
@echo "ARCH: ${ARCH}"
20+
@echo "ARCH_SAFE: ${ARCH_SAFE}"
21+
@echo "DOCKERFILE: ${DOCKERFILE}"
22+
@echo "Full image name will be: ${IMG}:${TAG}-${ARCH_SAFE}"
23+
@echo "Platform: ${ARCH}"
24+
@echo "=========================================="
25+
cd ../ && docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG}-${ARCH_SAFE} -f ${DOCKERFILE} .
26+
27+
.PHONY: docker-build-multi-arch-test
28+
docker-build-multi-arch-test: ## Build multi-arch docker images for testing (export to tar)
29+
@echo "Building with IMG=${IMG}, ARCH=${ARCH}, TAG=${TAG}"
30+
$(eval IMG_NAME := $(shell basename ${IMG}))
31+
$(eval ARCH_SAFE := $(shell echo ${ARCH} | sed 's|/|-|g'))
32+
@echo "Output file will be: /tmp/${IMG_NAME}-${ARCH_SAFE}.tar"
33+
cd ../ && docker buildx build --platform ${ARCH} --tag ${IMG}:${TAG} -f ${DOCKERFILE} --output type=tar,dest=/tmp/${IMG_NAME}-${ARCH_SAFE}.tar .
34+
1635

1736

1837
.PHONY: docker-build-push-multi-arch

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
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
ISTIO_VERSION="1.17.8"
6+
ISTIO_URL="https://istio.io/downloadIstio"
7+
8+
echo "Installing Istio ${ISTIO_VERSION} ..."
9+
mkdir istio_tmp
10+
pushd istio_tmp >/dev/null
11+
curl -sL "$ISTIO_URL" | ISTIO_VERSION=${ISTIO_VERSION} sh -
12+
cd istio-${ISTIO_VERSION}
13+
export PATH=$PWD/bin:$PATH
14+
istioctl install -y
15+
popd
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
KIND_VERSION="0.22.0"
6+
KIND_URL="https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-amd64"
7+
8+
echo "Setting up kind environment..."
9+
sudo swapoff -a
10+
sudo rm -f /swapfile
11+
sudo mkdir -p /tmp/etcd
12+
sudo mount -t tmpfs tmpfs /tmp/etcd
13+
14+
echo "Installing kind ${KIND_VERSION} ..."
15+
curl -sL -o kind "$KIND_URL"
16+
chmod +x ./kind
17+
sudo mv kind /usr/local/bin

0 commit comments

Comments
 (0)