From 7da247ca26beaeed22c7938d4fb2f01ac98bd37a Mon Sep 17 00:00:00 2001 From: Vulpoi Maria-Diana <151461331+dianav18@users.noreply.github.com> Date: Sat, 17 May 2025 16:57:27 +0300 Subject: [PATCH] Update library-redis7.0.yaml Signed-off-by: Vulpoi Maria-Diana <151461331+dianav18@users.noreply.github.com> --- .github/workflows/library-redis7.0.yaml | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/library-redis7.0.yaml b/.github/workflows/library-redis7.0.yaml index 1a835444..c7079dc5 100644 --- a/.github/workflows/library-redis7.0.yaml +++ b/.github/workflows/library-redis7.0.yaml @@ -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 + + 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 + - 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