From bc86b868c97385693e7ef76b7939f2e4dfcdf73b Mon Sep 17 00:00:00 2001 From: Daniel Kimsey Date: Fri, 23 Jun 2023 09:01:21 -0500 Subject: [PATCH] Smoke test binaries for EL7 compatiblity This adds a quick smoke test of our binaries to verify we haven't exceeeded the maximum GLIBC (2.17) version during linking which would break our ability to execute on EL7 machines. --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e5efe56e33f..cdffce8ab811 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: branches: - main - release/** + - releng/** workflow_dispatch: inputs: build-ref: @@ -281,6 +282,44 @@ jobs: name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip path: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + minimum-os: + name: OS Compatibility + # A quick smoke test of our binaries on our minimum target OS (RHEL 7). Why RHEL 7? Because the glibc version is that old (2.17). + needs: + - get-go-version + - get-product-version + - build-linux + runs-on: ubuntu-latest + strategy: + fail-fast: false + # Note: Ideally we'd test all our target archs, unfortunately availability of containers of these OS's vary. + # For instance there is no ubi7 image for arm64 (there is on ubi8), RHBZ#1728771. And none at all for arm. + # So we have to settle for only being able to validate where we can, which is just amd64. + matrix: + goos: [linux] + goarch: ["amd64"] + steps: + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + with: + go-version: ${{needs.get-go-version.outputs.go-version}} + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + - name: Test binary + env: + artifact_name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + run: | + echo "::group::Unpack and Prep" + docker pull "${{matrix.image}}" + unzip "$artifact_name" + echo "::group::Diagnostics" + echo "CGO related build information:" + go version -m ./nomad | grep CGO + echo "GLIBC links:" + go tool nm ./nomad | grep -i glibc | cut -d @ -f 2-3 | sort --version-sort | uniq + echo "::group::Smoke test binary" + docker run --rm -v "$PWD:/src" registry.access.redhat.com/ubi7/ubi-minimal:7.9-1057 /src/nomad version + permissions: contents: read # This placed here for when the Nomad team is ready to build docker images.