Diagnose and resolve package version mismatches between local and distributed worker environments.
When running Geneva UDFs on distributed workers, your code is serialized locally and executed on remote workers. If the worker environment differs from your local environment, you may encounter subtle and difficult-to-debug errors.
Geneva provides a diagnostic tool to compare your local environment against Ray workers.If you are encountering a hang or exception you can use the following diagnosis worklflow to resolve the problem.
1
Run the diagnostic tool programatically or via the CLI.
2
Check PACKAGES and ENV VARS output sections for mismatches.
from geneva.runners.ray.compare_env import compare_ray_environments# Compare and print (requires Geneva context to be initialize via `with db.context(..)`)result = compare_ray_environments()# Compare environments, filtering environment variables with specified prefixresult = compare_ray_environments(env_prefix="PY")
# Connect to existing Ray clusterpython -m geneva.runners.ray.compare_env# Start new local Ray clusterpython -m geneva.runners.ray.compare_env --address local# Filter env vars by prefixpython -m geneva.runners.ray.compare_env --env-prefix RAY# Show full JSON snapshotspython -m geneva.runners.ray.compare_env --show-all# Skip sys.path comparisonpython -m geneva.runners.ray.compare_env --no-sys-path
If you see different OS types (e.g., Darwin locally vs Linux remotely), compiled extensions may fail with ModuleNotFoundError or segfaults.Solution: Run Geneva from the same OS/architecture as your cluster (typically Linux x86_64). Use a Linux VM, container, or remote development environment.
If critical environment variables are missing on workers, you can pass them via the manifest or cluster configuration. Set the values in the shell before starting the Python program:
Pros: Quick, reusable across sessions, stored with your database.Cons: Slower startup (downloads packages), may not work for complex dependencies.Option 2: Custom Ray Worker ImageFor KubeRay deployments, build a custom worker image:
Pros: Fastest startup, reproducible.Cons: Requires image build/push workflow.Option 3: Conda EnvironmentUse a conda environment on workers via the cluster builder: