Google Cloud Filestore

Mount Google Cloud Filestore to access shared network storage directly from Valohai executions.


Overview

Google Cloud Filestore provides managed NFS storage that you can mount in Valohai executions. Use Filestore to:

  • Access large datasets without downloading

  • Share preprocessed data across multiple executions

  • Cache intermediate results on fast shared storage

  • Process data in place and save versioned outputs

⚠️ Important: Files on Filestore mounts are NOT versioned by Valohai. Always save final results to /valohai/outputs/ for reproducibility.


Prerequisites

Before mounting Filestore in Valohai:

  1. Existing Filestore instance — Use an existing Filestore or create a new one in GCP Console

  2. Same VPC or VPC peering — Filestore must be in the same VPC as Valohai resources, or set up VPC peering between VPCs

  3. Network access — Filestore automatically allows access from VMs in the same VPC (no additional firewall rules needed)


Setup: Configure Filestore Access

Step 1: Create or Find Filestore Instance

In GCP Console:

  1. Go to Filestore → Instances

  2. Find your instance or click "Create Instance"

  3. Note the IP address (e.g., 10.0.0.5)

  4. Note the File share name (e.g., share1)


Step 2: Get Filestore IP Address

Via GCP Console:

  1. Go to Filestore → Instances

  2. Click on your instance

  3. Copy the IP address from instance details

Via gcloud command:

Example output:


Step 3: Verify VPC Configuration

Ensure Filestore and Valohai VMs are in the same VPC:

  1. In GCP Console, go to Filestore → Instances

  2. Check the Network column for your instance

  3. Verify it matches the VPC where Valohai resources are deployed

  4. If different VPCs, set up VPC peering


Mount Filestore in Execution

Basic Mount Configuration

valohai.yaml:

Parameters:

  • destination — Mount point inside container (e.g., /mnt/filestore-data)

  • source — Filestore IP and share name (format: <ip-address>:/<share-name>)

  • type — Always nfs for Filestore

  • readonlytrue (recommended) or false


Mount Specific Filestore Directory

Mounts only the /ml-datasets/training directory from Filestore share.


Complete Workflow Example

Mount → Process → Save Pattern

Scenario: Process large video dataset stored on Filestore, extract features, save to Valohai outputs.

valohai.yaml:

extract_features.py:

Result:

  • ✅ Raw videos accessed from Filestore (no download time for 100GB+ videos)

  • ✅ Extracted features saved to /valohai/outputs/ (versioned)

  • ✅ Dataset created for reproducible model training

  • ✅ Can train on dataset://video-features/batch-001 anytime


Best Practices

Use Readonly for Input Data


Always Version Final Results


Organize Your Filestore Structure

Clear organization makes mounting and access control easier.


Handle Mount Errors


Maintaining Reproducibility

⚠️ Critical: Filestore data can change between executions. Always save processed results to /valohai/outputs/ for versioning.

The problem:

The solution:

See: Access Network Storage for complete patterns.



Next Steps

  • Set up Filestore in your GCP project (or use existing)

  • Get Filestore IP address using gcloud or Console

  • Create test execution mounting Filestore

  • Build pipeline: mount → process → save to outputs

  • Monitor Filestore performance in GCP Console

Last updated

Was this helpful?