Add a --volume flag to modal shell
#2067
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supports
modal shell --volume ...
to quickly attach one (or more) of your volumes to an add-hoc shell for filesystem exploration:You can call it multiple times, like
modal shell --volume models --volume data
Volumes are always mounted at
/mnt/{name}
. I considered making this configurable, e.g.modal shell --volume /mnt/data:my-data-vol
. But that felt like overkill for something that targets quick work. If we find a need for it, I think it's fine to expand the interface in the future to allow it. We're reasonably strict about volume names and I think any valid volume name would also be a valid mount point? (Open to counter-arguments here !).Changelog
Volumes can now be mounted to an ad hoc modal shell session:
When the shell starts, the volume will be mounted at
/mnt/my-vol-name
. This may be helpful for shell-based exploration or manipulation of volume contents.Note that the option can be used multiple times to mount additional models: