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
First version of cluster web service. #1383
Conversation
With this code, clusters are enforced as singletons per-profile. Is this intended? The |
Initially I was thinking the notebook would enforce the single On Tue, Feb 7, 2012 at 1:33 PM, Min RK
Brian E. Granger |
help="Command line arguments to pass to ipcluster.") | ||
ipcluster_subcommand = Unicode('start') | ||
ipcluster_profile = Unicode('default') |
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.
Other launchers use profile_dir
directly, I think to avoid relying upon environment-variables. Presumably the IPCluster launcher should be consistent (I would not object to other launchers using profile-names instead of profile-dirs, but they should at least match).
Also, the profile
and n
traits should probably not have the ipcluster_
prefix, as it's entirely redundant.
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.
There is a subtle point about the profiles. There is always a profile
in the self.config object of configurables. But the profile used for
ipcluster can be different from that and I wanted to pick a name that
reflected that. But for the ipcluster_n, you are right that there is
no reason to not just a plain "n"
In terms of the profile_dir stuff, I think for this simple version it
makes sense to use profile, because that is what the list_profiles_in
function returns. But once we move over to the launchers, we can go
the profile_dir route. Or do you think we should create a
profile->profile_dir function and use the profile_dirs from the start?
On Tue, Feb 7, 2012 at 1:51 PM, Min RK
reply@reply.github.com
wrote:
help="Command line arguments to pass to ipcluster.")
ipcluster_subcommand = Unicode('start')
- ipcluster_profile = Unicode('default')
Other launchers use
profile_dir
directly, I think to avoid relying upon environment-variables. Presumably the IPCluster launcher should be consistent (I would not object to other launchers using profile-names instead of profile-dirs, but they should at least match).Also, the
profile
andn
traits should probably not have theipcluster_
prefix, as it's entirely redundant.
Reply to this email directly or view it on GitHub:
https://github.com/ipython/ipython/pull/1383/files#r425457
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com
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.
There is a subtle point about the profiles. There is always a profile
in the self.config object of configurables. But the profile used for
ipcluster can be different from that and I wanted to pick a name that
reflected that.
The app profile is not exactly relevant, because the IPClusterLauncher will not pick up the IPythonApp.profile
configurable because it isn't a subclass. You still have to pass it directly in one of the two following ways:
launcher = IPClusterLauncher(profile='foo')
or in config:
IPClusterLauncher.profile = 'foo'
It is not possible to specify the ipcluster profile without already having the word 'IPCluster' in the statement, thus making the prefix redundant in all circumstances.
On the profile-dir point, I just think it makes sense for Launchers to be internally consistent, and right now they are not - the IPClusterLauncher takes a name, and all others take a dir. We already have a profile->profile_dir function, it's called ProfileDir.find_profile_by_name.
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.
OK I will make these changes.
On Tue, Feb 7, 2012 at 3:10 PM, Min RK
reply@reply.github.com
wrote:
help="Command line arguments to pass to ipcluster.")
ipcluster_subcommand = Unicode('start')
- ipcluster_profile = Unicode('default')
There is a subtle point about the profiles. There is always a profile
in the self.config object of configurables. But the profile used for
ipcluster can be different from that and I wanted to pick a name that
reflected that.The app profile is not exactly relevant, because the IPClusterLauncher will not pick up the
IPythonApp.profile
configurable because it isn't a subclass. You still have to pass it directly in one of the two following ways:launcher = IPClusterLauncher(profile='foo')
or in config:
IPClusterLauncher.profile = 'foo'
It is not possible to specify the ipcluster profile without already having the word 'IPCluster' in the statement, thus making the prefix redundant in all circumstances.
On the profile-dir point, I just think it makes sense for Launchers to be internally consistent, and right now they are not - the IPClusterLauncher takes a name, and all others take a dir. We already have a profile->profile_dir function, it's called ProfileDir.find_profile_by_name.
Reply to this email directly or view it on GitHub:
https://github.com/ipython/ipython/pull/1383/files#r425821
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com
Looking great, as mentioned on email, having feedback on cluster status and a 'stop' button is critical before we can merge, I think. |
@fperez: sorry I wasn't clear - this PR is not even close to being done. The start button does nothing and there is obviously no place to specify the number of engine, stop the cluster, etc. I mainly just wanted some UI feedback before I got too far into things. @minrk: I have fixed the tab styling to make it cleaner. We could tweak it further, but I think is semi-respectable now. More code on its way... |
No, that's no problem; I knew this was work in progress. I just wanted to highlight which points I thought were true blockers vs others that we may just keep on refining over time. I'm trying with reviews to find a good sweet spot between ensuring that PRs do refine important problems and not holding PR authors to such impossible standards that something takes forever to review. Since some of your work here is UI, it's a good candidate for 'forever in progress', and I was just trying to highlight one key point we do want fixed before merge. I think this is a great start, and we can use this PR as working ground until we're in a good spot to merge. |
OK, the notebook/parallel integration is now fully working. You can start/stop clusters in the notebook and set the number of engines. The UI is super simple, but it is a good start and seems to work quite well. Needs lots of testing. |
Were you going to make the changes to the ipcluster launcher traits? |
In the cluster list, it probably makes sense for the first entry to be the current profile in use, or otherwise stand out. |
Has the tab area gotten wider? It seems much too wide, now. |
The # of engines has a default value (ncpus). When unspecified, it should use the default, rather than saying "invalid engine #". |
IPClusterLauncher should detect when ipcluster exits, so it doesn't still say 'running' even after shutdown or crash. To do this, hook up a callback with |
@minrk: thanks for the feedback.
|
Thanks! I don't think there's any logical differentiation of the profiles other than 'current' and 'other'. If it doesn't look nice, don't worry about it, but since I have about 30 profiles for testing (most of them empty), it wasn't as obvious at a glance where 'default' was as I thought it should be. I don't imagine normal people (or just those who clean up after themselves) would have this problem. We might also want to allow for creation of new profiles.
Hm, while I do see that it matches the general body width of GitHub, they actually have zero elements other than control-bars, title bars, etc. that actually come anywhere close to filling that width (biggest I found was 720px), because every view they have is multi-column. Are there any elements we might eventually add in side-columns next to the lists, so they aren't so fat?
Make sure the default is that
Great! |
On Sun, Feb 12, 2012 at 10:04 PM, Min RK
There may be other elements we would add on the project dashboard, but https://github.com/ipython/ipython
Yes, that is how I was going to handle it. But you are (again) right Cheers, Brian
Brian E. Granger |
Okay, I see that they match, though ours still feels much wider. Perhaps it is the vast spacing between elements, and the fact that we actually have content on both edges, while 60% of their width is a text area, which never comes close to the right edge. Our much higher contrast background/border color scheme may contribute as well. What about moving the buttons to the far-left, and/or significantly shrinking the spacing between columns, rather than trying to fill the space just because we have it? It looks a bit silly to have all that empty non-functional space.
Yes, the ipcluster launcher is clearly not a long-term solution, but you are still right in starting with it, because it's so simple for the basic 'just give me some engines' case most appropriate for the notebook at this point. |
On Mon, Feb 13, 2012 at 3:57 PM, Min RK
I agree it feels bigger. So much so that I actually went back and
Brian E. Granger |
@minrk: I just pushed a commit that implemented everything using the proper controller and engine set launchers. Everything seems to work, but this will need some careful eyes on everything. Some particulars:
I think we are getting close to merging though. Thanks! |
I made a PR against your branch to use an IPClusterStart subclass to load this config. It's really much too hard to emulate config loading with all the subclasses and inheritance without using the actual classes, and we shouldn't ever do it if we can avoid it.
I have MPI locally, and I use SGE on the neuroscience cluster. I'm not in a great place to test SGE this week, but I am using MPI at least, and it seems to be working fine (after my PR above, which was required, because config loading was not working properly).
Functionality is irrelevant after PR above, but there should be some UI indication. It is not clear that leaving the textarea blank is an acceptable action. I also just don't like the appearance of the textarea approach. Perhaps a slider?
No, because on_stop means the process isn't running anymore. The only place you might want to keep references around is if you stop the engines in the controller's on_stop, and delete refs right away. You might keep those refs around for a more forceful kill if the first attempt fails.
Tough call. I currently have 401 files in profile_default/log, which is pretty bad, but you certainly don't want to have removed the logfiles if anything went wrong. Unfortunately, that's pretty tricky to detect, because a crash is not the only reason for a logfile to be interesting.
I really want a way to query a cluster's state, so that we can see what's running and how many engines, etc., even if we aren't the process that started the cluster. Currently, PID files are the only thing we have in this regard, and they track IPCluster, not ipcontroller. So I'm not sure how useful they would be unless you want to add some significant monitoring machinery.
No, cluster_id is too inconvenient in the Client, and should only be used when absolutely necessary and actively using multiple clusters with one profile. One further note: Now the cluster list seems entirely unordered. This is pretty problematic for me, when 'default' is 3/4 of the way down a list of 40 profiles. It should be sorted alphabetically, and the only ones that might get out of that order and moved to the top are:
I agree, it's looking good. I still really want to fiddle with the aesthetics, as right now it looks quick clunky and unreasonably wide. |
What specifically was not working in the config loading. I agree your Should I just load the default n into the UI? I can try a slider, but I will play with the aesthetics a bit and try some sorting of the profiles. On Sat, Feb 18, 2012 at 9:42 AM, Min RK
Brian E. Granger |
Subclasses. For instance, I happened to have
I'm not sure. That would require loading config from every single profile on first load (and wouldn't reflect changes to config files after server start, which I was doing). I think the default should just be 'default' or 0. I've seen several UIs that are sliders, with an option to double-click to enter manually. In which case, I would only let the slider go to 16, or possibly 32, depending on how it feels. I'm not certain this will be better than a textarea. Maybe the real answer is just to style the textarea less starkly, so it doesn't stand out so much. It also probably shouldn't be much more than 3 characters wide. |
This exposes ipcluster's over the web. The current implementation uses IPClusterLauncher to run ipcluster in a separate process. Here is the URL scheme we are using: GET /clusters => list available clusters GET /cluster/profile => list info for cluster with profile POST /cluster/profile/start => start a cluster POST /cluster/profile/stop => stop a cluster
* Created new base page html/css/js. * Everything inherits from the page template. * Universal header border. * Notebook list borders are set to 1px all around. * No border around notebook area. * Border cleanup of toolbar/menubar. * Lots of code reorg to get ready for further refactoring.
Not functional yet, but the idea is there.
You can start/stop clusters in the notebook with a very simple UI. More to do, but this is a start.
if os.path.isdir(full_path): | ||
profiles.append(profile) | ||
return profiles | ||
|
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.
These two look fairly straightforward, but do need at least a couple of simple tests.
Don't forget to merge this for better config loading. |
Thanks for the reminder, got it! On Thu, Mar 8, 2012 at 11:49 AM, Min RK
Brian E. Granger |
ensures that config loading matches what would happen in ipcluster. The only change needed in IPClusterStart itself was moving the on_stop registration from init_launchers to start_controller, where it should have been anyway.
I've written simple tests for the two profile list functions, but I'm at a coffee shop that apparently blocks ssh (?!), so I can't push. |
Hey, On Thu, Mar 8, 2012 at 12:36 PM, Min RK
Funny, so had I! I'll incorporate your code into my PR and we'll Cheers, f |
Nbparallel - add tests for profile listing.
IPython clusters can now be managed using the Notebook.
IPython clusters can now be managed using the Notebook.
Exposes the management of ipclusters in the notebook web app.