Skip to content

Commit 3764be6

Browse files
authored
Add UBI10 support for UDI with updated tool versions (#246)
* feat: add UBI10 support for UDI with updated tool versions * chore: enable UBI10 UDI builds and add smoke test workflow Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent b05b1ed commit 3764be6

File tree

8 files changed

+1246
-279
lines changed

8 files changed

+1246
-279
lines changed
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
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+
workflow_run:
16+
workflows: ["Pull Request Check UBI 10"]
17+
types:
18+
- completed
19+
branches:
20+
- '**'
21+
22+
env:
23+
# Use repository variable if set, otherwise fallback to default registry
24+
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }}
25+
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl
26+
DEPLOYMENT_TIMEOUT: 90s
27+
28+
jobs:
29+
workspace-api-tests-on-minikube:
30+
if: github.event.workflow_run.conclusion == 'success'
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@v4
40+
- name: Free runner space
41+
run: |
42+
sudo rm -rf /usr/local/lib/android
43+
- name: Get PR number
44+
run: |
45+
pr_number="${{ github.event.workflow_run.pull_requests[0].number }}"
46+
if [ -z "$pr_number" ] || [ "$pr_number" == "null" ]; then
47+
pr_number=$(echo "${{ github.event.workflow_run.head_branch }}" | grep -oE '[0-9]+' | head -1 || echo "")
48+
fi
49+
if [ -z "$pr_number" ]; then
50+
echo "Error: Could not extract PR number from workflow_run event"
51+
exit 1
52+
fi
53+
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
54+
echo ">>>>>>>>>>>$pr_number"
55+
56+
- name: Cleanup build-in images
57+
run: |
58+
# remove build-in images from the VM because it is not used
59+
docker rmi -f $(docker images -aq)
60+
61+
- name: Set arch environment variable
62+
run: |
63+
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
64+
echo arch="amd64" >> $GITHUB_ENV
65+
else
66+
echo arch="arm64" >> $GITHUB_ENV
67+
fi
68+
69+
- name: Start minikube cluster
70+
run: |
71+
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-${{env.arch}}
72+
install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}}
73+
minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500
74+
75+
- name: Login to Registry
76+
uses: docker/login-action@v3
77+
with:
78+
registry: ${{ env.REGISTRY }}
79+
username: ${{ secrets.QUAY_USERNAME }}
80+
password: ${{ secrets.QUAY_PASSWORD }}
81+
82+
- name: Pull UDI image into minikube
83+
run: |
84+
eval $(minikube docker-env)
85+
docker pull ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-ubi10-pr-${{ env.PR_NUMBER }}
86+
docker tag ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-ubi10-pr-${{ env.PR_NUMBER }} ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }}
87+
88+
- name: Checkout DWO
89+
uses: actions/checkout@master
90+
with:
91+
repository: devfile/devworkspace-operator
92+
path: devworkspace-operator
93+
94+
- name: Setup cert manager
95+
run: |
96+
cd devworkspace-operator
97+
make install_cert_manager
98+
kubectl wait deployment -n cert-manager cert-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
99+
kubectl wait deployment -n cert-manager cert-manager-cainjector --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
100+
kubectl wait deployment -n cert-manager cert-manager-webhook --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
101+
102+
- name: Setup DWO
103+
run: |
104+
cd devworkspace-operator
105+
make install
106+
kubectl rollout status deployment -n devworkspace-controller devworkspace-controller-manager --timeout=$DEPLOYMENT_TIMEOUT
107+
kubectl rollout status deployment -n devworkspace-controller devworkspace-webhook-server --timeout=$DEPLOYMENT_TIMEOUT
108+
kubectl wait deployment -n devworkspace-controller devworkspace-webhook-server --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
109+
kubectl wait deployment -n devworkspace-controller devworkspace-controller-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
110+
111+
- name: Check that UDI is present in the image list
112+
run: |
113+
minikube image list --format table
114+
115+
- name: Install NodeJs
116+
uses: actions/setup-node@v4
117+
118+
- name: Checkout tests codebase
119+
uses: actions/checkout@master
120+
with:
121+
ref: api-test-with-clone-project-without-generating
122+
repository: eclipse/che
123+
path: che
124+
125+
# Host devfile locally.
126+
# Use the insiders tag for the che-code image and the PR number for the universal-developer-image
127+
- name: Host devfile locally
128+
run: |
129+
kubectl apply -f - <<EOF
130+
apiVersion: v1
131+
kind: ConfigMap
132+
metadata:
133+
name: devfile.yaml
134+
data:
135+
devfile.yaml: |
136+
schemaVersion: 2.2.2
137+
metadata:
138+
name: che-code
139+
commands:
140+
- id: init-container-command
141+
apply:
142+
component: che-code-injector
143+
- id: init-che-code-command
144+
exec:
145+
component: che-code-runtime-description
146+
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt 2>&1 &
147+
events:
148+
preStart:
149+
- init-container-command
150+
postStart:
151+
- init-che-code-command
152+
components:
153+
- name: che-code-injector
154+
container:
155+
image: quay.io/che-incubator/che-code:insiders
156+
command:
157+
- /entrypoint-init-container.sh
158+
volumeMounts:
159+
- name: checode
160+
path: /checode
161+
memoryLimit: 256Mi
162+
memoryRequest: 32Mi
163+
cpuLimit: 500m
164+
cpuRequest: 30m
165+
- name: che-code-runtime-description
166+
container:
167+
image: ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }}
168+
memoryLimit: 1024Mi
169+
memoryRequest: 256Mi
170+
cpuLimit: 500m
171+
cpuRequest: 30m
172+
volumeMounts:
173+
- name: checode
174+
path: /checode
175+
endpoints:
176+
- name: che-code
177+
attributes:
178+
type: main
179+
cookiesAuthEnabled: true
180+
discoverable: false
181+
urlRewriteSupported: true
182+
targetPort: 3100
183+
exposure: public
184+
secure: true
185+
protocol: https
186+
- name: code-redirect-1
187+
targetPort: 13131
188+
exposure: public
189+
protocol: https
190+
attributes:
191+
discoverable: false
192+
urlRewriteSupported: false
193+
- name: code-redirect-2
194+
targetPort: 13132
195+
exposure: public
196+
protocol: https
197+
attributes:
198+
discoverable: false
199+
urlRewriteSupported: false
200+
- name: code-redirect-3
201+
targetPort: 13133
202+
exposure: public
203+
protocol: https
204+
attributes:
205+
discoverable: false
206+
urlRewriteSupported: false
207+
attributes:
208+
app.kubernetes.io/component: che-code-runtime
209+
app.kubernetes.io/part-of: che-code.eclipse.org
210+
controller.devfile.io/container-contribution: true
211+
- name: checode
212+
volume: {}
213+
---
214+
apiVersion: v1
215+
kind: Pod
216+
metadata:
217+
name: file-server
218+
labels:
219+
app: file-server
220+
spec:
221+
containers:
222+
- name: nginx-container
223+
image: nginx
224+
ports:
225+
- containerPort: 80
226+
volumeMounts:
227+
- name: server-volume
228+
mountPath: /usr/share/nginx/html
229+
readOnly: true
230+
volumes:
231+
- name: server-volume
232+
configMap:
233+
name: devfile.yaml
234+
---
235+
apiVersion: v1
236+
kind: Service
237+
metadata:
238+
name: file-service
239+
spec:
240+
selector:
241+
app: file-server
242+
ports:
243+
- protocol: TCP
244+
port: 80
245+
targetPort: 80
246+
EOF
247+
248+
- name: Run Empty workspace smoke test
249+
run: |
250+
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{ env.PR_NUMBER }}
251+
export TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI=http://file-service.default.svc:80/devfile.yaml
252+
cd che/tests/e2e
253+
npm i
254+
npm run driver-less-test

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

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313
name: Empty workspace smoke test on udi9
1414
on:
15-
pull_request:
16-
paths-ignore:
17-
- '**/*.md'
18-
- .devfile.yaml
19-
- LICENSE
15+
workflow_run:
16+
workflows: ["Pull Request Check"]
17+
types:
18+
- completed
19+
branches:
20+
- '**'
2021

2122
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
23+
# Use repository variable if set, otherwise fallback to default registry
24+
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }}
25+
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl
26+
DEPLOYMENT_TIMEOUT: 90s
2827

2928
jobs:
3029
workspace-api-tests-on-minikube:
30+
if: github.event.workflow_run.conclusion == 'success'
3131
strategy:
3232
fail-fast: false
3333
matrix:
@@ -36,15 +36,20 @@ jobs:
3636
steps:
3737

3838
- name: Checkout
39-
uses: actions/checkout@master
39+
uses: actions/checkout@v4
4040
- name: Free runner space
4141
run: |
4242
sudo rm -rf /usr/local/lib/android
43-
# obtain the PR number for tegging the image
4443
- name: Get PR number
45-
id: get_pr_number
4644
run: |
47-
pr_number=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
45+
pr_number="${{ github.event.workflow_run.pull_requests[0].number }}"
46+
if [ -z "$pr_number" ] || [ "$pr_number" == "null" ]; then
47+
pr_number=$(echo "${{ github.event.workflow_run.head_branch }}" | grep -oE '[0-9]+' | head -1 || echo "")
48+
fi
49+
if [ -z "$pr_number" ]; then
50+
echo "Error: Could not extract PR number from workflow_run event"
51+
exit 1
52+
fi
4853
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
4954
echo ">>>>>>>>>>>$pr_number"
5055
@@ -67,18 +72,18 @@ jobs:
6772
install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}}
6873
minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500
6974
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/ubi9 && docker build -t ${{ env.REGISTRY }}/base-developer-image:ubi9-latest .
75+
- name: Login to Registry
76+
uses: docker/login-action@v3
77+
with:
78+
registry: ${{ env.REGISTRY }}
79+
username: ${{ secrets.QUAY_USERNAME }}
80+
password: ${{ secrets.QUAY_PASSWORD }}
7781

