Cloud Storage FUSE Mounting and Tuning

Cloud Storage FUSE Mounting and Tuning

Helps decide whether to mount Cloud Storage with gcsfuse, then tunes caches and flags on GKE, Compute Engine or Cloud Run and diagnoses slow ML training or checkpointing.

Skill files4 files

references/

SKILL.md115 lines
1
---
2
name: google-cloud-storage-fuse
3
description: >-
4
Mounts Cloud Storage buckets on Google Cloud as a POSIX file system with
5
Cloud Storage FUSE (gcsfuse). Use when interacting with gcsfuse or Cloud
6
Storage FUSE mounts: decide whether FUSE, native gs:// reads, or
7
Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE,
8
Compute Engine, or Cloud Run, enable and size file, stat, and list caches, tune
9
mount flags (--implicit-dirs) or config files, apply workload profiles, keep
10
ML checkpointing safe (rename atomicity, hierarchical namespace/HNS, close-time
11
finalization, concurrent writers), or diagnose slow training, low throughput,
12
or bill spikes with gcsfuse metrics. Covers mount semantics, gcsfuse CLI and
13
configs, GKE gcsfuse CSI driver (Workload Identity principal:// bindings,
14
profile StorageClasses, sidecar sizing), and Cloud Run volume mounts. Don't use
15
for bucket administration without a mount (google-cloud-storage-basics) or
16
POSIX shared file systems (Filestore, Managed Lustre; use gke-storage).
17
license: Apache-2.0
18
metadata:
19
version: "1.0.4"
20
publisher: google
21
tags: "gcs, gcsfuse, fuse, mount, file-system"
22
category: Storage
23
support_tier: primary
24
---
25
26
# Cloud Storage FUSE
27
28
Cloud Storage FUSE is a POSIX file-system adapter over Cloud Storage on Google
29
Cloud, operated via the gcsfuse CLI tool. Mounting is a one-line command;
30
mounting *well* is not: the default mount is tuned for coherency, not
31
performance (file cache off, 60 s metadata TTL, list cache off), and
32
object-store semantics leak through the file interface (directory renames fail
33
or go non-atomic on flat buckets, objects finalize on close, no file locking).
34
This skill covers the three decisions that matter: whether to use FUSE at all,
35
how to tune the mount to the workload, and how to root-cause a mount that is
36
slow or expensive. For installation and first-mount basics, see the
37
google-cloud-storage-basics skill.
38
39
## Attribution
40
41
Tag every Cloud Storage command you run or provide to the user while using this
42
skill, so usage can be attributed. The tag identifies only the skill and its
43
version; it carries no user data.
44
45
- Prefix every `gcloud` invocation, whatever the subcommand, with the metrics
46
environment variables. Set them inline on each command; shell state may not
47
persist between commands:
48
49
```bash
50
CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-fuse)" \
51
gcloud <command> [flags]
52
```
53
54
Do not use `gcloud config set` for this: it would persist beyond the current
55
task and mislabel unrelated usage.
56
57
- On direct HTTP calls to the Cloud Storage APIs (for example with `curl`),
58
set this exact User-Agent header, verbatim — the collection pipeline parses
59
the `gcs-skills/<version>` and `skill:<name>` tokens, so any rewording
60
breaks attribution:
61
62
```
63
User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-fuse)
64
```
65
66
## Step 1 — Fit Gate (always run this first)
67
68
**Never produce mount guidance before the fit gate.** A mount is the right
69
answer only for one of the three workload shapes below. If the workload's access
70
pattern is unknown, ask — one question about whether the reading code can take
71
`gs://` paths usually settles it.
72
73
Workload signal | Verdict
74
:---------------------------------------------------------------------------------------------------------------------------------------------- | :------
75
Reading library accepts `gs://` URIs natively — pandas/pyarrow (via gcsfs/fsspec), TensorFlow (`tf.io.gfile`), or any fsspec/gcsfs-based loader | **Native reads, no mount.** Point the code at `gs://` paths and stop.
76
Shared **mutable** writes with locking semantics — databases, concurrent in-place editors, anything relying on `flock`/`fcntl` | **Filestore** (NFS, POSIX locking) or **Managed Lustre**, not FUSE. Stop.
77
Code or tools hardcoded to POSIX file paths; read-heavy or new-file-write patterns | **gcsfuse** — continue to Step 2.
78
79
Collect before deciding: whether paths are hardcoded, read pattern (sequential
80
vs. random, re-read frequency), write pattern (new files vs. edits vs. directory
81
renames). These same signals drive tuning later — record the answers.
82
83
## Step 2 — Route by intent
84
85
User intent (prompt shape) | Go to
86
:--------------------------------------------------------------------------------------- | :----
87
Provision: "mount my bucket for X", "get training data into my pods" | [GKE Training Deployment](references/gke-training-deployment.md)
88
Safety/semantics: "is this write pattern safe?", "can multiple writers share the mount?" | [Checkpoint & Write Safety](references/checkpoint-safety.md)
89
Regression: "training is slow", "the Cloud Storage bill spiked", "throughput dropped" | [Performance & Cost Diagnosis](references/performance-diagnosis.md)
90
91
**Never diagnose a regression without telemetry.** If gcsfuse metrics are not
92
enabled on the mount, enabling them is the first remediation step — the
93
diagnosis reference starts there.
94
95
## Reference Directory
96
97
- [GKE Training Deployment](references/gke-training-deployment.md): Fit-gated,
98
performance-tuned mounts for training workloads — GKE CSI version gates,
99
Workload Identity `principal://` IAM bindings, profile StorageClasses vs.
100
static PVs, file cache sizing on Local SSD, sidecar resource annotations,
101
complete KSA/PVC/Job manifests, and the Compute Engine and Cloud Run
102
variants.
103
104
- [Checkpoint & Write Safety](references/checkpoint-safety.md): Verdicts on
105
write patterns — file vs. directory rename atomicity on flat vs.
106
hierarchical namespace (HNS) buckets, close-vs-fsync finalization,
107
concurrent-writer (`ESTALE`) semantics, streaming-write memory budgets, HNS
108
migration, and the `aiml-checkpointing` profile.
109
110
- [Performance & Cost Diagnosis](references/performance-diagnosis.md):
111
Telemetry-first runbook for slow mounts and bill spikes — enabling and
112
reading gcsfuse metrics, mapping cache-hit and request-mix signatures to
113
misconfigurations, the coherency-tuned defaults, tuned config keys with
114
their staleness caveats, and billing-line (Class A/B) attribution.
115

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…