From 995b936aca7f20710861ff926a030f80a0d12c9c Mon Sep 17 00:00:00 2001 From: Daniel Kimsey <90741+dekimsey@users.noreply.github.com> Date: Wed, 12 Jul 2023 09:51:26 -0500 Subject: [PATCH] Smoke test binaries for EL7 compatiblity (#17706) 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 | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1ec265c98f..fa8ac6d39cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -330,6 +330,44 @@ jobs: docker.io/hashicorppreview/${{ env.PKG_NAME }}:${{ env.version }}-dev docker.io/hashicorppreview/${{ env.PKG_NAME }}:${{ env.version }}-${{env.revision}} + 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-22.04 + 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 registry.access.redhat.com/ubi7/ubi-minimal:7.9-1057 + 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 id-token: write