For the complete documentation index, see llms.txt. This page is also available as Markdown.
Azure Files
Mount Azure Files file system to access shared network storage directly from Valohai executions.
Overview
Azure Files provides managed SMB storage that you can mount in Valohai executions. Use Azure Files 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 in file share mounts are NOT versioned by Valohai. Always save final results to /valohai/outputs/ for reproducibility.
Prerequisites
Before mounting Azure Files storage in Valohai:
Existing Azure Files instance — Use an existing storage or create a new one in Azure
Network access — Make sure the Azure Files storage is accessible from your worker instances
Setup: Configure Azure Files Access
Step 1: Get the Azure Files storage information
Navigate to your Azure storage account that contains the file share
Under the Overview page for the file share, click on Connect and then navigate under the Linux tab.
Take note of the following values:
File share connection string, e.g. //storage-account-name.file.core.windows.net/file-share-name
username, should match the storage account name
password
Step 2: Store the file share information as environment variables
In Valohai, navigate to projects Settings → Environment Variables
Add the connection string, username and password as environment variables. Make sure to mark at least the password as a secret!
You can also save the values into an environment variable group to easily share them between several projects in Valohai.
Mount Azure Files file share in Execution
Mount Configuration
valohai.yaml:
Parameters:
destination — Mount point inside container (e.g., /mnt/fileshare-data)
source — File share connection string (format: //storage-account-name.file.core.windows.net/file-share-name), passed here from the FILE_SHARE environment variable
type — Depends on your file share type, either smb or cifs
username — Username for the file share, passed here from the USERNAME environment variable
password — Password for the file share, passed here from the PASSWORD environment variable
readonly — true (recommended) or false
You can hardcode the connection string, username and password but, especially for the latter, that is not recommended for security reasons.
Complete Workflow Example
Mount → Process → Save Pattern
Scenario: Process large video dataset stored on file share, extract features, save to Valohai outputs.
valohai.yaml:
extract_features.py:
Result:
✅ Raw videos accessed from file share (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 File Share Structure
Clear organization makes mounting and access control easier.
Handle Mount Errors
Maintaining Reproducibility
⚠️ Critical: Azure Files file share data can change between executions. Always save processed results to /valohai/outputs/ for versioning.
import os
import sys
FILESHARE_PATH = '/mnt/fileshare-data/'
# Verify mount is accessible
if not os.path.exists(FILESHARE_PATH):
print(f"ERROR: File share mount {FILESHARE_PATH} not accessible")
print("Possible causes:")
print(" - Wrong connection string in mount configuration")
print(" - Wrong password or username in mount configuration")
print(" - Network connectivity issue")
sys.exit(1)
# Verify expected data exists
expected_dir = os.path.join(FILESHARE_PATH, 'datasets')
if not os.path.exists(expected_dir):
print(f"WARNING: Expected directory not found: {expected_dir}")
print(f"Available: {os.listdir(FILESHARE_PATH)}")
print(f"File share mount verified: {FILESHARE_PATH}")
# Today: Process data from file share
data = load_from_fileshare('/mnt/fileshare-data/')
model = train(data)
# Next week: Someone updates file share data
# Retraining gives different results
# Can't reproduce original model
# Load from file share (current state)
data = load_from_fileshare('/mnt/fileshare-data/')
# Save snapshot to versioned outputs
data.to_csv('/valohai/outputs/training_snapshot.csv')
# Create dataset version
metadata = {
"training_snapshot.csv": {
"valohai.dataset-versions": [{
"uri": "dataset://training-data/2024-01-15"
}]
}
}
# Train on versioned snapshot in next execution
# Can reproduce exactly anytime