Generated banner for Google Cloud Storage Fuse
Generated logo for Google Cloud Storage Fuse

Google Cloud Storage Fuse

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • No issues found

From the author

Mounts Cloud Storage buckets on Google Cloud as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when interacting with gcsfuse or Cloud Storage FUSE mounts: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size file, stat, and list caches, tune mount flags (--implicit-dirs) or config files, apply workload profiles, keep ML checkpointing safe (rename atomicity, hierarchical namespace/HNS, close-time finalization, concurrent writers), or diagnose slow training, low throughput, or bill spikes with gcsfuse metrics. Covers mount semantics, gcsfuse CLI and configs, GKE gcsfuse CSI driver (Workload Identity principal:// bindings, profile StorageClasses, sidecar sizing), and Cloud Run volume mounts. Don't use for bucket administration without a mount (google-cloud-storage-basics) or POSIX shared file systems (Filestore, Managed Lustre; use gke-storage).
— the description by Google

From the skill’s files

Taken from the skill’s own files (its description, section headings and stated usage). Not an AutoGineer summary, and not written by the author as one.

Mounts Cloud Storage buckets on Google Cloud as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when interacting with gcsfuse or Cloud Storage FUSE mounts: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size file, stat, and list caches, tune mount flags (--implicit-dirs) or config files, apply workload profiles, keep ML checkpointing safe (rename atomicity, hierarchical namespace/HNS, close-time finalization, concurrent writers), or diagnose slow training, low throughput, or bill spikes with gcsfuse metrics. Covers mount semantics, gcsfuse CLI and configs, GKE gcsfuse CSI driver (Workload Identity principal:// bindings, profile StorageClasses, sidecar sizing), and Cloud Run volume mounts. Don't use for bucket administration without a mount (google-cloud-storage-basics)…

What it does

  • Attribution
  • Step 1 — Fit Gate (always run this first)
  • Step 2 — Route by intent
  • Reference Directory

When to use it

  • Use when interacting with gcsfuse or Cloud Storage FUSE mounts: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or…

Advantages

The skill’s files do not state this.

Usage examples

The skill’s files do not state this.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google/google-cloud-storage-fuse/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip google-cloud-storage-fuse.zip -d .agents/skills

Documentation by Google

Cloud Storage FUSE

Cloud Storage FUSE is a POSIX file-system adapter over Cloud Storage on Google Cloud, operated via the gcsfuse CLI tool. Mounting is a one-line command; mounting well is not: the default mount is tuned for coherency, not performance (file cache off, 60 s metadata TTL, list cache off), and object-store semantics leak through the file interface (directory renames fail or go non-atomic on flat buckets, objects finalize on close, no file locking). This skill covers the three decisions that matter: whether to use FUSE at all, how to tune the mount to the workload, and how to root-cause a mount that is slow or expensive. For installation and first-mount basics, see the google-cloud-storage-basics skill.

Attribution

Tag every Cloud Storage command you run or provide to the user while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data.

  • Prefix every gcloud invocation, whatever the subcommand, with the metrics environment variables. Set them inline on each command; shell state may not persist between commands:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-fuse)" \
        gcloud <command> [flags]

    Do not use gcloud config set for this: it would persist beyond the current task and mislabel unrelated usage.

  • On direct HTTP calls to the Cloud Storage APIs (for example with curl), set this exact User-Agent header, verbatim — the collection pipeline parses the gcs-skills/<version> and skill:<name> tokens, so any rewording breaks attribution:

    User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-fuse)

Step 1 — Fit Gate (always run this first)

Never produce mount guidance before the fit gate. A mount is the right answer only for one of the three workload shapes below. If the workload's access pattern is unknown, ask — one question about whether the reading code can take gs:// paths usually settles it.

Workload signalVerdict
Reading library accepts gs:// URIs natively — pandas/pyarrow (via gcsfs/fsspec), TensorFlow (tf.io.gfile), or any fsspec/gcsfs-based loaderNative reads, no mount. Point the code at gs:// paths and stop.
Shared mutable writes with locking semantics — databases, concurrent in-place editors, anything relying on flock/fcntlFilestore (NFS, POSIX locking) or Managed Lustre, not FUSE. Stop.
Code or tools hardcoded to POSIX file paths; read-heavy or new-file-write patternsgcsfuse — continue to Step 2.

Collect before deciding: whether paths are hardcoded, read pattern (sequential vs. random, re-read frequency), write pattern (new files vs. edits vs. directory renames). These same signals drive tuning later — record the answers.

