Skip to content

Commit a7e06c9

Browse files
committed
Merge from dev branch
2 parents 3f9aa5b + 930ad00 commit a7e06c9

File tree

28 files changed

+391
-1599
lines changed

28 files changed

+391
-1599
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build and publish moosefs-csi driver Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
env:
9+
REGISTRY_IMAGE: moosefs/moosefs-csi
10+
MFS_CLIENT: 4.57.6
11+
CSI_VERSION: 0.9.8
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform:
20+
- linux/amd64
21+
- linux/arm64
22+
- linux/arm/v7
23+
steps:
24+
- name: Prepare
25+
run: |
26+
platform=${{ matrix.platform }}
27+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
28+
29+
- name: Docker meta
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ env.REGISTRY_IMAGE }}
34+
tags: |
35+
type=ref,event=branch
36+
type=raw,value=${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
37+
type=raw,value=${{ env.CSI_VERSION }}-{{branch}}
38+
39+
- name: Set up QEMU
40+
uses: docker/setup-qemu-action@v3
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Login to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GHCR_TOKEN }}
51+
52+
- name: Build and push by digest MooseFS Client v4
53+
id: build
54+
uses: docker/build-push-action@v6
55+
with:
56+
file: ./cmd/moosefs-csi-plugin/Dockerfile
57+
platforms: ${{ matrix.platform }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
outputs: type=image,name=ghcr.io/${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
60+
build-args: |
61+
MFS_TAG=v${{ env.MFS_CLIENT }}
62+
CSI_TAG=dev
63+
64+
- name: Export digest
65+
run: |
66+
mkdir -p /tmp/digests
67+
digest="${{ steps.build.outputs.digest }}"
68+
touch "/tmp/digests/${digest#sha256:}"
69+
70+
- name: Upload digest
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: digests-${{ env.PLATFORM_PAIR }}
74+
path: /tmp/digests/*
75+
if-no-files-found: error
76+
retention-days: 1
77+
78+
merge:
79+
runs-on: ubuntu-latest
80+
needs:
81+
- build
82+
steps:
83+
- name: Download digests
84+
uses: actions/download-artifact@v4
85+
with:
86+
path: /tmp/digests
87+
pattern: digests-*
88+
merge-multiple: true
89+
90+
- name: Set up Docker Buildx
91+
uses: docker/setup-buildx-action@v3
92+
93+
- name: Docker meta
94+
id: meta
95+
uses: docker/metadata-action@v5
96+
with:
97+
images: ghcr.io/${{ env.REGISTRY_IMAGE }}
98+
tags: |
99+
type=ref,event=branch
100+
type=raw,value=${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
101+
type=raw,value=${{ env.CSI_VERSION }}-{{branch}}
102+
103+
- name: Login to GitHub Container Registry
104+
uses: docker/login-action@v3
105+
with:
106+
registry: ghcr.io
107+
username: ${{ github.actor }}
108+
password: ${{ secrets.GHCR_TOKEN }}
109+
110+
- name: Create manifest list and push
111+
working-directory: /tmp/digests
112+
run: |
113+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
114+
$(printf 'ghcr.io/${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
115+
116+
- name: Inspect image
117+
run: |
118+
docker buildx imagetools inspect ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright (c) 2023 Saglabs SA. All Rights Reserved.
190+
Copyright (c) 2025 Saglabs SA. All Rights Reserved.
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

Makefile

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Saglabs SA. All Rights Reserved.
1+
# Copyright (c) 2025 Saglabs SA. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,42 +12,46 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
MFS3VER=3.0.117
16-
MFS4VER=4.44.4
17-
DRIVER_VERSION ?= 0.9.4
18-
MFS3TAGCE=$(DRIVER_VERSION)-$(MFS3VER)
19-
MFS3TAGPRO=$(DRIVER_VERSION)-$(MFS3VER)-pro
20-
MFS4TAGPRO=$(DRIVER_VERSION)-$(MFS4VER)-pro
21-
DEVTAG=$(DRIVER_VERSION)-dev
15+
MFS_VERSION = "4.57.6"
16+
CSI_VERSION ?= "0.9.8"
2217

23-
NAME=moosefs-csi-plugin
24-
DOCKER_REGISTRY=registry.moosefs.com
18+
MFS_TAG=$(CSI_VERSION)-$(MFS_VERSION)
19+
DEV_TAG=$(CSI_VERSION)-dev
2520

26-
ready: clean compile
27-
publish-dev: clean compile build-dev push-dev
21+
NAME=moosefs-csi
22+
23+
csi: clean compile
24+
dev: build-dev push-dev
25+
prod: build-prod push-prod
2826

2927
compile:
30-
@echo "==> Building the project"
28+
@echo "==> Building the CSI driver"
3129
@env CGO_ENABLED=0 GOCACHE=/tmp/go-cache GOOS=linux GOARCH=amd64 go build -a -o cmd/moosefs-csi-plugin/${NAME} cmd/moosefs-csi-plugin/main.go
3230

3331
build-dev:
34-
@echo "==> Building DEV docker images"
35-
@docker build -t $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(DEVTAG) cmd/moosefs-csi-plugin
32+
@echo "==> Building DEV CSI images"
33+
@docker build --no-cache -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev cmd/moosefs-csi-plugin
3634

3735
push-dev:
38-
@echo "==> Publishing DEV $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(DEVTAG)"
39-
@docker push $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(DEVTAG)
40-
@echo "==> Your DEV image is now available at $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(DEVTAG)"
36+
@echo "==> Publishing DEV CSI image on hub.docker.com: moosefs/$(NAME):$(DEV_TAG)"
37+
@docker push moosefs/$(NAME):$(DEV_TAG)
38+
@docker push moosefs/$(NAME):dev
4139

4240
build-prod:
43-
@docker build -t $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS3TAGCE) cmd/moosefs-csi-plugin -f cmd/moosefs-csi-plugin/Dockerfile-mfs3-ce
44-
@docker build -t $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS3TAGPRO) cmd/moosefs-csi-plugin -f cmd/moosefs-csi-plugin/Dockerfile-mfs3-pro
45-
@docker build -t $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS4TAGPRO) cmd/moosefs-csi-plugin -f cmd/moosefs-csi-plugin/Dockerfile-mfs4-pro
41+
@echo "==> Building Production CSI images"
42+
@docker build --no-cache -t moosefs/$(NAME):$(MFS_TAG) --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=$(CSI_VERSION) cmd/moosefs-csi-plugin
4643

4744
push-prod:
48-
@docker push $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS3TAGCE)
49-
@docker push $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS3TAGPRO)
50-
@docker push $(DOCKER_REGISTRY)/moosefs-csi-plugin:$(MFS4TAGPRO)
45+
@echo "==> Publishing PRODUCTION CSI image on hub.docker.com: moosefs/$(NAME):$(MFS_TAG)"
46+
@docker push moosefs/$(NAME):$(MFS_TAGCE)
47+
48+
dev-buildx:
49+
@echo "==> Using buildx to build and publish dev image"
50+
@docker buildx build --no-cache --push --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) cmd/moosefs-csi-plugin
51+
52+
prod-buildx:
53+
@echo "==> Using buildx to build and publish production image"
54+
@docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev -t moosefs/$(NAME):$(MFS_TAG) cmd/moosefs-csi-plugin
5155

5256
clean:
5357
@echo "==> Cleaning releases"

README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ MooseFS source code can be found [on GitHub](https://github.com/moosefs/moosefs)
1010

1111
*Note that a pool of MooseFS Clients that are available for use by containers is created on each node. By default the number of MooseFS Clients in the pool is `1`.*
1212

13+
## Changelog
14+
15+
Driver verson 0.9.8
16+
* MooseFS client updated to version 4.57.6.
17+
* The provisioner and registrar images entries have been updated.
18+
* Update the Dockerfile to build only mfsmount and mfscli.
19+
20+
Driver verson 0.9.7
21+
* Added support for MooseFS 4 client.
22+
* Enabled passing additional mfsmount parameters during the mount process (password and more).
23+
* Support for cross-platform compilation has been enabled.
24+
* Repository images support AMD64, ARM64 and ARMv7 architectures by default.
25+
1326
## Installation on Kubernetes
1427

1528
### Prerequisites
@@ -20,37 +33,46 @@ MooseFS source code can be found [on GitHub](https://github.com/moosefs/moosefs)
2033

2134
### **Deployment**
2235

23-
1. Complete `deploy/kubernetes/csi-moosefs-config.yaml` configuration file with your settings:
36+
1. Edit `deploy/kubernetes/csi-moosefs-config.yaml` config map file with your settings:
2437

2538
* `master_host` – domain name (**recommended**) or IP address of your MooseFS Master Server(s). It is an equivalent to `-H master_host` or `-o mfsmaster=master_host` passed to MooseFS Client.
2639
* `master_port` – port number of your MooseFS Master Server. It is an equivalent to `-P master_port` or `-o mfsport=master_port` passed to MooseFS Client.
2740
* `k8s_root_dir` – each mount's root directory on MooseFS. Each path is relative to this one. Equivalent to `-S k8s_root_dir` or `-o mfssubfolder=k8s_root_dir` passed to MooseFS Client.
2841
* `driver_working_dir` – a driver working directory inside MooseFS where persistent volumes, logs and metadata is stored (actual path is: `k8s_root_dir/driver_working_dir`)
2942
* `mount_count` – number of pre created MooseFS clients running on each node
30-
and apply:
3143
* `mfs_logging` – driver can create logs from each component in `k8s_root_dir/driver_working_dir/logs` directory. Boolean `"true"`/`"false"` value.
3244

45+
2. Apply csi-moosefs-config config map to the cluster:
46+
3347
```
3448
$ kubectl apply -f deploy/kubernetes/csi-moosefs-config.yaml
3549
```
3650
37-
2. ConfigMap should now be created:
51+
Check the config map status:
3852
3953
```
4054
$ kubectl get configmap -n kube-system
4155
NAME DATA AGE
4256
csi-moosefs-config 6 42s
4357
```
4458
45-
3. Update `deploy/kubernetes/csi-moosefs.yaml` file with the image that uses required MooseFS or MooseFS Pro version and MooseFS CSI Plugin version. Default images are the latest version of the plugin and the latest version of MooseFS (Community):
59+
3. Update `deploy/csi-moosefs.yaml` file with the aproprieate image:
4660
47-
* Find plugin named `csi-moosefs-plugin`
48-
* Update the `image` version suffix in the plugin's section accordingly, for example:
49-
* `0.9.4-3.0.117` – for plugin version 0.9.4 and MooseFS Community 3.0.117
50-
* `0.9.4-4.44.4-pro` – for plugin version 0.9.4 and MooseFS Pro 4.44.4
61+
The default image consists of the latest version of the CSI plug-in and the latest version of the MooseFS Community Edition client:
62+
63+
* Locate image definition under the `csi-moosefs-plugin` plugin name(line 230 and line 329)
64+
`mage: ghcr.io/moosefs/moosefs-csi:dev`
65+
* Update the `image` version suffix in the plugin's section accordingly:
66+
* `0.9.8-4.57.6` – plugin version 0.9.7 and MooseFS CE 4.57.6
67+
* `0.9.7-4.57.5` – plugin version 0.9.7 and MooseFS CE 4.57.5
68+
* `0.9.7-4.56.6` – plugin version 0.9.7 and MooseFS CE 4.56.6
5169
5270
You can find a complete list of available images at: \
53-
https://registry.moosefs.com/v2/moosefs-csi-plugin/tags/list.
71+
https://github.com/moosefs/moosefs-csi/pkgs/container/moosefs-csi
72+
73+
Fot driver with MoosreFS client PRO version: https://registry.moosefs.com/v2/moosefs-csi-plugin/tags/list.
74+
* `0.9.7-4.56.6-pro` – plugin version 0.9.7 and MooseFS PRO 4.56.6
75+
5476
5577
**Note there are two occurrences of `csi-moosefs-plugin` in `csi-moosefs.yaml` file and it is necessary to update the image version in both places of the file.**
5678
@@ -104,7 +126,8 @@ MooseFS source code can be found [on GitHub](https://github.com/moosefs/moosefs)
104126
172.17.2.80:9421 4.2T 1.4T 2.8T 33% /data
105127
```
106128
107-
You may take a look at MooseFS CGI Monitoring Interface ("Quotas" tab) to check if a quota for 5 GiB on a newly created volume directory has been set. Dynamically provisioned volumes are stored on MooseFS in `k8s_root_dir/driver_working_dir/volumes` directory.
129+
You may take a look at MooseFS GUI Monitoring Interface ("Quotas" tab) to check if a quota for 5 GiB on a newly created volume directory has been set.
130+
Dynamically provisioned volumes are stored on MooseFS in `k8s_root_dir/driver_working_dir/volumes` directory.
108131
109132
5. Clean up:
110133
@@ -233,12 +256,13 @@ spec:
233256
234257
| Kubernetes | MooseFS CSI Driver |
235258
|:----------:|:------------------:|
236-
| `v1.26.2` | `v0.9.4` |
237-
| `v1.24.2` | `v0.9.4` |
259+
| `v1.26` | `v0.9.7` |
260+
| `-----` | `------` |
261+
| `v1.32` | `v0.9.8` |
238262
239263
## Copyright
240264
241-
Copyright (c) 2020-2023 Saglabs SA
265+
Copyright (c) 2020-2025 Saglabs SA
242266
243267
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0).
244268

cmd/moosefs-csi-plugin/Dockerfile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Saglabs SA. All Rights Reserved.
1+
# Copyright (c) 2025 Saglabs SA. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,22 +12,30 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM debian:buster
15+
ARG CSI_TAG="v0.9.8"
16+
ARG MFS_TAG="v4.57.6"
1617

17-
# Install wget, lsb-release and curl
18-
RUN apt update && \
19-
apt install -y wget lsb-release curl fuse libfuse3-dev tree ca-certificates e2fsprogs gnupg2 && \
20-
# security updates
21-
apt install -y apt systemd
18+
#Build MooseFS CSI driver from source
19+
FROM golang:1.23-bookworm AS csibuilder
20+
WORKDIR /build
21+
ARG CSI_TAG
22+
RUN git clone --depth 1 --branch ${CSI_TAG} https://github.com/moosefs/moosefs-csi.git
23+
RUN cd moosefs-csi && CGO_ENABLED=0 GOCACHE=/tmp/go-cache GOOS=linux go build -a -o /build/moosefs-csi-plugin cmd/moosefs-csi-plugin/main.go
2224

23-
# Add key
24-
RUN wget -O - http://repository.moosefs.com/moosefs.key | apt-key add -
25-
RUN echo "deb http://repository.moosefs.com/4.44.4/apt/debian/buster buster main" > /etc/apt/sources.list.d/moosefs.list
26-
27-
# Install MooseFS client
28-
RUN apt update --allow-releaseinfo-change && apt install -y moosefs-pro-client
29-
30-
# Copy the CSI plugin
31-
ADD moosefs-csi-plugin /bin/
25+
#Build MooseFS Client from source Debian 12 Bookworm
26+
# MooseFS client is required for the CSI driver to mount volumes
27+
FROM ghcr.io/moosefs/mfsbuilder:latest AS mfsbuilder
28+
WORKDIR /moosefs
29+
ARG MFS_TAG
30+
RUN git clone --depth 1 --branch ${MFS_TAG} https://github.com/moosefs/moosefs.git /moosefs
31+
RUN autoreconf -f -i
32+
RUN ./configure --prefix=/usr --mandir=/share/man --sysconfdir=/etc --localstatedir=/var/lib --with-default-user=mfs --with-default-group=mfs --disable-mfsbdev --disable-mfsmaster --disable-mfschunkserver --disable-mfsmetalogger --disable-mfsnetdump --disable-mfscgi --disable-mfscgiserv --disable-mfscli
33+
RUN cd /moosefs/mfsclient && make DESTDIR=/tmp/ install
3234

35+
#Build CSI plugin container
36+
FROM debian:bookworm
37+
RUN apt update && apt install -y libfuse3-3
38+
COPY --from=csibuilder /build/moosefs-csi-plugin /bin/moosefs-csi-plugin
39+
COPY --from=mfsbuilder /tmp/usr/bin /usr/bin
40+
RUN ["ln", "-s", "/usr/bin/mfsmount", "/usr/sbin/mount.moosefs"]
3341
ENTRYPOINT ["/bin/moosefs-csi-plugin"]

cmd/moosefs-csi-plugin/Dockerfile-mfs3-ce

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)