78-
- name: Build universal image
82+
- name: Pull UDI image into minikube
7983
run: |
8084
eval $(minikube docker-env)
81-
cd universal/ubi9 && docker build -t ${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }} .
85+
docker pull ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-pr-${{ env.PR_NUMBER }}
86+
docker tag ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-pr-${{ env.PR_NUMBER }} ${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }}
8287
8388
- name: Checkout DWO
8489
uses: actions/checkout@master
@@ -105,8 +110,6 @@ jobs:
105110
106111
- name: Check that UDI is present in the image list
107112
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:ubi9-latest
110113
minikube image list --format table
111114
112115
- name: Install NodeJs
@@ -161,7 +164,7 @@ jobs:
161164
cpuRequest: 30m
162165
- name: che-code-runtime-description
163166
container:
164-
image: ${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }}
167+
image: ${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }}
165168
memoryLimit: 1024Mi
166169
memoryRequest: 256Mi
167170
cpuLimit: 500m
@@ -244,9 +247,8 @@ jobs:
244247
245248
- name: Run Empty workspace smoke test
246249
run: |
247-
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:${{ env.PR_NUMBER }}
250+
export TS_API_TEST_UDI_IMAGE=${{ env.REGISTRY }}/universal-developer-image:ubi9-pr-${{ env.PR_NUMBER }}
248251
export TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI=http://file-service.default.svc:80/devfile.yaml
249252
cd che/tests/e2e
250253
npm i
251254
npm run driver-less-test
252-

0 commit comments

Comments
 (0)