Commit 1f29b294 authored by Vitaliy Filippov's avatar Vitaliy Filippov
Browse files

Remove s3backer mounter as it's mostly unusable

parent f723bcca
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -18,21 +18,17 @@ REGISTRY_NAME=ctrox
IMAGE_NAME=csi-s3
VERSION ?= dev
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION)
FULL_IMAGE_TAG=$(IMAGE_TAG)-full
TEST_IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):test

build:
	CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o _output/s3driver ./cmd/s3driver
test:
	docker build -t $(FULL_IMAGE_TAG) -f cmd/s3driver/Dockerfile.full .
	docker build -t $(TEST_IMAGE_TAG) -f test/Dockerfile .
	docker run --rm --privileged -v $(PWD):$(PROJECT_DIR) --device /dev/fuse $(TEST_IMAGE_TAG)
container:
	docker build -t $(IMAGE_TAG) -f cmd/s3driver/Dockerfile .
	docker build -t $(FULL_IMAGE_TAG) -f cmd/s3driver/Dockerfile.full .
push: container
	docker push $(IMAGE_TAG)
	docker push $(FULL_IMAGE_TAG)
clean:
	go clean -r -x
	-rm -rf _output
+0 −13
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ The driver can be configured to use one of these mounters to mount buckets:
* [geesefs](https://github.com/yandex-cloud/geesefs) (recommended and default)
* [s3fs](https://github.com/s3fs-fuse/s3fs-fuse)
* [rclone](https://rclone.org/commands/rclone_mount)
* [s3backer](https://github.com/archiecobbs/s3backer)

The mounter can be set as a parameter in the storage class. You can also create multiple storage classes for each mounter if you like.

@@ -138,18 +137,6 @@ Characteristics of different mounters (for more detailed information consult the
* Files can be viewed normally with any S3 client
* Doesn't create directory objects like s3fs or GeeseFS

#### s3backer (experimental*)

* Represents a block device stored on S3
* Allows to use a real filesystem
* Files are not readable with other S3 clients
* Support appends
* Supports compression before upload (Not yet implemented in this driver)
* Supports encryption before upload (Not yet implemented in this driver)

*s3backer is experimental at this point because volume corruption can occur pretty quickly in case of an unexpected shutdown of a Kubernetes node or CSI pod.
The s3backer binary is not bundled with the normal docker image to keep that as small as possible. Use the `<version>-full` image tag for testing s3backer.

## Troubleshooting

### Issues while creating PVC

cmd/s3driver/Dockerfile.full

deleted100644 → 0
+0 −56
Original line number Diff line number Diff line
FROM golang:1.16-alpine as gobuild

WORKDIR /build
ADD . /build

RUN go get -d -v ./...
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver

FROM debian:buster-slim as s3backer
ARG S3BACKER_VERSION=1.5.0

RUN apt-get update && apt-get install -y \
  build-essential \
  autoconf \
  libcurl4-openssl-dev \
  libfuse-dev \
  libexpat1-dev \
  libssl-dev \
  zlib1g-dev \
  psmisc \
  pkg-config \
  git && \
  rm -rf /var/lib/apt/lists/*

# Compile & install s3backer
RUN git clone https://github.com/archiecobbs/s3backer.git /src/s3backer
WORKDIR /src/s3backer
RUN git checkout tags/${S3BACKER_VERSION}

RUN ./autogen.sh && \
  ./configure && \
  make && \
  make install

FROM debian:buster-slim
LABEL maintainers="Cyrill Troxler <cyrilltroxler@gmail.com>"
LABEL description="csi-s3 image"
COPY --from=s3backer /usr/bin/s3backer /usr/bin/s3backer

# s3fs and some other dependencies
RUN apt-get update && \
  apt-get install -y \
  libfuse2 gcc sqlite3 libsqlite3-dev \
  s3fs psmisc procps libcurl4 xfsprogs curl unzip && \
  rm -rf /var/lib/apt/lists/*

# install rclone
ARG RCLONE_VERSION=v1.54.1
RUN cd /tmp \
  && curl -O https://downloads.rclone.org/${RCLONE_VERSION}/rclone-${RCLONE_VERSION}-linux-amd64.zip \
  && unzip /tmp/rclone-${RCLONE_VERSION}-linux-amd64.zip \
  && mv /tmp/rclone-*-linux-amd64/rclone /usr/bin \
  && rm -r /tmp/rclone*

COPY --from=gobuild /build/s3driver /s3driver
ENTRYPOINT ["/s3driver"]
+0 −30
Original line number Diff line number Diff line
@@ -94,36 +94,6 @@ var _ = Describe("S3Driver", func() {
		})
	})

	Context("s3backer", func() {
		socket := "/tmp/csi-s3backer.sock"
		csiEndpoint := "unix://" + socket

		if err := os.Remove(socket); err != nil && !os.IsNotExist(err) {
			Expect(err).NotTo(HaveOccurred())
		}
		// Clear loop device so we cover the creation of it
		os.Remove(mounter.S3backerLoopDevice)
		driver, err := driver.New("test-node", csiEndpoint)
		if err != nil {
			log.Fatal(err)
		}
		go driver.Run()

		Describe("CSI sanity", func() {
			sanityCfg := &sanity.Config{
				TargetPath:  os.TempDir() + "/s3backer-target",
				StagingPath: os.TempDir() + "/s3backer-staging",
				Address:     csiEndpoint,
				SecretsFile: "../../test/secret.yaml",
				TestVolumeParameters: map[string]string{
					"mounter": "s3backer",
					"bucket":  "testbucket2",
				},
			}
			sanity.GinkgoTest(sanityCfg)
		})
	})

	Context("rclone", func() {
		socket := "/tmp/csi-rclone.sock"
		csiEndpoint := "unix://" + socket
+0 −4
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ type Mounter interface {
const (
	s3fsMounterType     = "s3fs"
	geesefsMounterType  = "geesefs"
	s3backerMounterType = "s3backer"
	rcloneMounterType   = "rclone"
	TypeKey             = "mounter"
	BucketKey           = "bucket"
@@ -49,9 +48,6 @@ func New(meta *s3.FSMeta, cfg *s3.Config) (Mounter, error) {
	case s3fsMounterType:
		return newS3fsMounter(meta, cfg)

	case s3backerMounterType:
		return newS3backerMounter(meta, cfg)

	case rcloneMounterType:
		return newRcloneMounter(meta, cfg)

Loading