diff --git a/.github/workflows/example-http-java17-stable.yaml b/.github/workflows/example-http-java17-stable.yaml new file mode 100644 index 00000000..b463730f --- /dev/null +++ b/.github/workflows/example-http-java17-stable.yaml @@ -0,0 +1,119 @@ +name: examples/http-java17 (stable) + +on: + workflow_dispatch: + + push: + branches: [main] + paths: + - '.github/workflows/example-http-java17-stable.yaml' + - 'http-java17/**' + - '!http-java17/README.md' + + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + paths: + - '.github/workflows/example-http-java17-stable.yaml' + - 'http-java17/**' + - '!http-java17/README.md' + + schedule: + - cron: '45 15 * * 1-5' + +# Automatically cancel in-progress actions on the same branch +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +env: + UKC_METRO: ${{ vars.UKC_METRO }} + UKC_TOKEN: ${{ secrets.UKC_TOKEN }} + KRAFTKIT_NO_CHECK_UPDATES: true + KRAFTKIT_LOG_LEVEL: debug + +jobs: + integration: + timeout-minutes: 60 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Test + id: test + uses: unikraft/kraftkit@staging + continue-on-error: true + with: + run: | + set -xe; + + cd http-java17; + + kraft cloud deploy \ + --no-start \ + --memory 512 \ + --name http-java17-${GITHUB_RUN_ID} \ + --runtime index.unikraft.io/official/java:17 \ + --subdomain http-java17-${GITHUB_RUN_ID} \ + -p 443:8080 \ + .; + + # wait for the instance to start + kraft cloud vm start -w 60s http-java17-${GITHUB_RUN_ID}; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-java17-${GITHUB_RUN_ID}.${UKC_METRO}.kraft.host + + - name: Cleanup + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm logs http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm stop http-java17-${GITHUB_RUN_ID} || true; + kraft cloud instance get http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm logs http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm rm http-java17-${GITHUB_RUN_ID} || true; + kraft cloud img rm index.unikraft.io/test/http-java17-${GITHUB_RUN_ID} || true; + + - name: Re-test with debug info + id: re-test + if: ${{ success() && steps.test.outcome == 'failure' }} + uses: unikraft/kraftkit@staging + with: + run: | + set -xe; + + cd http-java17; + + kraft cloud deploy \ + --no-start \ + --memory 512 \ + --name http-java17-${GITHUB_RUN_ID}-dbg \ + --runtime index.unikraft.io/official/java:17-dbg \ + --subdomain http-java17-${GITHUB_RUN_ID}-dbg \ + -p 443:8080 \ + .; + + # wait for the instance to start + kraft cloud vm start -w 60s http-java17-${GITHUB_RUN_ID}-dbg; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-java17-${GITHUB_RUN_ID}-dbg.${UKC_METRO}.kraft.host + + - name: Cleanup Debug + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm logs http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm stop http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud instance get http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm logs http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm rm http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud img rm index.unikraft.io/test/http-java17-${GITHUB_RUN_ID}-dbg || true; diff --git a/.github/workflows/example-http-java17-staging.yaml b/.github/workflows/example-http-java17-staging.yaml new file mode 100644 index 00000000..1ee2dee3 --- /dev/null +++ b/.github/workflows/example-http-java17-staging.yaml @@ -0,0 +1,119 @@ +name: examples/http-java17 (staging) + +on: + workflow_dispatch: + + push: + branches: [main] + paths: + - '.github/workflows/example-http-java17-staging.yaml' + - 'http-java17/**' + - '!http-java17/README.md' + + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + paths: + - '.github/workflows/example-http-java17-staging.yaml' + - 'http-java17/**' + - '!http-java17/README.md' + + schedule: + - cron: '45 15 * * 1-5' + +# Automatically cancel in-progress actions on the same branch +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +env: + UKC_METRO: ${{ vars.UKC_METRO }} + UKC_TOKEN: ${{ secrets.UKC_TOKEN }} + KRAFTKIT_NO_CHECK_UPDATES: true + KRAFTKIT_LOG_LEVEL: debug + +jobs: + integration: + timeout-minutes: 60 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Test + id: test + uses: unikraft/kraftkit@staging + continue-on-error: true + with: + run: | + set -xe; + + cd http-java17; + + kraft cloud deploy \ + --no-start \ + --memory 512 \ + --name http-java17-${GITHUB_RUN_ID} \ + --runtime index.unikraft.io/official/java:17 \ + --subdomain http-java17-${GITHUB_RUN_ID} \ + -p 443:8080 \ + .; + + # wait for the instance to start + kraft cloud vm start -w 60s http-java17-${GITHUB_RUN_ID}; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-java17-${GITHUB_RUN_ID}.${UKC_METRO}.kraft.host + + - name: Cleanup + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm logs http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm stop http-java17-${GITHUB_RUN_ID} || true; + kraft cloud instance get http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm logs http-java17-${GITHUB_RUN_ID} || true; + kraft cloud vm rm http-java17-${GITHUB_RUN_ID} || true; + kraft cloud img rm index.unikraft.io/test/http-java17-${GITHUB_RUN_ID} || true; + + - name: Re-test with debug info + id: re-test + if: ${{ success() && steps.test.outcome == 'failure' }} + uses: unikraft/kraftkit@staging + with: + run: | + set -xe; + + cd http-java17; + + kraft cloud deploy \ + --no-start \ + --memory 512 \ + --name http-java17-${GITHUB_RUN_ID}-dbg \ + --runtime index.unikraft.io/official/java:17-dbg \ + --subdomain http-java17-${GITHUB_RUN_ID}-dbg \ + -p 443:8080 \ + .; + + # wait for the instance to start + kraft cloud vm start -w 60s http-java17-${GITHUB_RUN_ID}-dbg; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-java17-${GITHUB_RUN_ID}-dbg.${UKC_METRO}.kraft.host + + - name: Cleanup Debug + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm logs http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm stop http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud instance get http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm logs http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud vm rm http-java17-${GITHUB_RUN_ID}-dbg || true; + kraft cloud img rm index.unikraft.io/test/http-java17-${GITHUB_RUN_ID}-dbg || true; diff --git a/README.md b/README.md index aa3001d3..3cbc7d64 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Example | Unikraft Cloud
`stable` | Unikraft Cloud
`staging` | [`http-cpp`](https://github.com/unikraft-cloud/examples/tree/main/http-cpp) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-staging.yaml) | [`http-cpp-boost`](https://github.com/unikraft-cloud/examples/tree/main/http-cpp-boost) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-boost-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-boost-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-boost-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-cpp-boost-staging.yaml) | [`http-go1.21`](https://github.com/unikraft-cloud/examples/tree/main/http-go1.21) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-go1.21-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-go1.21-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-go1.21-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-go1.21-staging.yaml) | +[`http-java17`](https://github.com/unikraft-cloud/examples/tree/main/http-java17) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-java17-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-java17-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-java17-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-java17-staging.yaml) | [`http-lua5.1`](https://github.com/unikraft-cloud/examples/tree/main/http-lua5.1) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-lua5.1-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-lua5.1-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-lua5.1-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-lua5.1-staging.yaml) | [`http-node21`](https://github.com/unikraft-cloud/examples/tree/main/http-node21) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-node21-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-node21-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-node21-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-node21-staging.yaml) | [`http-perl5.38`](https://github.com/unikraft-cloud/examples/tree/main/http-perl5.38) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-perl5.38-stable.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-perl5.38-stable.yaml) | [![](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-perl5.38-staging.yaml/badge.svg)](https://github.com/unikraft-cloud/examples/actions/workflows/example-http-perl5.38-staging.yaml) |