Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Working Directory Behavior Between Development and Production for projects #173

Open
TimPietruskyRunPod opened this issue Oct 29, 2024 · 0 comments

Comments

@TimPietruskyRunPod
Copy link

TimPietruskyRunPod commented Oct 29, 2024

There's an inconsistency in how working directories are handled between development (runpodctl project dev) and production (runpodctl project deploy / runpodctl project build) environments, which forces developers to implement path resolution workarounds in their handlers.

Current Behavior

  1. In Development:

    • Working directory is set to project root: /runpod-volume/{uuid}/dev/<project>
    • Project structure is maintained (e.g., src/ directory)
    • Files can be accessed using paths relative to project root
  2. In Production:

    • Working directory is changed to the handler's directory: /runpod-volume/{uuid}/prod/<project>/src
    • Forces developers to use different path resolution for asset files that exist directly in the repo

Current Workaround

Developers must add path resolution code to their handlers, for example to load a model that is part of same repo as the worker:

import os
current_dir = os.path.dirname(os.path.abspath(file))
model_path = os.path.join(current_dir, "<model>.pth")

Expected Behavior

The working directory should be consistent between development and production environments. Either:

  1. Always set working directory to project root
  2. Provide environment variables for important paths
  3. Document a clear convention for file locations and path resolution

Impact

  • Developers need to add unnecessary path resolution code
  • Risk of deployment failures due to path inconsistencies
  • Confusion when transitioning from development to production
  • Extra time spent debugging path-related issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant