diff --git a/cmd/sidecar_mounter/gcsfuse_binary b/cmd/sidecar_mounter/gcsfuse_binary index 8ed4f6145..a4acf8674 100644 --- a/cmd/sidecar_mounter/gcsfuse_binary +++ b/cmd/sidecar_mounter/gcsfuse_binary @@ -1 +1 @@ -gs://gke-release-staging/gcsfuse/v2.0.0_beta.0-gke.0/gcsfuse_bin \ No newline at end of file +gs://gke-release-staging/gcsfuse/v2.0.0_beta.1-gke.0/gcsfuse_bin \ No newline at end of file diff --git a/examples/dlio/unet3d-loading-test/templates/dlio-tester.yaml b/examples/dlio/unet3d-loading-test/templates/dlio-tester.yaml index fc922605c..2d833d696 100644 --- a/examples/dlio/unet3d-loading-test/templates/dlio-tester.yaml +++ b/examples/dlio/unet3d-loading-test/templates/dlio-tester.yaml @@ -92,7 +92,7 @@ spec: driver: gcsfuse.csi.storage.gke.io volumeAttributes: bucketName: {{ .Values.bucketName }} - mountOptions: implicit-dirs,stat-cache-ttl={{ .Values.gcsfuse.statCacheTtl }},type-cache-ttl={{ .Values.gcsfuse.typeCacheTtl }},stat-cache-capacity={{ .Values.gcsfuse.statCacheCapacity }},file-cache:max-size-in-mb:{{ .Values.gcsfuse.fileCacheMaxSizeInMb }},file-cache:cache-file-for-range-read:{{ .Values.gcsfuse.fileCacheForRangeRead }} + mountOptions: implicit-dirs,stat-cache-ttl={{ .Values.gcsfuse.statCacheTtl }},type-cache-ttl={{ .Values.gcsfuse.typeCacheTtl }},stat-cache-capacity={{ .Values.gcsfuse.statCacheCapacity }},file-cache:max-size-mb:{{ .Values.gcsfuse.fileCacheMaxSizeInMb }},file-cache:cache-file-for-range-read:{{ .Values.gcsfuse.fileCacheForRangeRead }} {{- else }} csi: driver: gcsfuse.csi.storage.gke.io diff --git a/examples/fio/loading-test/templates/fio-tester.yaml b/examples/fio/loading-test/templates/fio-tester.yaml index dda147413..95411f55d 100644 --- a/examples/fio/loading-test/templates/fio-tester.yaml +++ b/examples/fio/loading-test/templates/fio-tester.yaml @@ -158,7 +158,7 @@ spec: driver: gcsfuse.csi.storage.gke.io volumeAttributes: bucketName: {{ .Values.bucketName }} - mountOptions: implicit-dirs,{{- if and (ne .Values.fio.fileSize "100M") (ne .Values.fio.fileSize "200G") }}only-dir={{ .Values.fio.fileSize }},{{- end }}stat-cache-capacity={{ .Values.gcsfuse.statCacheCapacity }},metadata-cache:ttl-secs:{{ .Values.gcsfuse.metadataCacheTtlSecs }},file-cache:max-size-in-mb:{{ .Values.gcsfuse.fileCacheMaxSizeInMb }},file-cache:cache-file-for-range-read:{{ .Values.gcsfuse.fileCacheForRangeRead }} + mountOptions: implicit-dirs,{{- if and (ne .Values.fio.fileSize "100M") (ne .Values.fio.fileSize "200G") }}only-dir={{ .Values.fio.fileSize }},{{- end }}stat-cache-capacity={{ .Values.gcsfuse.statCacheCapacity }},metadata-cache:ttl-secs:{{ .Values.gcsfuse.metadataCacheTtlSecs }},file-cache:max-size-mb:{{ .Values.gcsfuse.fileCacheMaxSizeInMb }},file-cache:cache-file-for-range-read:{{ .Values.gcsfuse.fileCacheForRangeRead }} {{- else }} csi: driver: gcsfuse.csi.storage.gke.io diff --git a/examples/jupyter/jupyter-experimental-readcache.yaml b/examples/jupyter/jupyter-experimental-readcache.yaml deleted file mode 100644 index 00354c7d4..000000000 --- a/examples/jupyter/jupyter-experimental-readcache.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# 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 -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Tensorflow/Jupyter StatefulSet -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: tensorflow - namespace: example -spec: - selector: - matchLabels: - pod: tensorflow-pod - serviceName: tensorflow - replicas: 1 - template: - metadata: - annotations: - gke-gcsfuse/volumes: "true" - gke-gcsfuse/cpu-limit: 500m - gke-gcsfuse/memory-limit: 10Gi - gke-gcsfuse/ephemeral-storage-limit: 30Gi - labels: - pod: tensorflow-pod - spec: - serviceAccountName: gcsfuse-ksa - nodeSelector: - cloud.google.com/gke-accelerator: nvidia-tesla-t4 - cloud.google.com/gke-ephemeral-storage-local-ssd: "true" - terminationGracePeriodSeconds: 30 - containers: - - name: tensorflow-container - securityContext: - privileged: true - image: tensorflow/tensorflow:2.13.0-gpu-jupyter - volumeMounts: - - name: tensorflow-pvc - mountPath: /tf/saved - resources: - limits: - nvidia.com/gpu: "1" - ephemeral-storage: 30Gi - memory: 10Gi - requests: - nvidia.com/gpu: "1" - ephemeral-storage: 30Gi - memory: 10Gi - env: - - name: JUPYTER_TOKEN - value: "jupyter" - volumes: - - name: tensorflow-pvc - csi: - driver: gcsfuse.csi.storage.gke.io - volumeAttributes: - bucketName: # unique bucket name - # update your experimental cache file options according to flags - # from - # https://github.com/GoogleCloudPlatform/gcsfuse/blob/19ed094b6612789b09ad4a1df3a2314099c65129/flags.go#L233C1-L236 - mountOptions: "experimental-local-file-cache,stat-cache-ttl=240m0s,type-cache-ttl=240m0s,stat-cache-capacity=5000000000" - ---- -# Headless service for the above StatefulSet -apiVersion: v1 -kind: Service -metadata: - name: tensorflow - namespace: example -spec: - ports: - - port: 8888 - clusterIP: None - selector: - pod: tensorflow-pod ---- -# External service -apiVersion: "v1" -kind: "Service" -metadata: - name: tensorflow-jupyter - namespace: example -spec: - ports: - - protocol: "TCP" - port: 80 - targetPort: 8888 - selector: - pod: tensorflow-pod - type: LoadBalancer diff --git a/pkg/sidecar_mounter/sidecar_mounter.go b/pkg/sidecar_mounter/sidecar_mounter.go index 55107db6e..8eb1e7270 100644 --- a/pkg/sidecar_mounter/sidecar_mounter.go +++ b/pkg/sidecar_mounter/sidecar_mounter.go @@ -127,13 +127,12 @@ var disallowedFlags = map[string]bool{ "logging:log-rotate:max-file-size-mb": true, "logging:log-rotate:backup-file-count": true, "logging:log-rotate:compress": true, - "cache-location": true, + "cache-dir": true, + "experimental-local-file-cache": true, } -// TODO: move experimental-local-file-cache flag to disallowedFlags when the file cache feature is ready. var boolFlags = map[string]bool{ "implicit-dirs": true, - "experimental-local-file-cache": true, "enable-nonexistent-type-cache": true, "debug_fuse_errors": true, "debug_fuse": true, @@ -201,7 +200,7 @@ func (mc *MountConfig) prepareMountArgs() (map[string]string, map[string]string) configFileFlagMap := map[string]string{ "logging:file-path": "/dev/fd/1", // redirect the output to cmd stdout "logging:format": "text", - "cache-location": mc.CacheDir, + "cache-dir": mc.CacheDir, } invalidArgs := []string{} diff --git a/pkg/sidecar_mounter/sidecar_mounter_test.go b/pkg/sidecar_mounter/sidecar_mounter_test.go index 0777eb7d0..152fe0a7b 100644 --- a/pkg/sidecar_mounter/sidecar_mounter_test.go +++ b/pkg/sidecar_mounter/sidecar_mounter_test.go @@ -38,23 +38,26 @@ var ( defaultConfigFileFlagMap = map[string]string{ "logging:file-path": "/dev/fd/1", "logging:format": "text", - "cache-location": "test-cache-dir", + "cache-dir": "test-cache-dir", } invalidArgs = []string{ "temp-dir", + "config-file", "foreground", "log-file", "log-format", + "key-file", + "token-url", + "reuse-token-from-url", + "o", "logging:file-path:test", "logging:format:test", "logging:log-rotate:max-file-size-mb:test", "logging:log-rotate:backup-file-count:test", "logging:log-rotate:compress:test", - "key-file", - "token-url", - "reuse-token-from-url", - "o", + "cache-dir", + "experimental-local-file-cache", } ) @@ -103,7 +106,7 @@ func TestPrepareMountArgs(t *testing.T) { "logging:format": "text", "logging:severity": "error", "write:create-empty-file": "true", - "cache-location": "test-cache-dir", + "cache-dir": "test-cache-dir", }, }, { @@ -191,13 +194,15 @@ func TestPrepareConfigFile(t *testing.T) { ConfigFile: "./test-config-file.yaml", }, configMapArgs: map[string]string{ - "logging:file-path": "/dev/fd/1", - "logging:format": "text", - "logging:severity": "error", - "write:create-empty-file": "true", - "file-cache:max-size-in-mb": "10000", - "file-cache:cache-file-for-range-read": "true", - "cache-location": "/gcsfuse-cache/.volumes/volume-name", + "logging:file-path": "/dev/fd/1", + "logging:format": "text", + "logging:severity": "error", + "write:create-empty-file": "true", + "file-cache:max-size-mb": "10000", + "file-cache:cache-file-for-range-read": "true", + "metadata-cache:stat-cache-max-size-mb": "1000", + "metadata-cache:type-cache-max-size-mb": "-1", + "cache-dir": "/gcsfuse-cache/.volumes/volume-name", }, expectedConfig: map[string]interface{}{ "logging": map[string]interface{}{ @@ -209,10 +214,14 @@ func TestPrepareConfigFile(t *testing.T) { "create-empty-file": true, }, "file-cache": map[string]interface{}{ - "max-size-in-mb": 10000, + "max-size-mb": 10000, "cache-file-for-range-read": true, }, - "cache-location": "/gcsfuse-cache/.volumes/volume-name", + "metadata-cache": map[string]interface{}{ + "stat-cache-max-size-mb": 1000, + "type-cache-max-size-mb": -1, + }, + "cache-dir": "/gcsfuse-cache/.volumes/volume-name", }, }, {