diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 684fba5..3d33594 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -28,7 +28,8 @@ on: - 'v*' env: - GO_VERSION: 1.19.13 + GO_VERSION_OPENEBS: 1.19.13 + GO_VERSION: 1.23.4 PROVISIONER_NFS_IMAGE: provisioner-nfs NFS_SERVER_IMAGE: nfs-server-alpine EXPORT_PATH: /tmp @@ -64,6 +65,17 @@ jobs: # to ignore builds on release if: ${{ (github.event.ref_type != 'tag') }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: [provisioner-nfs, nfs-server-alpine] + include: + - image: provisioner-nfs + go_version: v1.23.4 + make_step: provisioner-nfs-image + - image: nfs-server-alpine + go_version: v1.19.13 + make_step: nfs-server-image needs: ['lint', 'unit-test'] steps: - name: Checkout @@ -72,28 +84,19 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - - name: Build provisioner-nfs image - run: make provisioner-nfs-image + go-version: ${{ matrix.go_version }} - - name: Build nfs-server-alpine image - run: make nfs-server-image + - name: Build image + run: make ${{ matrix.make_step }} - name: Export images - run: make output-image - - - name: Upload provisioner-nfs image - uses: actions/upload-artifact@v4 - with: - name: ${{ env.PROVISIONER_NFS_IMAGE }} - path: ${{ env.EXPORT_PATH }}/${{ env.PROVISIONER_NFS_IMAGE }}.tar + run: make output-${{ matrix.make_step }} - - name: Upload nfs-server-alpine image + - name: Upload image uses: actions/upload-artifact@v4 with: - name: ${{ env.NFS_SERVER_IMAGE }} - path: ${{ env.EXPORT_PATH }}/${{ env.NFS_SERVER_IMAGE }}.tar + name: ${{ matrix.image }} + path: ${{ env.EXPORT_PATH }}/${{ matrix.image }}.tar sanity-test: # to ignore builds on release @@ -170,8 +173,6 @@ jobs: - name: Setup Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 - with: - version: v0.5.1 - name: Build Image uses: docker/build-push-action@v6 diff --git a/Makefile b/Makefile index 655e839..8387456 100644 --- a/Makefile +++ b/Makefile @@ -184,13 +184,19 @@ nfs-server-image: @cd nfs-server-container && docker build -t ${NFS_SERVER_IMAGE_TAG} . --no-cache #Use this to extract and load image for sharing acorss GitHub actions -.PHONY: output-image -output-image: +.PHONY: output-provisioner-nfs-image +output-provisioner-nfs-image: @echo "--> Export ${PROVISIONER_NFS_IMAGE_TAG} image to ${EXPORT_PATH}/${PROVISIONER_NFS_IMAGE}.tar"; @docker image save --output "${EXPORT_PATH}/${PROVISIONER_NFS_IMAGE}.tar" ${PROVISIONER_NFS_IMAGE_TAG} + +.PHONY: output-nfs-server-image +output-nfs-server-image: @echo "--> Export ${NFS_SERVER_IMAGE_TAG} to ${EXPORT_PATH}/${NFS_SERVER_IMAGE}.tar"; @docker image save --output "${EXPORT_PATH}/${NFS_SERVER_IMAGE}.tar" ${NFS_SERVER_IMAGE_TAG} +.PHONY: output-image +output-image: output-provisioner-nfs-image output-nfs-server-image + .PHONY: load-image load-image: @echo "--> Load provisioner-nfs image"; diff --git a/buildscripts/provisioner-nfs/Dockerfile b/buildscripts/provisioner-nfs/Dockerfile index ce85867..069535f 100644 --- a/buildscripts/provisioner-nfs/Dockerfile +++ b/buildscripts/provisioner-nfs/Dockerfile @@ -12,7 +12,7 @@ #See the License for the specific language governing permissions and #limitations under the License. # -FROM alpine:3.12 +FROM alpine:3.21.2 RUN apk add --no-cache \ iproute2 \ @@ -27,13 +27,17 @@ RUN apk add --no-cache \ # Download and install glibc ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc -ENV GLIBC_VERSION=2.30-r0 +ENV GLIBC_VERSION=2.35-r1 RUN set -ex && \ apk --update add libstdc++ curl ca-certificates && \ + apk add --no-cache --virtual .build-deps binutils gcompat && \ for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \ do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \ - apk add --allow-untrusted /tmp/*.apk && \ + # Workaround for Alpine 3.19+: https://github.com/sgerrand/alpine-pkg-glibc/issues/208#issuecomment-1931353838 + apk add --allow-untrusted --force-overwrite --no-cache /tmp/glibc-${GLIBC_VERSION}.apk && \ + apk del gcompat && \ + apk add --allow-untrusted --no-cache /tmp/glibc-bin-${GLIBC_VERSION}.apk && \ rm -v /tmp/*.apk && \ /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib diff --git a/buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile b/buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile index 8235d7d..fd4d2f9 100644 --- a/buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile +++ b/buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM golang:1.19.13 as build +FROM golang:1.23.4 AS build ARG TARGETOS ARG TARGETARCH @@ -40,7 +40,7 @@ COPY . . RUN make provisioner-nfs -FROM alpine:3.12.0 +FROM alpine:3.21.2 ARG DBUILD_DATE ARG DBUILD_REPO_URL diff --git a/go.sum b/go.sum index 8cd1972..4ea66ad 100644 --- a/go.sum +++ b/go.sum @@ -604,6 +604,7 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -943,6 +944,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/tests/install-localpv.sh b/tests/install-localpv.sh index 1254775..b618ea8 100755 --- a/tests/install-localpv.sh +++ b/tests/install-localpv.sh @@ -15,8 +15,8 @@ # limitations under the License. mkdir -p /tmp/openebs -kubectl apply -f https://openebs.github.io/charts/versioned/3.4.0/hostpath-operator.yaml -wget https://openebs.github.io/charts/versioned/3.4.0/openebs-lite-sc.yaml -O /tmp/openebs-lite-sc.yaml +kubectl apply -f https://openebs.github.io/charts/versioned/3.9.0/hostpath-operator.yaml +wget https://openebs.github.io/charts/versioned/3.9.0/openebs-lite-sc.yaml -O /tmp/openebs-lite-sc.yaml sed -i 's/value\: \"\/var\/openebs\/local\/\"/value\: \"\/tmp\/openebs\/\"/' /tmp/openebs-lite-sc.yaml kubectl apply -f /tmp/openebs-lite-sc.yaml diff --git a/tests/nfs_server_image_test.go b/tests/nfs_server_image_test.go index b335693..e4c52fe 100644 --- a/tests/nfs_server_image_test.go +++ b/tests/nfs_server_image_test.go @@ -45,7 +45,7 @@ var _ = Describe("TEST NFS SERVER IMAGE CONFIGURATION", func() { nfsProvisionerLabel = "openebs.io/component-name=openebs-nfs-provisioner" nfsProvisionerContainerName = "openebs-provisioner-nfs" nfsServerImage = "jimsihk/nfs-server-alpine:ci" - prevVersionNFSServerImage = "openebs/nfs-server-alpine:0.4.0" + prevVersionNFSServerImage = "openebs/nfs-server-alpine:0.11.0" ) When("nfs server image is updated", func() {