Step 2 — Route by intent

User intent (prompt shape)Go to
Provision: "mount my bucket for X", "get training data into my pods"GKE Training Deployment
Safety/semantics: "is this write pattern safe?", "can multiple writers share the mount?"Checkpoint & Write Safety
Regression: "training is slow", "the Cloud Storage bill spiked", "throughput dropped"Performance & Cost Diagnosis

Never diagnose a regression without telemetry. If gcsfuse metrics are not enabled on the mount, enabling them is the first remediation step — the diagnosis reference starts there.

Reference Directory

  • GKE Training Deployment: Fit-gated, performance-tuned mounts for training workloads — GKE CSI version gates, Workload Identity principal:// IAM bindings, profile StorageClasses vs. static PVs, file cache sizing on Local SSD, sidecar resource annotations, complete KSA/PVC/Job manifests, and the Compute Engine and Cloud Run variants.

  • Checkpoint & Write Safety: Verdicts on write patterns — file vs. directory rename atomicity on flat vs. hierarchical namespace (HNS) buckets, close-vs-fsync finalization, concurrent-writer (ESTALE) semantics, streaming-write memory budgets, HNS migration, and the aiml-checkpointing profile.

  • Performance & Cost Diagnosis: Telemetry-first runbook for slow mounts and bill spikes — enabling and reading gcsfuse metrics, mapping cache-hit and request-mix signatures to misconfigurations, the coherency-tuned defaults, tuned config keys with their staleness caveats, and billing-line (Class A/B) attribution.

Files

references/checkpoint-safety.md

Checkpoint & Write Safety

Verdicts on write patterns through a gcsfuse mount — above all the standard checkpoint publish pattern (write ckpt.tmp/, rename to the final name) that must survive preemption.

Verdict table (lead with this)

Write patternFlat-namespace bucketHNS bucket
Rename a file to finalizeSafe — atomic MoveObject since v3.2.0Safe — atomic since v3.1.0
Rename a directory to finalizeFails by default (rename-dir-limit: 0); raising the limit makes it a non-atomic per-object copy+deleteSafe — atomic RenameFolder, metadata-only
fsync() for durabilityNot durable under streaming writes (the default for new files) — rely on close()Same — rely on close()
Concurrent writers, same objectFirst to close wins; later writers get ESTALE. No file locking exists.Same
Kernel list cache (kernel-list-cache-ttl-secs: -1)Dangerous on mutable mounts (directory ghosting, missing files, rmdir failures)Same — keep list cache off or low TTL; -1 is strictly for read-only mounts

So the temp-then-rename pattern is safe if and only if the bucket has hierarchical namespace (HNS) enabled, or the framework renames individual files rather than directories. On a flat bucket the directory rename fails outright by default — and "fixing" it by raising rename-dir-limit converts a visible failure into silent corruption risk: preemption mid-rename leaves a partially-renamed "final" checkpoint.

Never describe file renames as "copy + delete, slow but works" — that is outdated. Files rename atomically via the MoveObject API since v3.1.0 (HNS) and v3.2.0 (flat buckets); only directory renames on flat buckets use the non-atomic per-object path, and only when force-enabled.

Never recommend fsync() for checkpoint durability. Under streaming writes (default since v3.0), fsync() does not finalize the object; data is guaranteed on Cloud Storage only after close(). This is documented in the gcsfuse GitHub semantics doc, not on cloud.google.com — cite semantics.md when the user asks for a source.

Never enable kernel-list-cache-ttl-secs: -1 on mutable or checkpointing mounts. Client-side kernel list caching does not invalidate when files are added or deleted during training runs, causing phantom files, missing checkpoint shards, and rmdir/unlink errors across distributed workers. -1 is strictly for read-only training and serving mounts.

Never present rename-dir-limit as the fix without stating the non-atomicity. It is a fallback with a corruption window, not a remedy.

Diagnosis inputs

Collect before giving a verdict:

# Namespace type - the deciding signal. Prints "True" for HNS buckets;
# empty output means flat namespace. --raw is required: without it the
# describe output omits the hierarchical namespace field entirely.
CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-fuse)" \
    gcloud storage buckets describe gs://BUCKET --raw --format="value(hierarchicalNamespace.enabled)"

