File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# limitations under the License.
1616
1717# Description:
18- # bash setup_gcsfuse.sh DATASET_GCS_BUCKET=maxdiffusion-github-runner-test-assets MOUNT_PATH=/tmp/gcsfuse
18+ # DATASET_GCS_BUCKET and MOUNT_PATH are required,FILE_PATH is optional, if provided,
19+ # will use ls -R to improve first-time read performance by prefetching metadata
20+ # https://cloud.google.com/storage/docs/cloud-storage-fuse/performance#improve-first-time-reads
21+ # bash setup_gcsfuse.sh DATASET_GCS_BUCKET=maxdiffusion-github-runner-test-assets MOUNT_PATH=/tmp/gcsfuse FILE_PATH=/tmp/gcsfuse/my_dataset
1922
2023set -e -x
2124
4447mkdir -p $MOUNT_PATH
4548
4649# see https://cloud.google.com/storage/docs/gcsfuse-cli for all configurable options of gcsfuse CLI
47- # Grain uses _PROCESS_MANAGEMENT_MAX_THREADS = 64 (https://github.com/google/grain/blob/main/grain/_src/python/grain_pool.py)
48- # Please make sure max-conns-per-host > grain_worker_count * _PROCESS_MANAGEMENT_MAX_THREADS
49-
50- gcsfuse -o ro --implicit-dirs --http-client-timeout=5s --max-conns-per-host=2000 \
51- --debug_fuse_errors --debug_fuse --debug_gcs --debug_invariants --debug_mutex \
52- --log-file=$HOME /gcsfuse.json " $DATASET_GCS_BUCKET " " $MOUNT_PATH "
50+ TIMESTAMP=$( date +%Y%m%d-%H%M)
51+ gcsfuse -o ro --implicit-dirs --log-severity=debug \
52+ --type-cache-max-size-mb=-1 --stat-cache-max-size-mb=-1 --kernel-list-cache-ttl-secs=-1 --metadata-cache-ttl-secs=-1 \
53+ --log-file=$HOME /gcsfuse_$TIMESTAMP .json " $DATASET_GCS_BUCKET " " $MOUNT_PATH "
54+
55+ if [[ ! -z ${FILE_PATH} ]] ; then
56+ FILE_COUNT=$( ls -R $FILE_PATH | wc -l)
57+ echo $FILE_COUNT files found in $FILE_PATH
58+ fi
You can’t perform that action at this time.
0 commit comments