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.
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
Added non-git source puller functionality #194
base: main
Are you sure you want to change the base?
Added non-git source puller functionality #194
Changes from 7 commits
ea87f2b
10385bb
ab80daf
71ca2f4
ae66e53
8934f5f
ac2072c
a84096d
86fd7bf
c686651
f8e04f1
958b0b1
2048e8d
398a03f
9a8fcab
78e31c3
a131b93
55da5e1
0ca6cf9
9e808e5
8d63ee4
deecc7b
a9e08c4
09c9249
0085fab
88ec806
8592d1f
21d8f0f
ab5dd10
e8ae5ca
56ad1ee
af567ca
782a35b
d034d37
9729464
602ef01
3ebdc7e
e22d076
3b14405
613f863
5f39c68
f618560
367f3c7
8893970
7590c38
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This monkeypatches the asyncio event loop, is this event loop shared across the whole of jupyter-server? If so are there any potential issues that might be caused in jupyter-server, extensions, or kernels that we should be aware of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@consideRatio @manics Erik do you have any sense of this? I completely based this solution on the reference I linked to in the comments. He seemed to be trying to solve a similar nested event loop issue in Jupyter.
I read a bunch more pieces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the nest_asyncio calls to the nbgitpuller-downloader-plugins themselves as well as added notes to the documentation that the import and call to nest_asyncio need to be included in any nbgitpuller-downloader-plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great and important comment, because "provider" isn't by itself obvious. I think it would be nice to have this named "content provider" or similar, where "git" is the default if unset for example. If we don't rename provider to something more explicit like content provider, I think we should at least write our documentation surrounding it as if it were a content provider that by default is "git" - but plugins can make us support non-git content providers.
In practice I figure what we do in the code below, is that when we have a non-git content provider, we let it do its custom logic over unknown time while reporting its progress via the "progress_loop" function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change across the board. The only issue was that I had trouble rendering the template for status.html if I included an underscore in the parameter. I couldn't seem to find any documentation on this. I will look more but for now the template rendering of status.html says provider but everywhere else is content_provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query_line_args
- does that make sense?It seems a bit weird to me to have handle_files have a "query_line_args" parameter declared, when we in practice call handle_files with an object that is a mash of query line args and other things in our handlers.py logic.
That makes me think the name query_line_args is a bit misleading. I wonder about the handle_files function signature a bit, should it really just take a single dict with misc key/value's, if so, perhaps we want to make it accept **kwargs which would fit the bill for a misc scrap of args.
Hmmm... I hope to learn more and I don't have a clear suggestion based on my current understanding, but the function signature of handle_files seems a bit off.
I think I suggest that we pass
query_line_args
as that and only that, and make other arguments be passed as their own arguments or into kwargs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring improvements
Initial paragraph
Can you make the initial paragraph describe that this is a function signature that content provider plugins can implement, and when they do, the implementation is responsible for doing something something given the arguments something something.
"The developer uses this function [...]"
"The developer" is a bit vague to me. Can you make it clear that a content provider plugin developer should define a function to do certain things in the actual implementation of this function.
Implementation specific details, but should be generic i think
I think that this function is supposed to accomplish something quite generic, but ends up hinting that its done in a quite specific way. I'm not sure what
unzip_dir
andorigin_repo_path
refers to, but shouldn't this be agnostic to an idea ofunzip
or similar? I'd like this function to be agnostic to how files are provided, and was thinking that unzip_dir sounds like it isn't.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response to point 3:
This gets complicated actually. The biggest issue here is that we cannot determine the folder/location of either the directory the user sees in their jupyterhub home(is this we call it?) drive -- unzip_dir, nor the local directory acting like the remote origin repo until we have downloaded the compressed archive. Both are determined from the download name and need to be in order to allow for multiple nbhigtpuller sources to exist in the same account on the same hub.
Futhermore, it gets more complicated if the developer of the content-plugin decides to handle all the downloading and decompression themselves -- meaning they do not use the handle_files_helper function from plugin_helper.py. In this case they can name the folders whatever they want. It might be dependedent on the downloaded compressed archive file name or not. I guess we could tell them they must use X name but then that still creates issues if there are multiple nbgitpuller sources in one account.
I really struggled with this part and went back and forth trying to get out of needing these pieces passed back to the handler. Maybe I am not thinking about it right here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly as far as a user is concerned they give it a URL, and they end up with a directory of files? Is
unzip_dir
is the directory containing the output the user wants? If so you could just call itoutput_dir
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got @manics good deal.