Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(itest): print container health and latest logs on each readiness check #1544

Merged
merged 8 commits into from
Jun 15, 2023
6 changes: 6 additions & 0 deletions .github/workflows/ci-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ jobs:
needs: [get-pom-properties]
steps:
- name: Install qemu
if: ${{ inputs.build-arch != 'amd64' }}
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/checkout@v2
if: always()
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
Expand Down Expand Up @@ -87,10 +90,13 @@ jobs:
if: ${{ ! inputs.skip-itests }}
steps:
- name: Install qemu
if: ${{ inputs.build-arch != 'amd64' }}
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/checkout@v2
if: always()
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
build-arch: ${{ matrix.arch }}
checkout-repo: ${{ github.event.pull_request.head.repo.full_name }}
checkout-ref: ${{ github.event.pull_request.head.ref }}
skip-itests: ${{ matrix.arch != 'amd64' }}
secrets: inherit
if: github.repository_owner == 'cryostatio' && contains(github.event.pull_request.labels.*.name, 'safe-to-test')

Expand All @@ -45,6 +46,7 @@ jobs:
matrix:
arch: [amd64, arm64]
needs: [code-analysis, build-and-test]
if: always() && github.repository_owner == 'cryostatio'
steps:
- name: Fail if needs-triage label applied
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs-triage') }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/push-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
checkout-repo: ${{ github.event.pull_request.head.repo.full_name }}
checkout-ref: ${{ github.event.pull_request.head.ref }}
secrets: inherit
if: github.repository_owner == 'cryostatio' && contains(github.event.pull_request.labels.*.name, 'safe-to-test')
if: github.repository_owner == 'cryostatio'
build-and-test-amd64:
uses: ./.github/workflows/ci-build-image.yml
secrets: inherit
Expand All @@ -37,6 +37,7 @@ jobs:
needs: [code-analysis, build-and-test-amd64, build-and-test-arm64]
env:
CRYOSTAT_IMG: quay.io/cryostat/cryostat
if: always() && github.repository_owner == 'cryostatio'
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,10 @@
<configuration>
<executable>timeout</executable>
<arguments>
<argument>15m</argument>
<argument>2m</argument>
<argument>sh</argument>
<argument>-c</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.containerName}; do sleep 5; done</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.containerName}; do podman ps --filter name=${cryostat.itest.containerName}; podman logs --timestamps --since 5s ${cryostat.itest.containerName}; sleep 5; done</argument>
</arguments>
<skip>${skipITs}</skip>
</configuration>
Expand All @@ -645,10 +645,10 @@
<configuration>
<executable>timeout</executable>
<arguments>
<argument>15m</argument>
<argument>2m</argument>
<argument>sh</argument>
<argument>-c</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.jfr-datasource.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.jfr-datasource.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.jfr-datasource.containerName}; do sleep 5; done</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.jfr-datasource.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.jfr-datasource.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.jfr-datasource.containerName}; do podman ps --filter name=${cryostat.itest.jfr-datasource.containerName}; podman logs --timestamps --since 5s ${cryostat.itest.jfr-datasource.containerName}; sleep 5; done</argument>
</arguments>
<skip>${skipITs}</skip>
</configuration>
Expand All @@ -662,10 +662,10 @@
<configuration>
<executable>timeout</executable>
<arguments>
<argument>15m</argument>
<argument>2m</argument>
<argument>sh</argument>
<argument>-c</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.grafana.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.grafana.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.grafana.containerName}; do sleep 5; done</argument>
<argument>until if ! podman inspect --type container ${cryostat.itest.grafana.containerName} > /dev/null; then exit 1; fi ; podman ps --filter health=healthy --filter name=${cryostat.itest.grafana.containerName} --format '{{.Names}} {{.Status}}' | tee /dev/stderr | grep ${cryostat.itest.grafana.containerName}; do podman ps --filter name=${cryostat.itest.grafana.containerName}; podman logs --timestamps --since 5s ${cryostat.itest.grafana.containerName}; sleep 5; done</argument>
</arguments>
<skip>${skipITs}</skip>
</configuration>
Expand Down