-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Enhance progress outputs for image cache uploads #233
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
base: main
Are you sure you want to change the base?
Conversation
1b35fb0 to
ee61cf8
Compare
|
@sdelliot I mentioned it in response to your comments above, but I cleaned up the module a fair bit. The issues you rose were all tied to that weird return value construct, and I found that the easiest way to clean things up was to use your enum suggestion paired with a couple new objects representing the images and VM resources. There are still 4 tests that fail. I held off on fixing these because I wanted suggestions on solving them. The
This leaves some undefined behavior in other cases—such as when an MC image was older than the file store image... One of the currently failing test cases suggest that this might happen if the user were to copy the MC version of an image elsewhere, then replace it and reupload it (maybe for debugging something), and finally reverting it back to the original and reuploading that again. Previously, we seemed to just (silently) replace the newer file store image in this case. My current draft of this takes an opposite approach, and rather than deleting the newer file store image, it raises a user warning that the cache is out of sync. The user can then decide to blow away the cache, or investigate, or whatever. Getting into this state seems like a pretty weird case that only developers might ever actually be intendng to reach, but even if the best solution here for most users is almost always to just reset the cache, silently deleting files feels to me like a big no-no. If that feels like the right approach, I can add, update, and/or remove tests to match. Otherwise, I'm open to other ideas. Side note: A cool benefit of this round of refactoring is that VM resources can now also easily receive progress bars. I set it so that large VMRs (over 250 MB) will get them when they're uploaded to the cache. I think that feature had been requested out-of-band. |
1b066b3 to
0ff789d
Compare
That is certainly one of the reasons why we had that code in there originally. The second is for the case of using I agree that it doesn't seem valuable or wise to just silently delete the newer images and I am on board with your approach. If a user is messing around with the images that much, they likely wouldn't want their image deleted and maybe would want to save it off. The new Enum structure really cleans up the code a lot! I also agree that we can likely merge the FileStoreFile and _ModelComponentFile, but I am okay with punting that down the road. |
Co-authored-by: Steven Elliott <6461548+sdelliot@users.noreply.github.com> Signed-off-by: Mitch Negus <21086604+mitchnegus@users.noreply.github.com>
0ff789d to
326d50b
Compare
Enhance progress outputs for image cache uploads
Description
In service of improving the user experience of launching FIREWHEEL experiments, this MR begins adding more functionality to the
ModelComponentandModelComponentManagerobjects.This MR contains a few substantive changes:
ModelComponentobject was heavily refactored. It handled VM resources and images using very similar, but entirely separate upload processes. Now, it performs uploads in a uniform fashion, depending on the subtleties of each upload type defined via a new object class—a_ModelComponentFile. This object is notionally analagous to the existingFileStoreFileobject from thelib.minimega.file_storemodule, but this represents the file as part of the model component rather than the file store. Ultimately, it seems like these file-like objects might do well to be combined eventually, but that feels like a separate issue.Type of Change
Please select the type of change your pull request introduces:
Checklist