From 7ec4b2540599bffb106d0d440ba383e8e446c38c Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 16 Feb 2024 18:09:51 -0700 Subject: [PATCH] test: adding testing matrix for os release matrix Problem: we want to make sure that fluxion-go builds across OS releases. Solution: add each major build to the testing matrix. In addition, we want to use bookworm-amd64 over bookworm, which does not appear to be updated. With these newer containers we do not need to build flux-sched to create the bindings (reapi_cli.so) as they are already installed to /usr Signed-off-by: vsoch --- .devcontainer/Dockerfile | 10 ++-------- .github/workflows/main.yaml | 25 +++++++++++++------------ Makefile | 6 +++--- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cc7c1ce..f57c3e7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM fluxrm/flux-sched:bookworm +FROM fluxrm/flux-sched:bookworm-amd64 LABEL maintainer="Vanessasaurus <@vsoch>" @@ -17,13 +17,7 @@ RUN wget https://go.dev/dl/go1.19.10.linux-amd64.tar.gz && tar -xvf go1.19.10.l mv go /usr/local && rm go1.19.10.linux-amd64.tar.gz ENV PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin -RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched && \ - cd /opt/flux-sched && \ - git fetch && \ - export FLUX_SCHED_VERSION=0.58.0 && \ - ./autogen.sh && \ - ./configure --prefix=/usr && \ - make && make install +RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched # Add the group and user that match our ids RUN groupadd -g ${USER_GID} ${USERNAME} && \ diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index be3bdbd..761b4ed 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,6 +6,12 @@ name: test fluxion-go on: pull_request: [] + workflow_dispatch: + + # Bindings should always be checked against the latest containers + # 2:10 every Thursday + schedule: + - cron: '10 2 * * 4' jobs: test: @@ -14,7 +20,10 @@ jobs: strategy: fail-fast: false matrix: - test: [["fluxrm/flux-sched:bookworm", "0.32.0"]] + test: [["fluxrm/flux-sched:jammy"], + ["fluxrm/flux-sched:fedora38"], + ["fluxrm/flux-sched:bookworm-amd64"], + ["fluxrm/flux-sched:el8"]] container: image: ${{ matrix.test[0] }} @@ -25,20 +34,12 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.19 - # TODO: do we want this to be for different versions? Need to coincide with container bases - # We also want the reapi_cli.so to be built by default + + # TODO: we should consider distributing the header files with the release builds - name: flux-sched build env: version: ${{ matrix.test[1] }} - run: | - git clone https://github.com/flux-framework/flux-sched /opt/flux-sched - export FLUX_SCHED_VERSION=${version} - cd /opt/flux-sched - ./autogen.sh - ./configure --prefix=/usr - make && make install - ls /usr/lib/flux - + run: git clone https://github.com/flux-framework/flux-sched /opt/flux-sched - name: Build run: make build - name: Test Binary diff --git a/Makefile b/Makefile index 682e367..2510f9e 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ JOBSPECS ?= $(HERE)/cmd/test/data/jobspecs FLUX_SCHED_ROOT ?= /opt/flux-sched INSTALL_PREFIX ?= /usr COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) -LD_LIBRARY_PATH=/usr/lib:/usr/lib/flux:/usr/local/lib:/usr/local/lib/flux -BUILDENVVAR=CGO_CFLAGS="-I${FLUX_SCHED_ROOT} -I${FLUX_SCHED_ROOT}/resource/reapi/bindings/c" CGO_LDFLAGS="-L${INSTALL_PREFIX}/lib -L${INSTALL_PREFIX}/lib/flux -L${FLUX_SCHED_ROOT}/resource/reapi/bindings -lreapi_cli -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp" -# BUILDENVAR=CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS='${CGO_LIBRARY_FLAGS}' go build -ldflags '-w' +# Note that el8 and derivatives are in /usr/lib64 +LD_LIBRARY_PATH=/usr/lib:/usr/lib/flux:/usr/local/lib:/usr/local/lib/flux:/usr/lib64/flux:/usr/lib64 +BUILDENVVAR=CGO_CFLAGS="-I${FLUX_SCHED_ROOT} -I${FLUX_SCHED_ROOT}/resource/reapi/bindings/c" CGO_LDFLAGS="-L${INSTALL_PREFIX}/lib -L${INSTALL_PREFIX}/lib/flux -L${FLUX_SCHED_ROOT}/resource/reapi/bindings -lreapi_cli -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp" .PHONY: all all: build