Skip to content

Commit debdc05

Browse files
authored
chore: add a workflow to test ramalama images (#2919)
1 parent 9e594b5 commit debdc05

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed

.github/workflows/ramalama.yaml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
#
2+
# Copyright (C) 2025 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: ramalama
19+
20+
on:
21+
schedule:
22+
- cron: '0 2 * * *'
23+
24+
workflow_dispatch:
25+
inputs:
26+
tag:
27+
default: 'latest'
28+
description: 'Ramalama images tag to use'
29+
type: string
30+
required: true
31+
32+
jobs:
33+
e2e-check:
34+
name: e2e tests
35+
runs-on: ubuntu-24.04
36+
env:
37+
SKIP_INSTALLATION: true
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
path: podman-desktop-extension-ai-lab
42+
# Set up pnpm
43+
- uses: pnpm/action-setup@v4
44+
name: Install pnpm
45+
with:
46+
run_install: false
47+
package_json_file: ./podman-desktop-extension-ai-lab/package.json
48+
# Install Node.js
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 22
52+
# Checkout podman desktop
53+
- uses: actions/checkout@v4
54+
with:
55+
repository: podman-desktop/podman-desktop
56+
ref: main
57+
path: podman-desktop
58+
59+
- name: Update podman
60+
run: |
61+
# ubuntu version from kubic repository to install podman we need (v5)
62+
ubuntu_version='23.04'
63+
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list"
64+
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add -
65+
# install necessary dependencies for criu package which is not part of 23.04
66+
sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1
67+
# install criu manually from static location
68+
curl -sLO http://cz.archive.ubuntu.com/ubuntu/pool/universe/c/criu/criu_3.16.1-2_amd64.deb && sudo dpkg -i criu_3.16.1-2_amd64.deb
69+
sudo apt-get update -qq
70+
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
71+
sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \
72+
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \
73+
sudo apt-get update && \
74+
sudo apt-get -y install podman; }
75+
podman version
76+
77+
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
78+
run: |
79+
# allow unprivileged user namespace
80+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
81+
82+
- name: Set cgroup_manager to 'cgroupfs' instead of systemd
83+
run: |
84+
mkdir -p ~/.config/containers
85+
cat <<EOT >> ~/.config/containers/containers.conf
86+
[engine]
87+
cgroup_manager="cgroupfs"
88+
EOT
89+
podman info
90+
91+
- name: Install pnpm deps and build Podman Desktop
92+
working-directory: ./podman-desktop
93+
run: |
94+
pnpm install --frozen-lockfile
95+
pnpm test:e2e:build
96+
97+
- name: Ensure getting current HEAD version of the test framework
98+
working-directory: ./podman-desktop-extension-ai-lab/tests/playwright
99+
run: |
100+
# workaround for https://github.com/podman-desktop/podman-desktop-extension-bootc/issues/712
101+
version=$(npm view @podman-desktop/tests-playwright@next version)
102+
echo "Version of @podman-desktop/tests-playwright to be used: $version"
103+
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json
104+
105+
- name: Execute pnpm in AI Lab Extension
106+
working-directory: ./podman-desktop-extension-ai-lab
107+
run: pnpm install --no-frozen-lockfile
108+
109+
- name: Update ramalama image references in AI Lab Extension
110+
working-directory: ./podman-desktop-extension-ai-lab
111+
run: sed -i -E "s/(@sha256:[0-9a-f]+)/:${{ github.event.inputs.tag }}/g" packages/backend/src/assets/inference-images.json
112+
113+
- name: Build Image
114+
working-directory: ./podman-desktop-extension-ai-lab
115+
id: build-image
116+
run: |
117+
pnpm build
118+
podman build -t local_ai_lab_image ./
119+
CONTAINER_ID=$(podman create localhost/local_ai_lab_image --entrypoint "")
120+
mkdir -p tests/playwright/tests/playwright/output/ai-lab-tests-pd/plugins
121+
podman export $CONTAINER_ID | tar -x -C tests/playwright/tests/playwright/output/ai-lab-tests-pd/plugins/
122+
podman rm -f $CONTAINER_ID
123+
podman rmi -f localhost/local_ai_lab_image:latest
124+
125+
- name: Run E2E tests
126+
working-directory: ./podman-desktop-extension-ai-lab
127+
env:
128+
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
129+
EXTENSION_PREINSTALLED: true
130+
run: pnpm test:e2e
131+
132+
- name: Publish Test Report
133+
uses: mikepenz/action-junit-report@v5
134+
with:
135+
annotate_only: true
136+
fail_on_failure: true
137+
include_passed: true
138+
detailed_summary: true
139+
require_tests: true
140+
report_paths: '**/*results.xml'
141+
142+
- uses: actions/upload-artifact@v4
143+
if: always()
144+
with:
145+
name: e2e-check
146+
path: |
147+
./**/tests/**/output/
148+
!./**/*.gguf
149+
!./**/*.bin
150+
!./**/output/videos/*
151+
!./**/output/traces/*
152+
153+
- name: Upload test videos
154+
uses: actions/upload-artifact@v4
155+
if: always()
156+
with:
157+
name: e2e-check-videos
158+
path: ./**/output/videos/*
159+
160+
- name: Upload test traces
161+
uses: actions/upload-artifact@v4
162+
if: always()
163+
with:
164+
name: e2e-check-traces
165+
path: ./**/output/traces/*
166+

0 commit comments

Comments
 (0)