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

Upgrade provisioner-nfs image #10

Open
wants to merge 18 commits into
base: feature/image-upgrade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
10 changes: 7 additions & 3 deletions buildscripts/provisioner-nfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions tests/install-localpv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/nfs_server_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading