Skip to content

Commit f3217d3

Browse files
committed
chore: enable UBI10 UDI builds and add smoke test workflow
Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent 9d161f2 commit f3217d3

File tree

4 files changed

+411
-206
lines changed

4 files changed

+411
-206
lines changed
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
#
2+
# Copyright (c) 2019-2025 Red Hat, Inc.
3+
# This program and the accompanying materials are made
4+
# available under the terms of the Eclipse Public License 2.0
5+
# which is available at https://www.eclipse.org/legal/epl-2.0/
6+
#
7+
# SPDX-License-Identifier: EPL-2.0
8+
#
9+
# Contributors:
10+
# Red Hat, Inc. - initial API and implementation
11+
#
12+
13+
name: Empty workspace smoke test on udi10
14+
on:
15+
pull_request:
16+
paths-ignore:
17+
- '**/*.md'
18+
- .devfile.yaml
19+
- LICENSE
20+
21+
env:
22+
# Use repository variable if set, otherwise fallback to default registry
23+
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }}
24+
USERSTORY: CloneGitRepoAPI
25+
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl
26+
DEPLOYMENT_TIMEOUT: 90s
27+
PULL_POLICY: IfNotPresent
28+
29+
jobs:
30+
workspace-api-tests-on-minikube:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
35+
runs-on: ${{matrix.runners}}
36+
steps:
37+
38+
- name: Checkout
39+
uses: actions/checkout@master
40+
- name: Free runner space
41+
run: |
42+
sudo rm -rf /usr/local/lib/android
43+
# obtain the PR number for tagging the image
44+
- name: Get PR number
45+
id: get_pr_number
46+
run: |
47+
pr_number=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
48+
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
49+
echo ">>>>>>>>>>>$pr_number"
50+
51+
- name: Cleanup build-in images
52+
run: |
53+
# remove build-in images from the VM because it is not used
54+
docker rmi -f $(docker images -aq)
55+
56+
- name: Set arch environment variable
57+
run: |
58+
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
59+
echo arch="amd64" >> $GITHUB_ENV
60+
else
61+
echo arch="arm64" >> $GITHUB_ENV
62+
fi
63+
64+
- name: Start minikube cluster
65+
run: |
66+
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-${{env.arch}}
67+
install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}}
68+
minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500
69+
70+
# connect with docker daemon in the minikube and build an image there
71+
# we need to build the image in the minikube because we have just 14 GB of space on the runner
72+
# the UBI have more than 9 GB size this approach saves the disk space
73+
- name: Build base image
74+
run: |
75+
eval $(minikube docker-env)
76+
cd base/ubi10 && docker build -t ${{ env.REGISTRY }}/base-developer-image:ubi10-latest .
77+
78+
- name: Build universal image
79+
run: |
80+
eval $(minikube docker-env)
81+
cd universal/ubi10 && docker build -t ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }} .
82+
83+
- name: Checkout DWO
84+
uses: actions/checkout@master
85+
with:
86+
repository: devfile/devworkspace-operator
87+
path: devworkspace-operator
88+
89+
- name: Setup cert manager
90+
run: |
91+
cd devworkspace-operator
92+
make install_cert_manager
93+
kubectl wait deployment -n cert-manager cert-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
94+
kubectl wait deployment -n cert-manager cert-manager-cainjector --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
95+
kubectl wait deployment -n cert-manager cert-manager-webhook --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
96+
97+
- name: Setup DWO
98+
run: |
99+
cd devworkspace-operator
100+
make install
101+
kubectl rollout status deployment -n devworkspace-controller devworkspace-controller-manager --timeout=$DEPLOYMENT_TIMEOUT
102+
kubectl rollout status deployment -n devworkspace-controller devworkspace-webhook-server --timeout=$DEPLOYMENT_TIMEOUT
103+
kubectl wait deployment -n devworkspace-controller devworkspace-webhook-server --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
104+
kubectl wait deployment -n devworkspace-controller devworkspace-controller-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
105+
106+
- name: Check that UDI is present in the image list
107+
run: |
108+
# we used it for the build above and do not need it anymore. It saves the disk space
109+
minikube image rm ${{ env.REGISTRY }}/base-developer-image:ubi10-latest
110+
minikube image list --format table
111+
112+
- name: Install NodeJs
113+
uses: actions/setup-node@v4
114+
115+
- name: Checkout tests codebase
116+
uses: actions/checkout@master
117+
with:
118+
ref: api-test-with-clone-project-without-generating
119+
repository: eclipse/che
120+
path: che
121+
122+
# Host devfile locally.
123+
# Use the insiders tag for the che-code image and the PR number for the universal-developer-image
124+
- name: Host devfile locally
125+
run: |
126+
kubectl apply -f - <<EOF
127+
apiVersion: v1
128+
kind: ConfigMap
129+
metadata:
130+
name: devfile.yaml
131+
data:
132+
devfile.yaml: |
133+
schemaVersion: 2.2.2
134+
metadata:
135+
name: che-code
136+
commands:
137+
- id: init-container-command
138+
apply:
139+
component: che-code-injector
140+
- id: init-che-code-command
141+
exec:
142+
component: che-code-runtime-description
143+
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt 2>&1 &
144+
events:
145+
preStart:
146+
- init-container-command
147+
postStart:
148+
- init-che-code-command
149+
components:
150+
- name: che-code-injector
151+
container:
152+
image: quay.io/che-incubator/che-code:insiders
153+
command:
154+
- /entrypoint-init-container.sh
155+
volumeMounts:
156+
- name: checode
157+
path: /checode
158+
memoryLimit: 256Mi
159+
memoryRequest: 32Mi
160+
cpuLimit: 500m
161+
cpuRequest: 30m
162+
- name: che-code-runtime-description
163+
container:
164+
image: ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }}
165+
memoryLimit: 1024Mi
166+
memoryRequest: 256Mi
167+
cpuLimit: 500m
168+
cpuRequest: 30m
169+
volumeMounts:
170+
- name: checode
171+
path: /checode
172+
endpoints:
173+
- name: che-code
174+
attributes:
175+
type: main
176+
cookiesAuthEnabled: true
177+
discoverable: false
178+
urlRewriteSupported: true
179+
targetPort: 3100
180+
exposure: public
181+
secure: true
182+
protocol: https
183+
- name: code-redirect-1
184+
targetPort: 13131
185+
exposure: public
186+
protocol: https
187+
attributes:
188+
discoverable: false
189+
urlRewriteSupported: false
190+
- name: code-redirect-2
191+
targetPort: 13132
192+
exposure: public
193+
protocol: https
194+
attributes:
195+
discoverable: false
196+
urlRewriteSupported: false
197+
- name: code-redirect-3
198+
targetPort: 13133
199+
exposure: public
200+
protocol: https
201+
attributes:
202+
discoverable: false
203+
urlRewriteSupported: false
204+
attributes:
205+
app.kubernetes.io/component: che-code-runtime
206+
app.kubernetes.io/part-of: che-code.eclipse.org
207+
controller.devfile.io/container-contribution: true
208+
- name: checode
209+
volume: {}
210+
---
211+
apiVersion: v1
212+
kind: Pod
213+
metadata:
214+
name: file-server
215+
labels:
216+
app: file-server
217+
spec:
218+
containers:
219+
- name: nginx-container
220+
image: nginx
221+
ports:
222+
- containerPort: 80
223+
volumeMounts:
224+
- name: server-volume
225+
mountPath: /usr/share/nginx/html
226+
readOnly: true
227+
volumes:
228+
- name: server-volume
229+
configMap:
230+
name: devfile.yaml
231+
---
232+
apiVersion: v1
233+
kind: Service
234+
metadata:
235+
name: file-service
236+
spec:
237+
selector:
238+
app: file-server
239+
ports:
240+
- protocol: TCP
241+
port: 80
242+
targetPort: 80
243+
EOF
244+
245+
- name: Run Empty workspace smoke test
246+
run: |
247+
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }}
248+
export TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI=http://file-service.default.svc:80/devfile.yaml
249+
cd che/tests/e2e
250+
npm i
251+
npm run driver-less-test