Also determine from the user or the mount config: does the framework rename a directory or individual files (Orbax and torch.distributed.checkpoint finalize by renaming a checkpoint directory; a plain torch.save to a temp name renames a single file); how many shard writers run concurrently per step; the effective write: global-max-blocks and file-system: rename-dir-limit.

Durability and finalization semantics

  • Objects are visible to readers only after finalization. Under streaming writes (default since v3.0, sequential writes to new files), finalization happens at close() — not at fsync().

  • A read during write, a downward truncate, or a rename during write finalizes the object early, and subsequent writes to that handle fall back to staged writes.

  • Staged writes (the fallback path: editing existing files, out-of-order writes, block-budget exhaustion) buffer the whole file in file-system: temp-dir (default /tmp) and upload on close/flush — an undersized temp dir breaks large staged writes.

Concurrency: first writer wins

There is no file locking (flock/fcntl are not honored across mounts). When two mounts write the same object, the first flush/close wins by generation precondition; the loser's close() fails with ESTALE (stale file handle). Design for one writer per object — e.g. one shard writer per checkpoint shard file. ESTALE in training logs almost always means two workers wrote the same path.

Memory budget for concurrent shard writers

Streaming writes hold one 32 MiB block per actively-written file, capped globally by write: global-max-blocks — default 4 on ordinary machines (128 MiB total; A2/A3/A4-series autoconfigure to 1600). Each streaming file consumes ~96 MiB RAM during upload. When the block budget is exhausted, additional concurrent writers degrade to staged writes — the only signal is a trace-level log line, invisible at the default info severity, so it looks like an unexplained slowdown. With N concurrent shard writers, set write: global-max-blocks ≥ N (e.g. global-max-blocks: 64 for 16 shard writers with headroom).

Remediation

Recommended: move checkpoints to an HNS bucket — directory renames become atomic metadata-only RenameFolder operations (executed as long-running operations: reads and lists work during the rename, writes to the affected folders are blocked until it completes), which is what makes temp-then-rename safe. HNS buckets also start with up to 8× the initial QPS of flat buckets (40,000 initial object reads/s and 8,000 writes/s vs. 5,000 and 1,000). HNS can only be chosen at bucket creation — existing flat buckets cannot be converted, so plan a new bucket + data copy. Uniform bucket-level access is required for HNS buckets.

# Create the HNS checkpoint bucket (--uniform-bucket-level-access is required)
CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-fuse)" \
    gcloud storage buckets create gs://CKPT_BUCKET --location=LOCATION \
    --uniform-bucket-level-access --enable-hierarchical-namespace

# Copy existing checkpoints if migrating
CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-fuse)" \
    gcloud storage cp -r gs://OLD_BUCKET/checkpoints gs://CKPT_BUCKET/

Mount tuned for checkpointing:

# Compute Engine / self-managed (profile requires gcsfuse ≥ v3.4.0)
gcsfuse --profile=aiml-checkpointing CKPT_BUCKET /mnt/ckpt

On GKE use the gcsfusecsi-checkpointing StorageClass (GKE ≥ 1.35.1-gke.1616000) — see GKE Training Deployment for the PV/PVC pattern; profiles cannot be passed as raw mount options on GKE.

The aiml-checkpointing profile sets implicit-dirs, infinite metadata TTL and unlimited stat cache (ttl-secs: -1, stat-cache-max-size-mb: -1, negative-ttl-secs: 0), file-cache: cache-file-for-range-read: true (for restore-time range reads), and file-system: rename-dir-limit: 200000. Note the rename-dir-limit entry exists for flat-bucket compatibility; on an HNS bucket directory renames are atomic and need no limit. The profile does not enable the file cache (enable it explicitly if restores should be served from local media), and keeps the kernel list cache off (kernel-list-cache-ttl-secs: 0) for write safety. Also state the close-time finalization semantics to the user whenever recommending this setup: checkpoints are durable when the writer closes the file, not before.

Fallback (user cannot migrate to HNS): raise the directory-rename limit on the flat bucket, stating the risk explicitly —

file-system:
  rename-dir-limit: 200000

This makes directory renames possible but non-atomic: each object is copied and deleted individually, the operation is O(objects) and expensive, and preemption mid-rename leaves both directories in an inconsistent state. If the job runs on preemptible/spot capacity, prefer file-level publish patterns (write shards to temp names, rename each file, then write a final manifest file) — file renames are atomic even on flat buckets.

Documentation

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/google-cloud-storage-fuse · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google or Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-storage-fuse.zip