Skip to content

Commit f39836c

Browse files
authored
cephmount: new hybrid driver to connect to CephFS clusters with go 1.25 (#5273)
* nceph: new hybrid driver to connect to ceph clusters. It relies on a locally mounted filesystem and only relies on libcephfs and librados to obtain the path from an device inode. * add per-user thread pool * nceph: improve logging * nceph: control testing dir with env variables * nceph: add integration tests * nceph: ensure validation tests only run with ceph flag * nceph: divide conn and getpath tests * nceph: add debug logs to each conn step * nceph: enable debug logs in ceph integration tests * nceph: be more flexible when parsing mds fs * nceph: be even more flexible on mds parsing * nceph: be even more flexible on mds parsing * nceph: be more versbose on rados conns * nceph: try different aproach to dump inode * nceph: revert approach * nceph: be more versbose about mds election * nceph: use MDScommand * nceph: use mount with root * nceph: misc * nepch: refactor admin conn logic * nceph: avoid redundant calls to ceph mount * nceph: be more verbose * nceph: add path<>inode integration test * nceph:log current uid in tests * nceph: be more verbose * nceph: run tests as root * nceph: use root * nceph: fix id to uid/gid mapping * nceph: trim root prefix * nceph: use fstab as source of truth * nceph: fix user context * nceph: add more verbose logs * nceph: be even more verbose * nceph: force local mount for integration tests * nceph: test * nceph: run ceph tests with build flag * nceph: enable logging on demand for ceph tests * nceph: remove temp tests * nceph: add security tests for path traversal * nceph: use current user * nceph: clean test * nceph: add benchmark * nceph: dedicated ceph benchmarks * nceph: fix typo * nceph: fix inode 1 test * nceph: fix security validation * nceph: fix test setup * nceph: fix bench tests * nceph: fix rel paths * nceph: add list folder tests * nceph: add upload tests * nceph: add multi-user benchs * nceph: add thread isolation tests * nceph: fix typo * nceph: ensure propper permissions * nceph: fix path translation * nceph: fix typo * nceph: fix test * nceph: fix package * nceph: fix mount point for benchs * nceph: fix ceph benchs * nceph: skip user switch tests if no root * nceph: make test more robust when ceph is not available * nchep to cephmount: polish * cephmount: fix README.md * cephmount: fix README.md * cephmount: fix README.md * cephmount: add debug lines for returned entries * cephmount: log also hidden entries * cephmount: bump log level to INFO for cephmount ops * cephmount: add more logs * cephmount: switch to debug mode * all: bump go.mod to 1.25 * add changelog * bump Dockerfile to go1.25.1 * bump Docker base image to go.1.25 * bump Dockerfile to 1.25.1 * fix buildtags * protomote go vet as linting tool * avoid using reflect.DeepEqual on protobufs * ignore linting on .md files * trigger CI * trigger ci
1 parent 8301819 commit f39836c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+9659
-58
lines changed

.codacy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
exclude_paths:
3+
- "**./*md"

Makefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,8 @@ all: revad reva test-go lint gen-doc
1010
################################################################################
1111

1212
TOOLCHAIN ?= $(CURDIR)/toolchain
13-
GOLANGCI_LINT ?= $(TOOLCHAIN)/golangci-lint
1413
CALENS ?= $(TOOLCHAIN)/calens
1514

16-
.PHONY: toolchain
17-
toolchain: $(GOLANGCI_LINT) $(CALENS)
18-
19-
$(GOLANGCI_LINT):
20-
@mkdir -p $(@D)
21-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=$(@D) sh -s v1.64.8
22-
2315
CALENS_DIR := $(shell mktemp -d)
2416
$(CALENS):
2517
@mkdir -p $(@D)
@@ -124,14 +116,8 @@ else
124116
endif
125117

126118
.PHONY: lint
127-
lint: $(GOLANGCI_LINT)
128-
@$(GOLANGCI_LINT) run || (echo "Tip: many lint errors can be automatically fixed with \"make lint-fix\""; exit 1)
129-
130-
.PHONY: lint-fix
131-
lint-fix: $(GOLANGCI_LINT)
132-
gofmt -w .
133-
$(GOLANGCI_LINT) run --fix
134-
119+
lint:
120+
go vet ./...
135121

136122
################################################################################
137123
# Release

changelog/unreleased/cephmount.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Enhancement: add new storage driver cephmount
2+
3+
The cephmount driver is now available.
4+
5+
https://github.com/cs3org/reva/pull/5273

docker/Dockerfile.reva

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# granted to it by virtue of its status as an Intergovernmental Organization
1717
# or submit itself to any jurisdiction.
1818

19-
FROM golang:1.24-alpine3.21 as builder
19+
FROM golang:1.25.1-alpine as builder
2020

2121
RUN apk --no-cache add \
2222
ca-certificates \

docker/Dockerfile.revad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# granted to it by virtue of its status as an Intergovernmental Organization
1717
# or submit itself to any jurisdiction.
1818

19-
FROM golang:1.24-alpine3.21 as builder
19+
FROM golang:1.25.1-alpine as builder
2020

2121
WORKDIR /home/reva
2222
COPY . .

docker/Dockerfile.revad-ceph

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ RUN dnf update --nobest -y && dnf install -y \
3030
librbd-devel \
3131
librados-devel
3232

33-
ADD https://go.dev/dl/go1.24.2.linux-amd64.tar.gz \
34-
go1.24.2.linux-amd64.tar.gz
33+
ADD https://go.dev/dl/go1.25.1.linux-amd64.tar.gz \
34+
go1.25.1.linux-amd64.tar.gz
3535

3636
RUN rm -rf /usr/local/go && \
37-
tar -C /usr/local -xzf go1.24.2.linux-amd64.tar.gz && \
38-
rm go1.24.2.linux-amd64.tar.gz
37+
tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz && \
38+
rm go1.25.1.linux-amd64.tar.gz
3939

4040
ENV PATH /go/bin:/usr/local/go/bin:$PATH
4141
ENV GOPATH /go

docker/Dockerfile.revad-eos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# granted to it by virtue of its status as an Intergovernmental Organization
1717
# or submit itself to any jurisdiction.
1818

19-
FROM golang:1.24-alpine3.21 as builder
19+
FROM golang:1.25.1-alpine as builder
2020

2121
WORKDIR /home/reva
2222
COPY . .

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ require (
4343
github.com/onsi/gomega v1.38.0
4444
github.com/owncloud/libre-graph-api-go v1.0.5-0.20250217093259-fa3804be6c27
4545
github.com/pkg/errors v0.9.1
46+
github.com/pkg/xattr v0.4.12
4647
github.com/prometheus/client_golang v1.23.2
4748
github.com/rs/cors v1.11.1
4849
github.com/rs/zerolog v1.34.0
@@ -143,9 +144,7 @@ require (
143144
gopkg.in/yaml.v3 v3.0.1 // indirect
144145
)
145146

146-
go 1.24.0
147-
148-
toolchain go1.24.2
147+
go 1.25
149148

150149
replace (
151150
github.com/eventials/go-tus => github.com/andrewmostello/go-tus v0.0.0-20200314041820-904a9904af9a

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ
14381438
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
14391439
github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw=
14401440
github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
1441+
github.com/pkg/xattr v0.4.12 h1:rRTkSyFNTRElv6pkA3zpjHpQ90p/OdHQC1GmGh1aTjM=
1442+
github.com/pkg/xattr v0.4.12/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU=
14411443
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
14421444
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
14431445
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
@@ -1924,6 +1926,7 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
19241926
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19251927
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19261928
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1929+
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19271930
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19281931
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19291932
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

internal/grpc/services/gateway/authprovider.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/cs3org/reva/v3/pkg/sharedconf"
3636
"github.com/pkg/errors"
3737
"google.golang.org/grpc/metadata"
38+
"google.golang.org/protobuf/proto"
3839
)
3940

4041
func (s *svc) Authenticate(ctx context.Context, req *gateway.AuthenticateRequest) (*gateway.AuthenticateResponse, error) {
@@ -92,7 +93,7 @@ func (s *svc) Authenticate(ctx context.Context, req *gateway.AuthenticateRequest
9293
}, nil
9394
}
9495

95-
u := *res.User
96+
u := proto.Clone(res.User).(*userpb.User)
9697
if sharedconf.SkipUserGroupsInToken() {
9798
u.Groups = []string{}
9899
}
@@ -102,7 +103,7 @@ func (s *svc) Authenticate(ctx context.Context, req *gateway.AuthenticateRequest
102103
// the resources referenced by these. Since the current scope can do that,
103104
// mint a temporary token based on that and expand the scope. Then set the
104105
// token obtained from the updated scope in the context.
105-
token, err := s.tokenmgr.MintToken(ctx, &u, res.TokenScope)
106+
token, err := s.tokenmgr.MintToken(ctx, u, res.TokenScope)
106107
if err != nil {
107108
err = errors.Wrap(err, "authsvc: error in MintToken")
108109
res := &gateway.AuthenticateResponse{
@@ -127,7 +128,7 @@ func (s *svc) Authenticate(ctx context.Context, req *gateway.AuthenticateRequest
127128
*/
128129
scope := res.TokenScope
129130

130-
token, err = s.tokenmgr.MintToken(ctx, &u, scope)
131+
token, err = s.tokenmgr.MintToken(ctx, u, scope)
131132
if err != nil {
132133
err = errors.Wrap(err, "authsvc: error in MintToken")
133134
res := &gateway.AuthenticateResponse{

0 commit comments

Comments
 (0)