google-cloud-storage-fuse
它能做什么
这个技能帮你把 Cloud Storage 存储桶当作服务器上的普通文件夹使用。它适用于需要以文件方式访问存储桶数据、并希望挂载运行良好的工程师。
适用场景
- ✓当你想使用 gcsfuse 将 Cloud Storage 存储桶挂载为文件系统的时候。
- ✓当你需要判断 FUSE、原生 gs:// 读取或 Filestore 哪种适合你的工作负载的时候。
- ✓当 gcsfuse 挂载速度慢或成本超出预期,需要调优的时候。
技能链接
https://github.com/google/skills/blob/main/skills/cloud/google-cloud-storage-fuse/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的数据存储桶挂载为 GKE Pod 上的文件夹,并让它在读取大量小文件时更快。”
每周 5 个新技能,1 分钟读完。
工作原理
它会解释文件式访问的取舍,然后为你的工作负载使用经过调优的缓存和元数据选项设置挂载。它还会帮你找出挂载缓慢或成本高昂的原因。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
gcloudinvocation, 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 setfor 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 thegcs-skills/<version>andskill:<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 signal | Verdict |
|---|---|
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. |
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. |
| Code or tools hardcoded to POSIX file paths; read-heavy or new-file-write patterns | gcsfuse — 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 Ru
常见问题
把存储桶挂载和普通磁盘一样吗?
不一样。对象存储的行为不同,例如目录重命名和文件锁定都有局限。
它可以在哪里挂载存储桶?
GKE、Compute Engine 和 Cloud Run。
它需要先使用基础技能吗?
对于安装和首次挂载步骤,google-cloud-storage-basics 技能涵盖了基础内容。
详情
作者的原始描述
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 b
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10331
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。