diff --git a/.github/workflows/library-dragonfly1.14.yaml b/.github/workflows/library-dragonfly1.14.yaml index 12f9aab9..153ca37e 100644 --- a/.github/workflows/library-dragonfly1.14.yaml +++ b/.github/workflows/library-dragonfly1.14.yaml @@ -58,9 +58,59 @@ jobs: path: ${{ github.workspace }}/.kraftkit/oci/digests if-no-files-found: error + test: + needs: [ build ] + strategy: + fail-fast: false + matrix: + include: + - plat: qemu + arch: x86_64 + - plat: fc + arch: x86_64 + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install KraftKit + run: | + curl -sS https://get.kraftkit.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Test Dragonfly functionality + if: matrix.plat == 'qemu' + run: | + echo "Install redis-tools to test connection" + sudo apt-get update + sudo apt-get install -y redis-tools + + echo "Prepare image on the new server..." + kraft build --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} + + echo "Start Dragonfly Unikernel in background" + kraft run --rm --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} -M 512M -p 6379:6379 & + KRAFT_PID=$! + + echo "Wait 5 seconds for system boot..." + sleep 5 + + echo "Send PING to Dragonfly on port 6379" + if redis-cli -h 127.0.0.1 -p 6379 ping | grep -q "PONG"; then + echo "SUCCESS: Dragonfly answered with PONG" + kill $KRAFT_PID + exit 0 + else + echo "ERROR: Dragonfly did not answer" + kill $KRAFT_PID + exit 1 + fi + working-directory: library/dragonfly/1.14 + push: if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - needs: [ build ] + needs: [ test ] runs-on: ubuntu-latest steps: @@ -77,4 +127,4 @@ jobs: uses: ./.github/actions/merge-oci-digests with: name: index.unikraft.io/unikraft.org/dragonfly:1.14 - push: true + push: true \ No newline at end of file diff --git a/.github/workflows/library-grafana10.2.yaml b/.github/workflows/library-grafana10.2.yaml index 0c6a0658..79786068 100644 --- a/.github/workflows/library-grafana10.2.yaml +++ b/.github/workflows/library-grafana10.2.yaml @@ -58,9 +58,58 @@ jobs: path: ${{ github.workspace }}/.kraftkit/oci/digests if-no-files-found: error + test: + needs: [ build ] + strategy: + fail-fast: false + matrix: + include: + - plat: qemu + arch: x86_64 + - plat: fc + arch: x86_64 + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install KraftKit + run: | + curl -sS https://get.kraftkit.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Test Grafana functionality + if: matrix.plat == 'qemu' + run: | + echo "Prepare image on the new server..." + kraft build --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} + + echo "Start Grafana Unikernel in background" + kraft run --rm --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} -M 2048M -p 3000:3000 & + KRAFT_PID=$! + + echo "Wait 10 seconds for the web server to boot" + sleep 10 + + echo "Send HTTP request to Grafana on port 3000" + # HTTP status code + HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000/ || echo "000") + + if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "302" ]; then + echo "SUCCESS" + kill $KRAFT_PID + exit 0 + else + echo "ERROR" + kill $KRAFT_PID + exit 1 + fi + working-directory: library/grafana/10.2 + push: if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - needs: [ build ] + needs: [ test ] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/library-hugo0.122.yaml b/.github/workflows/library-hugo0.122.yaml index d79a735c..c00cc46f 100644 --- a/.github/workflows/library-hugo0.122.yaml +++ b/.github/workflows/library-hugo0.122.yaml @@ -63,9 +63,57 @@ jobs: path: ${{ github.workspace }}/.kraftkit/oci/digests if-no-files-found: error + test: + needs: [ build ] + strategy: + fail-fast: false + matrix: + include: + - plat: qemu + arch: x86_64 + - plat: fc + arch: x86_64 + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install KraftKit + run: | + curl -sS https://get.kraftkit.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Test hugo functionality + if: matrix.plat == 'qemu' + run: | + echo "Prepare image on the new server..." + kraft build --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} + + echo "Start Hugo Unikernel in background" + kraft run --rm --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} -M 1024M -p 1313:1313 & + KRAFT_PID=$! + + echo "Wait 5 seconds for the web server to boot" + sleep 5 + + echo "Send HTTP request to Hugo on port 1313" + HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:1313/ || echo "000") + + if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "302" ]; then + echo "SUCCESS" + kill $KRAFT_PID + exit 0 + else + echo "ERROR" + kill $KRAFT_PID + exit 1 + fi + working-directory: library/hugo/0.122 + push: if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - needs: [ build ] + needs: [ test ] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/library-imaginary1.2.yaml b/.github/workflows/library-imaginary1.2.yaml index ff8cd428..d860405d 100644 --- a/.github/workflows/library-imaginary1.2.yaml +++ b/.github/workflows/library-imaginary1.2.yaml @@ -58,9 +58,57 @@ jobs: path: ${{ github.workspace }}/.kraftkit/oci/digests if-no-files-found: error + test: + needs: [ build ] + strategy: + fail-fast: false + matrix: + include: + - plat: qemu + arch: x86_64 + - plat: fc + arch: x86_64 + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install KraftKit + run: | + curl -sS https://get.kraftkit.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Test imaginary functionality + if: matrix.plat == 'qemu' + run: | + echo "Prepare image on the new server..." + kraft build --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} + + echo "Start Imaginary in background" + kraft run --rm --plat ${{ matrix.plat }} --arch ${{ matrix.arch }} -M 512M -p 8080:8080 & + KRAFT_PID=$! + + echo "Wait 5 seconds for server boot" + sleep 5 + + echo "Send HTTP request to health endpoint on port 8080" + HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8080/health || echo "000") + + if [ "$HTTP_STATUS" = "200" ]; then + echo "SUCCESS" + kill $KRAFT_PID + exit 0 + else + echo "ERROR" + kill $KRAFT_PID + exit 1 + fi + working-directory: library/imaginary/1.2 + push: if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - needs: [ build ] + needs: [ test ] runs-on: ubuntu-latest steps: @@ -77,4 +125,4 @@ jobs: uses: ./.github/actions/merge-oci-digests with: name: index.unikraft.io/unikraft.org/imaginary:1.2 - push: true + push: true \ No newline at end of file diff --git a/library/redis/7.0/Kraftfile b/library/redis/7.0/Kraftfile index 6647d211..d6a5c7d0 100644 --- a/library/redis/7.0/Kraftfile +++ b/library/redis/7.0/Kraftfile @@ -4,10 +4,13 @@ name: redis rootfs: ./rootfs -cmd: ["/redis.conf"] +#cmd: ["/redis.conf"] +cmd: ["/redis-server", "/redis.conf", "--protected-mode", "no"] unikraft: - version: staging + #version: staging + #version: v0.14.0 + version: stable kconfig: CONFIG_LIBDEVFS_AUTOMOUNT: 'y' CONFIG_LIBDEVFS: 'y' @@ -43,9 +46,13 @@ targets: - fc/arm64 libraries: - musl: staging + #musl: staging + #musl: v0.14.0 + musl: stable lwip: - version: staging + #version: staging + #version: v0.14.0 + version: stable kconfig: CONFIG_LWIP_UKNETDEV: 'y' CONFIG_LWIP_TCP: 'y' @@ -58,7 +65,8 @@ libraries: CONFIG_LWIP_DHCP: 'y' CONFIG_LWIP_DNS: 'y' redis: - version: staging + #version: staging + version: stable kconfig: CONFIG_LIBREDIS_SERVER: 'y' CONFIG_LIBREDIS_COMMON: 'y' diff --git a/library/redis/7.2/Kraftfile b/library/redis/7.2/Kraftfile index c32a0b0f..e1a25864 100644 --- a/library/redis/7.2/Kraftfile +++ b/library/redis/7.2/Kraftfile @@ -8,11 +8,11 @@ cmd: ["/usr/bin/redis-server", "/etc/redis/redis.conf"] template: source: https://github.com/unikraft/app-elfloader.git - version: staging + version: stable unikraft: source: https://github.com/unikraft/unikraft.git - version: staging + version: stable kconfig: # Configurations options for app-elfloader # (they can't be part of the template atm) @@ -117,7 +117,7 @@ unikraft: libraries: lwip: source: https://github.com/unikraft/lib-lwip.git - version: staging + version: stable kconfig: CONFIG_LWIP_LOOPIF: 'y' CONFIG_LWIP_UKNETDEV: 'y' @@ -139,7 +139,7 @@ libraries: CONFIG_LWIP_ICMP: 'y' libelf: source: https://github.com/unikraft/lib-libelf.git - version: staging + version: stable targets: - fc/x86_64