Skip to content

Commit 13bcde2

Browse files
committed
feat: migrate VWA workflows clean
Signed-off-by: Hen Schwartz (EXT-Nokia) <[email protected]>
1 parent 7ad72c8 commit 13bcde2

File tree

7 files changed

+642
-236
lines changed

7 files changed

+642
-236
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: VWA Frontend Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/volumes/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/volumes/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 ci
49+
npm run build
50+
npm link ./dist/kubeflow
51+
- name: Install VWA dependencies
52+
run: |
53+
cd components/crud-web-apps/volumes/frontend
54+
npm ci
55+
npm link kubeflow
56+
- name: Run unit tests
57+
run: |
58+
cd components/crud-web-apps/volumes/frontend
59+
npm run test:prod
60+
run-tests-in-chrome:
61+
name: UI tests in chrome
62+
runs-on: ubuntu-22.04
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
67+
- name: Setup node version to 16
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: 16
71+
72+
- name: Install Kubeflow common library dependecies
73+
run: |
74+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
75+
npm ci
76+
npm run build
77+
npm link ./dist/kubeflow
78+
- name: Install VWA dependencies
79+
run: |
80+
cd components/crud-web-apps/volumes/frontend
81+
npm ci
82+
npm link kubeflow
83+
- name: Serve UI & run Cypress tests in Chrome
84+
uses: cypress-io/github-action@v6
85+
with:
86+
working-directory: components/crud-web-apps/volumes/frontend
87+
start: npm run serve
88+
install: false
89+
browser: chrome
90+
wait-on: "http://localhost:4200"
91+
92+
run-tests-in-firefox:
93+
name: UI tests in firefox
94+
runs-on: ubuntu-22.04
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v4
98+
99+
- name: Setup node version to 16
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: 16
103+
104+
- name: Install Kubeflow common library dependecies
105+
run: |
106+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
107+
npm ci
108+
npm run build
109+
npm link ./dist/kubeflow
110+
111+
- name: Install VWA dependencies
112+
run: |
113+
cd components/crud-web-apps/volumes/frontend
114+
npm ci
115+
npm link kubeflow
116+
117+
- name: Serve UI & run Cypress tests in Firefox
118+
uses: cypress-io/github-action@v6
119+
with:
120+
working-directory: components/crud-web-apps/volumes/frontend
121+
start: npm run serve
122+
install: false
123+
browser: firefox
124+
wait-on: "http://localhost:4200"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: VWA Integration Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/volumes/**
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/volumes-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 VWA Image
32+
run: |
33+
cd components/crud-web-apps/volumes
34+
make docker-build-multi-arch
35+
- name: Install KinD
36+
run: ./components/testing/gh-actions/install_kind.sh
37+
38+
- name: Create KinD Cluster
39+
run: kind create cluster --config components/testing/gh-actions/kind-1-25.yaml
40+
41+
- name: Load Image into KinD Cluster
42+
run: |
43+
kind load docker-image "${IMG}:${TAG}"
44+
- name: Install kustomize
45+
run: ./components/testing/gh-actions/install_kustomize.sh
46+
47+
- name: Install Istio
48+
run: ./components/testing/gh-actions/install_istio.sh
49+
50+
- name: Build & Apply manifests
51+
run: |
52+
cd components/crud-web-apps/volumes/manifests
53+
kubectl create ns kubeflow
54+
export CURRENT_IMAGE="${IMG}"
55+
export PR_IMAGE="${IMG}:${TAG}"
56+
# escape "." in the image names, as it is a special characters in sed
57+
export CURRENT_IMAGE=$(echo "$CURRENT_IMAGE" | sed 's|\.|\\.|g')
58+
export PR_IMAGE=$(echo "$PR_IMAGE" | sed 's|\.|\\.|g')
59+
kustomize build overlays/istio \
60+
| sed "s|${CURRENT_IMAGE}:[a-zA-Z0-9_.-]*|${PR_IMAGE}|g" \
61+
| kubectl apply -f -
62+
kubectl wait pods -n kubeflow -l app=volumes-web-app --for=condition=Ready --timeout=300s
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: VWA Multi-Arch Build Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/volumes/**
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/volumes-web-app
19+
PLATFORMS: linux/amd64,linux/ppc64le,linux/arm64/v8
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/volumes/Dockerfile
39+
platforms: ${{ env.PLATFORMS }}
40+
tags: ${{ env.IMG }}:${{ github.sha }}

0 commit comments

Comments
 (0)