Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/library-redis7.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,65 @@ jobs:
with:
name: index.unikraft.io/unikraft.org/redis:7.0
push: true

run-remote:
name: Test redis:7.0 (Remote OCI)
needs: [build, push]
runs-on: ubuntu-latest
steps:
- name: Login to OCI registry
uses: docker/login-action@v3
with:
registry: index.unikraft.io
username: ${{ secrets.REG_USERNAME }}
password: ${{ secrets.REG_TOKEN }}

- name: Pull, run, validate and cleanup unikernel
run: |
set -euo pipefail
echo "Pull and start redis:7.0 unikernel"
IMAGE=index.unikraft.io/unikraft.org/redis:7.0
docker pull "$IMAGE"
CONTAINER_ID=$(docker run --rm -d "$IMAGE")
echo "Wait and validate container startup"
sleep 5
if ! docker ps --filter "id=$CONTAINER_ID" --format '{{.ID}}' | grep -q .; then
echo "ERROR: redis:7.0 unikernel is not running" >&2
docker logs "$CONTAINER_ID" >&2 || true
docker stop "$CONTAINER_ID" || true
exit 1
fi
echo "redis:7.0 unikernel started successfully"
echo "Cleanup container"
docker stop "$CONTAINER_ID" || true
Comment on lines +89 to +118
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the run-remote job from all PRs


run-local:
name: Test redis:7.0 (Local build)
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install kraft CLI
run: |
echo "deb [trusted=yes] https://deb.pkg.kraftkit.sh/ /" | sudo tee /etc/apt/sources.list.d/kraftkit.list
sudo apt-get update
sudo apt-get install -y kraftkit
Comment on lines +128 to +132
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the kraftkit github action so there is no need to install, like we discussed

https://github.com/marketplace/actions/build-unikernel-images-with-unikraft#use-in-github-actions

- name: Build, run and validate unikernel
run: |
set -euo pipefail
sudo chmod 666 /dev/kvm
cd library/redis/7.0
echo "Build redis:7.0 unikernel"
kraft build --no-cache --no-update --plat qemu --arch x86_64

echo "Run redis:7.0 unikernel"
kraft run --rm -M 256M --plat qemu --arch x86_64 . &
PID=$!
sleep 5

echo "redis:7.0 unikernel started successfully locally"

echo "Cleanup redis:7.0 unikernel"
sudo kill "$PID" || true