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

fix: regression in nfs get #1822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thundergolfer
Copy link
Contributor

Describe your changes

#1742 caused a regression in nfs get. It can be repro'd with:

MODAL_PROFILE=modal_labs MODAL_LOGLEVEL=debug modal nfs get txt-to-pokemon-cache-vol pokemon_names/rnn.txt

User reported this here https://modal-com.slack.com/archives/C069RAH7X4M/p1715620466703749.

This wasn't caught by tests because our fake implementation was wrong. Fixed that.

Backward/forward compatibility checks

Check these boxes or delete any item (or this section) if not relevant for this PR.

  • Client+Server: this change is compatible with old servers
  • Client forward compatibility: this change ensures client can accept data intended for later versions of itself

Note on protobuf: protobuf message changes in one place may have impact to
multiple entities (client, server, worker, database). See points above.

Changelog

@thundergolfer thundergolfer force-pushed the jonathon/fix-nfs-get-regression branch from 3d0615d to 13573dc Compare May 13, 2024 22:27
@thundergolfer thundergolfer force-pushed the jonathon/fix-nfs-get-regression branch from 13573dc to c28a1f2 Compare May 13, 2024 22:29
Comment on lines +196 to +218
if "*" in remote_path:
await _volume_download(volume, remote_path, destination, force)
return

if destination != PIPE_PATH:
if destination.is_dir():
destination = destination / remote_path.rsplit("/")[-1]

if destination.exists() and not force:
raise UsageError(f"'{destination}' already exists")

if not destination.parent.exists():
raise UsageError(f"Local directory '{destination.parent}' does not exist")

@contextmanager
def _destination_stream():
if destination == PIPE_PATH:
yield sys.stdout.buffer
else:
with NamedTemporaryFile(delete=False) as fp:
yield fp
shutil.move(fp.name, destination)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix _volume_download instead of introducing deviant behavior based on the path containing an asterisk?

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

Successfully merging this pull request may close these issues.

None yet

2 participants