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

[Feature]: Optional volume mounts #2162

Open
jvstme opened this issue Dec 30, 2024 · 0 comments
Open

[Feature]: Optional volume mounts #2162

jvstme opened this issue Dec 30, 2024 · 0 comments

Comments

@jvstme
Copy link
Collaborator

jvstme commented Dec 30, 2024

Problem

Some volume mounts are not crucial for runs, e.g. if they are only used for caching. However, specifying such mounts in the run configuration limits the backends and regions available for the run, so the best offers can be filtered out.

Example 1 (instance volumes). I am using an instance volume for caching. This limits my run to VM-based backends. But I actually don't mind running the configuration on container-based backends without mounting a volume if these backends provide better offers.

Example 2 (network volumes). I am using RunPod volumes for caching. I created a volume in a few regions that I use the most and specified them in a single mount point in my run configuration. This limits my run to the regions where I have a volume. But I actually don't mind running the configuration in other regions without mounting a volume if these regions provide better offers.

Solution

Add a new boolean field optional to volume mounts in run configurations.

type: dev-environment
ide: vscode

volumes:
- instance_path: /dstack-cache/pip
  path: /root/.cache/pip
  optional: true

The field can be set for both instance volume mounts and network volume mounts.

If a mount is optional: false (the default), the configuration can only run in the backends and regions where this mount is available, the volume is always mounted.

If a mount is optional: true, the configuration can run in any backends and regions, the volume is only mounted if it is available in the chosen backend and region.

Workaround

Apply the run configuration with and without volume mounts, compare the offers, decide if you want to run with or without volumes.

Would you like to help us implement this feature by sending a PR?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant