Skip to content

VR-9892: Unzip directory artifacts on download#1973

Merged
convoliution merged 16 commits into
masterfrom
client/ml/unzip-dir
Feb 23, 2021
Merged

VR-9892: Unzip directory artifacts on download#1973
convoliution merged 16 commits into
masterfrom
client/ml/unzip-dir

Conversation

@convoliution
Copy link
Copy Markdown
Contributor

@convoliution convoliution commented Feb 18, 2021

  • split artifact download helper function
  • upload client-zipped directories with .dir.zip extension
  • unzip downloaded artifacts if they have that .dir.zip extension
  • add run.download_model()

Comment thread client/verta/verta/_tracking/experimentrun.py Outdated
zipf.extractall(dirpath)
finally:
os.remove(temp_filepath)
print("download complete; directory extracted to {}".format(dirpath))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With your approval @convoliution I'll make a tech-debt ticket to evaluate logging practices in our client library and plan for improvement. I'm pretty sure that in the longer term we want to steer away from using print statements so that our users can do things like choose their own log level. There's a good starting point here in the Hitchhiker's Guide to Python which we can use as a jumping off point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@daniel-verta Certainly! I'd be more than thrilled to move nearly the entirety of the client's print statements to a logger, provided it's done consistently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we have received such request, actually.



def download(response, filepath, chunk_size=32*(10**6), overwrite_ok=False):
def download_response(response, chunk_size=32*(10**6)):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this default value become an informative named constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would _32MB be informative, or would you be thinking of something that explains why that number was chosen (there wasn't a particular reason 😅).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

_32MB is fine. If there was a specific motivation for that number then a comment would be helpful. Just a rename in this case is helpful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this idea makes sense, and there are also different places (and different values...) where N*(10**6) is used. I'm going to consolidate them and make that a separate PR shortly.

Comment thread client/verta/tests/test_artifacts.py
Copy link
Copy Markdown
Contributor

@conradoverta conradoverta left a comment

Choose a reason for hiding this comment

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

LGTM, but need to address Daniel's feedback.

@convoliution convoliution merged commit 94dff4e into master Feb 23, 2021
@convoliution convoliution deleted the client/ml/unzip-dir branch February 23, 2021 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants