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
Refactoring notebook managers and adding Azure backed storage. #2045
Conversation
This looks good on first view, but it's obviously 0.14 material, tagging as such. |
Yep, strongly so. One thing that I am running into is that we have hardcoded logic about the notebook_dir everywhere. But that notion only makes sense for the file based notebook manager. I have going to commit some fixes that work around this fact, but we are going to have to rethink this. |
Furthermore, the notebook_dir support is kind of borked now: it refers to the storage dir, but the cwd of the actual kernels is still where the server starts. Ideally it would do both, so one can (in file-based storage) configure the notebook dir in a config profile and simply start things from wherever, knowing that all kernels will come up in the right place. I'd actually like to see that fixed for 0.13, but I don't see it happening. |
@fperez do you think this is ready to go in? |
|
||
import datetime | ||
|
||
import azure |
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.
Is this guaranteed to be available by default on all azure images, or do users need to manually install the necessary sdk on their images? If so, do we need to update our setup.py to declare this as an optional dependency?
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.
Users have to install this by hand and we should add it to our setup.py.
Overall the code looks clean, but there are a few things that worry me:
The former I'm not really sure what to do about, the latter is eminently addressable... Otherwise the code does look great, and I'm thrilled to see it in. Good job! |
I will add some docs for this. |
This is like the PBS/etc. Launchers, which simply cannot be automatically tested. We can do some amount of testing with dummy objects, but I'm not sure how useful that is. Perhaps what is more useful, if more cumbersome, is manual tests a la docs/examples/tests, to make sure things work. When changing this code, run the test script / step through the test process, etc. For instance, we managed to cut 0.13 with PBS/SGE support in ipcluster that totally doesn't work, so we need to figure something out. re: notebook_dir We use notebook_dir for three technically unrelated values, that are all the same by coincidence right now:
Is there more to decouple than that? |
On Wed, Jul 18, 2012 at 7:31 AM, Min RK
The main difficulty with testing this is that it requires the Azure
3 is the hardest to decouple. The reason is that eventually the
Brian E. Granger |
Precisely - just like the launchers, it could only be run by users with an appropriate environment, and cannot be involved in the automatic test suite.
Is it possible that local files would simply be unavailable in cases where the kernel's filesystem is not visible to the nbserver? That honestly seems like a reasonable answer to me, since this is not a 100% critical feature. |
This one is only waiting for docs, right? And a rebase, now. |
Yes, I just need to finish the docs. On Fri, Jul 20, 2012 at 10:35 PM, Min RK
Brian E. Granger |
Is there a reason for the base class to be called BaseNotebookManager rather than NotebookManager? This change would mean that config for 0.13 will be broken in 0.14, that would work perfectly fine otherwise. Since we have coupled class names to config files, I think we need a pretty high bar for renaming configurable classes. |
self.save_notebook_object(notebook_id, nb) | ||
return notebook_id | ||
def log_info(self): | ||
self.log.info("Serving notebooks from local directory: %s", self.notebook_manager.notebook_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.
This should be self.notebook_dir
, not self.notebook_manager.notebook_dir
I closed pull request #2155 and adjusted my notebook manager to use Brian's work. Thanks Brian. Noted the following bug in the azurenb branch, causing the default file system based nb manager to fail
|
Here is another bug fix to the azurenb branch, it was still referring to NotebookManager
|
My patches are in https://github.com/benjiec/ipython/tree/azurenb I will create a pull request to Brian's branch |
I have created a base class for all notebook managers. Our existing, file-based store, is now in filenbmanager.py. I have also created a new Azure Blob based backed notebook manager.
OK, I have addressed all of the comments and the test suite passes without the azure package installed. I have also added some minimal docs about using a custom notebook manager. Merging. |
Refactoring notebook managers and adding Azure backed storage.
I wish you had pinged, since you did not actually address all comments above. Unaddressed:
And the rebased commits re-introduced use of the deprecated assertEquals name, which was otherwise removed. |
@ellisonbg, in general I think it's a good idea to give one last ping on PRs that have had good back-and-forth (such as this one). Typically what we've been doing is that then the reviewer, if all looks good, ends up merging right away. That way it doesn't really add any unnecessary lag to the process, it helps catch situations like this one, and it means that when we see the merge logs, the main reviewer tends to stand out right away without having to come back to read the PR process itself. |
On Fri, Aug 10, 2012 at 7:13 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
On Fri, Aug 10, 2012 at 8:03 PM, Brian E. Granger
No worries :) Min quickly updated the deprecated asserts and I reviewed it |
OK new PR submitted. On Fri, Aug 10, 2012 at 8:08 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
Refactoring notebook managers and adding Azure backed storage.
I have created a base class for all notebook managers. Our existing, file-based store, is now in filenbmanager.py. I have also created a new Azure Blob based backed notebook manager.