.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ on:
1919
- LICENSE
2020

2121
env:
22-
# Use repository variable if set, otherwise fallback to default registry
23-
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }}
24-
USERSTORY: CloneGitRepoAPI
25-
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl
26-
DEPLOYMENT_TIMEOUT: 90s
27-
PULL_POLICY: IfNotPresent
22+
# Use repository variable if set, otherwise fallback to default registry
23+
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }}
24+
USERSTORY: CloneGitRepoAPI
25+
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl
26+
DEPLOYMENT_TIMEOUT: 90s
27+
PULL_POLICY: IfNotPresent
2828

2929
jobs:
3030
workspace-api-tests-on-minikube:
@@ -40,7 +40,7 @@ jobs:
4040
- name: Free runner space
4141
run: |
4242
sudo rm -rf /usr/local/lib/android
43-
# obtain the PR number for tegging the image
43+
# obtain the PR number for tagging the image
4444
- name: Get PR number
4545
id: get_pr_number
4646
run: |
@@ -67,18 +67,18 @@ jobs:
6767
install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}}
6868
minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500
6969
70-
# connect with docker daemon in the minikube and build an image there
71-
# we need to build the image in the minikube because we have just 14 GB of space on the runner
72-
# the UBI have more than 9 GB size this approach saves the disk space
70+
# connect with docker daemon in the minikube and build an image there
71+
# we need to build the image in the minikube because we have just 14 GB of space on the runner
72+
# the UBI have more than 9 GB size this approach saves the disk space
7373
- name: Build base image
7474
run: |
75-
eval $(minikube docker-env)
76-
cd base/ubi9 && docker build -t ${{ env.REGISTRY }}/base-developer-image:ubi9-latest .
75+
eval $(minikube docker-env)
76+
cd base/ubi9 && docker build -t ${{ env.REGISTRY }}/base-developer-image:ubi9-latest .
7777
7878
- name: Build universal image
7979
run: |
8080
eval $(minikube docker-env)
81-
cd universal/ubi9 && docker build -t ${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }} .
81+
cd universal/ubi9 && docker build -t ${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }} .
8282
8383
- name: Checkout DWO
8484
uses: actions/checkout@master
@@ -161,7 +161,7 @@ jobs:
161161
cpuRequest: 30m
162162
- name: che-code-runtime-description
163163
container:
164-
image: ${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }}
164+
image: ${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }}
165165
memoryLimit: 1024Mi
166166
memoryRequest: 256Mi
167167
cpuLimit: 500m
@@ -244,9 +244,9 @@ jobs:
244244
245245
- name: Run Empty workspace smoke test
246246
run: |
247-
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }}
247+
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }}
248248
export TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI=http://file-service.default.svc:80/devfile.yaml
249249
cd che/tests/e2e
250250
npm i
251251
npm run driver-less-test
252-
252+

0 commit comments

Comments
 (0)