nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
637 stars 116 forks source link

Implement a more lightweight display of launch/start/etc. progress #27

Open nchammas opened 8 years ago

nchammas commented 8 years ago

Flintrock's output is already much cleaner compared to spark-ec2's:

Launching 2 instances...
[52.91.67.xxx] SSH online.
[52.91.67.xxx] Installing Spark...
[52.91.213.xxx] SSH online.
[52.91.213.xxx] Installing Spark...
All 2 instances provisioned.
[52.91.67.xxx] Configuring Spark master...
Spark Health Report:
  * Master: ALIVE
  * Workers: 1
  * Cores: 1
  * Memory: 2.7 GB            
launch_ec2 finished in 0:02:52.

But this still needs some improvement. If you were to launch a 100-node cluster, you would get more than 200 lines of output: 100 lines showing when SSH comes online, and 100 lines for installing Spark.

This is noise.

A better user experience would be to show some kind of progress bar for each "stage" of the operation that Flintrock is executing.

So for cluster launches, we would show a single progress bar that advances as SSH becomes available across the nodes of the cluster, and another progress bar that advances as Spark is installed across the nodes of the cluster.

Maybe something like this:

SSH online       [####################..........]  75%
Spark installed  [######........................]  25%

I'll look into Click's progress bar utility, though it looks like I will probably have to find a workaround for this issue with having multiple progress bars being updated simultaneously.

Other considerations to keep in mind:

nchammas commented 8 years ago

After some investigation, I think we'll have to implement our own progress indicator.

First, we don't need a bar. A counter for each stage will do:

Instance running   4/4
SSH online         3/4
Spark installed    1/4

Second, we will generally be setting progress based on some absolute measure of where we are (e.g. "2 done out of 4") instead of on a relative basis (e.g. "+1 done") because we're asking a remote resource for status instead of doing work ourselves, and that remote resource does work in unpredictable batches.

Click's progress bar does not support setting progress in this way; you must add increments of progress, which is awkward in Flintrock.