import os
import sys
EFS_PATH = "/mnt/efs-data/"
# Verify mount is accessible
if not os.path.exists(EFS_PATH):
print(f"ERROR: EFS mount {EFS_PATH} not accessible")
print("Possible causes:")
print(" - Security group not configured")
print(" - VPC/network connectivity issue")
print(" - Wrong EFS file system ID")
sys.exit(1)
# Verify expected structure
expected_dir = os.path.join(EFS_PATH, "datasets")
if not os.path.exists(expected_dir):
print(f"WARNING: Expected directory not found: {expected_dir}")
print(f"Available directories: {os.listdir(EFS_PATH)}")
print(f"EFS mount verified: {EFS_PATH}")
# Today: Process data from EFS
data = load_from_efs("/mnt/efs-data/")
model = train(data)
# Next week: Someone updates EFS data
# Retraining gives different results
# Can't reproduce original model
# Load from EFS (current state)
data = load_from_efs("/mnt/efs-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