From 3a03efe557337230e5fe4f2743b51245017e4105 Mon Sep 17 00:00:00 2001 From: Illyoung Choi Date: Fri, 9 Dec 2022 16:44:34 -0700 Subject: [PATCH] Update irodsfs and irodsfs-pool, update configuration --- Makefile | 16 ++--------- deploy/image/README.md | 7 ++--- .../image/irods_csi_driver_image.dockerfile | 17 +++++++++--- .../irods_csi_driver_pool_build.dockerfile | 21 --------------- .../irods_csi_driver_pool_image.dockerfile | 16 ++++++----- deploy/image/irods_fuse_build.dockerfile | 21 --------------- deploy/kubernetes/base/node.yaml | 5 ++-- .../overlays/stable/kustomization.yaml | 4 +-- helm/Chart.yaml | 4 +-- helm/README.md | 2 +- helm/templates/node.yaml | 3 +++ helm/user_values.yaml | 2 -- helm/values.yaml | 6 ++--- pkg/client/irods/irodsfs_config.go | 27 ++++++++++++------- 14 files changed, 59 insertions(+), 92 deletions(-) delete mode 100644 deploy/image/irods_csi_driver_pool_build.dockerfile delete mode 100644 deploy/image/irods_fuse_build.dockerfile diff --git a/Makefile b/Makefile index e1ab051..68695c4 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,11 @@ PKG=github.com/cyverse/irods-csi-driver CSI_DRIVER_BUILD_IMAGE=irods_csi_driver_build CSI_DRIVER_BUILD_DOCKERFILE=deploy/image/irods_csi_driver_build.dockerfile -FUSE_CLIENT_BUILD_IMAGE=irods_fuse_client_build -FUSE_CLIENT_BUILD_DOCKERFILE=deploy/image/irods_fuse_build.dockerfile -CSI_DRIVER_POOL_BUILD_IMAGE=irods_csi_driver_pool_build -CSI_DRIVER_POOL_BUILD_DOCKERFILE=deploy/image/irods_csi_driver_pool_build.dockerfile CSI_DRIVER_IMAGE?=cyverse/irods-csi-driver CSI_DRIVER_DOCKERFILE=deploy/image/irods_csi_driver_image.dockerfile CSI_DRIVER_POOL_IMAGE?=cyverse/irods-csi-driver-pool CSI_DRIVER_POOL_DOCKERFILE=deploy/image/irods_csi_driver_pool_image.dockerfile -VERSION=v0.8.7 +VERSION=v0.9.0 GIT_COMMIT?=$(shell git rev-parse HEAD) BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") LDFLAGS?="-X ${PKG}/pkg/common.driverVersion=${VERSION} -X ${PKG}/pkg/common.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/common.buildDate=${BUILD_DATE}" @@ -24,20 +20,12 @@ irods-csi-driver: mkdir -p bin CGO_ENABLED=0 GOOS=linux go build -ldflags ${LDFLAGS} -o bin/irods-csi-driver ./cmd/ -.PHONY: fuse_build -fuse_build: - docker build -t $(FUSE_CLIENT_BUILD_IMAGE):latest -f $(FUSE_CLIENT_BUILD_DOCKERFILE) . - -.PHONY: driver_pool_build -driver_pool_build: - docker build -t $(CSI_DRIVER_POOL_BUILD_IMAGE):latest -f $(CSI_DRIVER_POOL_BUILD_DOCKERFILE) . - .PHONY: driver_build driver_build: docker build -t $(CSI_DRIVER_BUILD_IMAGE):latest -f $(CSI_DRIVER_BUILD_DOCKERFILE) . .PHONY: image -image: fuse_build driver_pool_build driver_build +image: driver_build docker build -t $(CSI_DRIVER_POOL_IMAGE):latest -f $(CSI_DRIVER_POOL_DOCKERFILE) . docker build -t $(CSI_DRIVER_IMAGE):latest -f $(CSI_DRIVER_DOCKERFILE) . diff --git a/deploy/image/README.md b/deploy/image/README.md index a8432dd..fac7eb5 100644 --- a/deploy/image/README.md +++ b/deploy/image/README.md @@ -2,9 +2,6 @@ Dockerfiles in this directory is used to build the driver or packaging the driver for release. -- **irods_fuse_build.dockerfile** : Build iRODS FUSE Client -- **irods_fuse_pool_server_build.dockerfile** : Build iRODS FUSE Pool Server -- **irods_csi_driver_pool_build.dockerfile** : Build iRODS FUSE Pool Server for CSI Driver - **irods_csi_driver_build.dockerfile** : Build iRODS CSI Driver -- **irods_csi_driver_pool_image.dockerfile** : iRODS FUSE Pool Server Release package (includes iRODS FUSE Pool Server) -- **irods_csi_driver_image.dockerfile** : iRODS CSI Driver Release package (includes CSI Driver code, iRODS-FUSE, NFS Client and Webdav Client (Davfs2)) +- **irods_csi_driver_pool_image.dockerfile** : iRODS FUSE Pool Server +- **irods_csi_driver_image.dockerfile** : iRODS CSI Driver Release (includes CSI Driver code, iRODS-FUSE, NFS Client and Webdav Client (Davfs2)) diff --git a/deploy/image/irods_csi_driver_image.dockerfile b/deploy/image/irods_csi_driver_image.dockerfile index 0895248..676c033 100644 --- a/deploy/image/irods_csi_driver_image.dockerfile +++ b/deploy/image/irods_csi_driver_image.dockerfile @@ -19,11 +19,23 @@ ARG DEBIAN_FRONTEND=noninteractive # Setup Utility Packages RUN apt-get update && \ - apt-get install -y wget fuse apt-transport-https lsb-release gnupg + apt-get install -y wget curl fuse apt-transport-https lsb-release gnupg # Setup NFS Client and WebDAV Client RUN apt-get install -y nfs-common davfs2 +### Install irodsfs +RUN mkdir -p /tmp/irodsfs && \ + mkdir -p /var/lib/irodsfs +RUN curl -L https://github.com/cyverse/irodsfs/releases/download/v0.8.2/irodsfs-v0.8.2-linux-amd64.tar.gz --output /tmp/irodsfs/irodsfs.tar.gz +RUN tar zxvf /tmp/irodsfs/irodsfs.tar.gz -C /tmp/irodsfs && \ + cp /tmp/irodsfs/irodsfs /usr/bin && \ + rm -rf /tmp/irodsfs + +ADD https://raw.githubusercontent.com/cyverse/irodsfs/v0.8.2/mount_exec/mount.irodsfs \ + /sbin/mount.irodsfs +RUN chmod +x /sbin/mount.irodsfs + ### Install dumb-init ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 \ /usr/bin/dumb-init @@ -33,8 +45,5 @@ WORKDIR /opt/ # Setup CSI Driver COPY --from=irods_csi_driver_build:latest ${CSI_DRIVER_SRC_DIR}/bin/irods-csi-driver /usr/bin/irods-csi-driver -# Setup iRODS FUSE Lite -COPY --from=irods_fuse_client_build:latest ${IRODS_FUSE_DIR}/mount_exec/mount.irodsfs /sbin/mount.irodsfs -COPY --from=irods_fuse_client_build:latest ${IRODS_FUSE_DIR}/bin/irodsfs /usr/bin/irodsfs ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/bin/irods-csi-driver"] \ No newline at end of file diff --git a/deploy/image/irods_csi_driver_pool_build.dockerfile b/deploy/image/irods_csi_driver_pool_build.dockerfile deleted file mode 100644 index 6b28bc7..0000000 --- a/deploy/image/irods_csi_driver_pool_build.dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# iRODSFS-Pool-Server-Build -# -# VERSION 1.0 - - -############################################## -# Build irodsfs-pool -############################################## -FROM golang:1.18.3-stretch -LABEL maintainer="Illyoung Choi " -LABEL version="0.1" -LABEL description="iRODS FUSE Lite Pool Server Build Image" - -# Download github.com/cyverse/irodsfs-pool -WORKDIR /opt/ -RUN git clone https://github.com/cyverse/irodsfs-pool.git -WORKDIR /opt/irodsfs-pool -RUN git checkout tags/v0.5.15 - -# Build -RUN make build \ No newline at end of file diff --git a/deploy/image/irods_csi_driver_pool_image.dockerfile b/deploy/image/irods_csi_driver_pool_image.dockerfile index fe99ebd..0e6d2e2 100644 --- a/deploy/image/irods_csi_driver_pool_image.dockerfile +++ b/deploy/image/irods_csi_driver_pool_image.dockerfile @@ -11,12 +11,19 @@ LABEL maintainer="Illyoung Choi " LABEL version="0.1" LABEL description="iRODS CSI Driver Pool Image" -ARG IRODS_FUSE_POOL_SERVER_DIR="/opt/irodsfs-pool" ARG DEBIAN_FRONTEND=noninteractive # Setup Utility Packages RUN apt-get update && \ - apt-get install -y wget apt-transport-https lsb-release gnupg + apt-get install -y wget curl apt-transport-https lsb-release gnupg + +### Install irodsfs-pool +RUN mkdir -p /tmp/irodsfs-pool && \ + mkdir -p /var/lib/irodsfs-pool +RUN curl -L https://github.com/cyverse/irodsfs-pool/releases/download/v0.6.3/irodsfs-pool-v0.6.3-linux-amd64.tar.gz --output /tmp/irodsfs-pool/irodsfs-pool.tar.gz +RUN tar zxvf /tmp/irodsfs-pool/irodsfs-pool.tar.gz -C /tmp/irodsfs-pool && \ + cp /tmp/irodsfs-pool/irodsfs-pool /usr/bin && \ + rm -rf /tmp/irodsfs-pool ### Install dumb-init ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 \ @@ -25,7 +32,4 @@ RUN chmod +x /usr/bin/dumb-init WORKDIR /opt/ -# Setup iRODS FUSE Lite Pool Server -COPY --from=irods_csi_driver_pool_build:latest ${IRODS_FUSE_POOL_SERVER_DIR}/bin/irodsfs-pool /usr/bin/irodsfs-pool - -ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/bin/irodsfs-pool", "-f"] \ No newline at end of file +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/bin/irodsfs-pool", "-f", "--data_root", "/var/lib/irodsfs-pool"] \ No newline at end of file diff --git a/deploy/image/irods_fuse_build.dockerfile b/deploy/image/irods_fuse_build.dockerfile deleted file mode 100644 index 887d903..0000000 --- a/deploy/image/irods_fuse_build.dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# iRODSFS-Build -# -# VERSION 1.0 - - -############################################## -# Build irodsfs -############################################## -FROM golang:1.18.3-stretch -LABEL maintainer="Illyoung Choi " -LABEL version="0.1" -LABEL description="iRODS FUSE Lite Build Image" - -# Download github.com/cyverse/irodsfs -WORKDIR /opt/ -RUN git clone https://github.com/cyverse/irodsfs.git -WORKDIR /opt/irodsfs -RUN git checkout tags/v0.7.8 - -# Build -RUN make build \ No newline at end of file diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index 0473e75..df20006 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -81,13 +81,14 @@ spec: image: cyverse/irods-csi-driver-pool:latest args: - --cache_size_max=$(CACHE_SIZE_MAX) - - --cache_root=/irodsfs_pool_cache - - --temp_root=/tmp/irodsfs_pool_temp + - --data_root=$(IRODSFS_POOL_DATA) - --endpoint=$(IRODSFS_POOL_ENDPOINT) - --prometheus_exporter_port=$(PROMETHEUS_EXPORTER_PORT) env: - name: CACHE_SIZE_MAX value: "21474836480" + - name: IRODSFS_POOL_DATA + value: /irodsfs_pool_data - name: IRODSFS_POOL_ENDPOINT value: unix:///csi/pool.sock - name: PROMETHEUS_EXPORTER_PORT diff --git a/deploy/kubernetes/overlays/stable/kustomization.yaml b/deploy/kubernetes/overlays/stable/kustomization.yaml index 2c2a2df..3e1645c 100644 --- a/deploy/kubernetes/overlays/stable/kustomization.yaml +++ b/deploy/kubernetes/overlays/stable/kustomization.yaml @@ -4,9 +4,9 @@ bases: - ../../base images: - name: cyverse/irods-csi-driver - newTag: v0.8.7 + newTag: v0.9.0 - name: cyverse/irods-csi-driver-pool - newTag: v0.8.7 + newTag: v0.9.0 - name: quay.io/k8scsi/csi-provisioner newTag: v1.6.0 - name: quay.io/k8scsi/livenessprobe diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 528b3c9..bbe5b9b 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: "0.8.7" +appVersion: "0.9.0" name: irods-csi-driver description: A Helm chart for iRODS CSI Driver -version: 0.8.7 +version: 0.9.0 kubeVersion: ">=1.14.0-0" home: https://github.com/cyverse/irods-csi-driver sources: diff --git a/helm/README.md b/helm/README.md index 43228c3..7fbd38a 100644 --- a/helm/README.md +++ b/helm/README.md @@ -38,7 +38,7 @@ helm install irods-csi-driver -f user_values.yaml --namespace kube-system . ```shell script helm upgrade irods-csi-driver \ --install . \ - --version 0.8.7 \ + --version 0.9.0 \ --namespace kube-system \ -f values.yaml ``` diff --git a/helm/templates/node.yaml b/helm/templates/node.yaml index 5f1b148..bad724b 100644 --- a/helm/templates/node.yaml +++ b/helm/templates/node.yaml @@ -85,10 +85,13 @@ spec: image: "{{ .Values.nodeService.irodsPool.image.repository }}:{{ .Values.nodeService.irodsPool.image.tag }}" imagePullPolicy: {{ .Values.nodeService.irodsPool.image.pullPolicy }} args: + - --data_root=$(IRODSFS_POOL_DATA) - --endpoint=$(IRODSFS_POOL_ENDPOINT) - --prometheus_exporter_port=$(PROMETHEUS_EXPORTER_PORT) {{- toYaml .Values.nodeService.irodsPool.extraArgs | nindent 12 }} env: + - name: IRODSFS_POOL_DATA + value: /irodsfs_pool_data - name: IRODSFS_POOL_ENDPOINT value: unix:///csi/pool.sock - name: PROMETHEUS_EXPORTER_PORT diff --git a/helm/user_values.yaml b/helm/user_values.yaml index 45c55f3..e1670d0 100644 --- a/helm/user_values.yaml +++ b/helm/user_values.yaml @@ -15,6 +15,4 @@ nodeService: irodsPool: extraArgs: - --cache_size_max=107374182400 - - --cache_root=/irodsfs_pool_cache - - --temp_root=/tmp/irodsfs_pool_temp - '--cache_timeout_settings=[{"path":"/","timeout":"-1ns","inherit":false},{"path":"/iplant","timeout":"-1ns","inherit":false},{"path":"/iplant/home","timeout":"1h","inherit":false},{"path":"/iplant/home/shared","timeout":"1h","inherit":true}]' diff --git a/helm/values.yaml b/helm/values.yaml index 26d8457..f7c05e6 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -13,7 +13,7 @@ controllerService: irodsPlugin: image: repository: cyverse/irods-csi-driver - tag: v0.8.7 + tag: v0.9.0 pullPolicy: Always extraArgs: @@ -53,7 +53,7 @@ nodeService: irodsPlugin: image: repository: cyverse/irods-csi-driver - tag: v0.8.7 + tag: v0.9.0 pullPolicy: Always extraArgs: @@ -68,7 +68,7 @@ nodeService: irodsPool: image: repository: cyverse/irods-csi-driver-pool - tag: v0.8.7 + tag: v0.9.0 pullPolicy: Always extraArgs: diff --git a/pkg/client/irods/irodsfs_config.go b/pkg/client/irods/irodsfs_config.go index ed518a4..a049544 100644 --- a/pkg/client/irods/irodsfs_config.go +++ b/pkg/client/irods/irodsfs_config.go @@ -40,20 +40,20 @@ type IRODSFSConfig struct { GID int `yaml:"gid"` SystemUser string `yaml:"system_user"` - TempRootPath string `yaml:"temp_root_path,omitempty"` + DataRootPath string `yaml:"data_root_path,omitempty"` - PoolEndpoint string `yaml:"pool_endpoint,omitempty"` + LogPath string `yaml:"log_path,omitempty"` - ReadAheadMax int `yaml:"read_ahead_max"` - OperationTimeout time.Duration `yaml:"operation_timeout"` + PoolEndpoint string `yaml:"pool_endpoint,omitempty"` + ReadAheadMax int `yaml:"read_ahead_max"` + OperationTimeout time.Duration `yaml:"operation_timeout"` ConnectionLifespan time.Duration `yaml:"connection_lifespan"` ConnectionIdleTimeout time.Duration `yaml:"connection_idle_timeout"` ConnectionMax int `yaml:"connection_max"` MetadataCacheTimeout time.Duration `yaml:"metadata_cache_timeout"` MetadataCacheCleanupTime time.Duration `yaml:"metadata_cache_cleanup_time"` - LogPath string `yaml:"log_path,omitempty"` MonitorURL string `yaml:"monitor_url,omitempty"` Profile bool `yaml:"profile,omitempty"` @@ -65,14 +65,22 @@ type IRODSFSConfig struct { // NewDefaultIRODSFSConfig creates default IRODSFSConfig func NewDefaultIRODSFSConfig() *IRODSFSConfig { return &IRODSFSConfig{ + Host: "", Port: PortDefault, + ProxyUser: "", + ClientUser: "", + Zone: "", + Password: "", + Resource: "", PathMappings: []IRODSFSPathMapping{}, NoPermissionCheck: false, UID: -1, GID: -1, SystemUser: "", - TempRootPath: "", + DataRootPath: "/var/lib/irodsfs", + + LogPath: "", // use default PoolEndpoint: "", @@ -84,10 +92,11 @@ func NewDefaultIRODSFSConfig() *IRODSFSConfig { MetadataCacheTimeout: MetadataCacheTimeoutDefault, MetadataCacheCleanupTime: MetadataCacheCleanupTimeDefault, - LogPath: "", - MonitorURL: "", + MonitorURL: "", + Profile: false, ProfileServicePort: 0, - AllowOther: true, + + AllowOther: true, } }