Repository: OpenMined/PySyft

Issue:
UX: Spinner Animation to Hagrid Launch 
## Feature Description
Currently when silent flag is provided during launching of node through hagrid, progress bars are displayed to show 

- `Pull`
- `Build`
- `Launch`
 
of docker containers.When we initially try to launch in a new system without any cached packages these steps take a `lot of time.`
Since we cannot provide time estimation in the progress bars, we could replace the ⌛ emoji by a spinner animation of rich library.

Current loading part:
![Screenshot 2022-11-03 at 9 45 39 AM](https://user-images.githubusercontent.com/43314053/199647158-c9a8f188-9194-4787-881d-05548973a8af.png)

Spinner animation example:
https://www.npmjs.com/package/cli-spinners

Reference to solve the issue.
https://rich.readthedocs.io/en/stable/progress.html

We could a spinner column to the rich progress in folder
`packages/hagrid/hagrid/cli.py` in `execute_commands` functions
https://github.com/OpenMined/PySyft/blob/5de360b9fc4cff81dda76bd0a35af7c0167554c4/packages/hagrid/hagrid/cli.py#L597

This is mainly to show new users that the thread is not frozen and it is still working as it takes time.




Discussion:
Hi @rasswanth-s, I'm new to the PySyft codebase but I have some familiarity with using rich progress bars. I would like to work on this issue to get started here.

To add the spinner, I should change the code below:
https://github.com/OpenMined/PySyft/blob/5de360b9fc4cff81dda76bd0a35af7c0167554c4/packages/hagrid/hagrid/cli.py#L613

to this:
```python3
with Progress(
    SpinnerColumn(), 
    TextColumn("[progress.description]{task.description}"), 
    console=console, 
    auto_refresh=False,
  ) as progress:
```
Is this correct or am I missing something?
Sure , Go for it 🚀 
We mainly need the spinner animation instead of clock gif when doing hagrid launch
You could follow the pysyft main readme, to install hagrid and launch quickstart which inturn would help to launch a domain, which would show if the spinner animation works.
Comment on the thread , if there were any blockers.

Resolving patch:
diff --git a/packages/hagrid/hagrid/cli.py b/packages/hagrid/hagrid/cli.py
--- a/packages/hagrid/hagrid/cli.py
+++ b/packages/hagrid/hagrid/cli.py
@@ -32,7 +32,10 @@
 import rich
 from rich.console import Console
 from rich.live import Live
+from rich.progress import BarColumn
 from rich.progress import Progress
+from rich.progress import SpinnerColumn
+from rich.progress import TextColumn
 from virtualenvapi.manage import VirtualEnvironment
 
 # relative
@@ -395,14 +398,14 @@ def check_pulling(line: str, cmd_name: str, progress_bar: Progress) -> None:
     if "Pulling" in line and "fs layer" not in line:
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed} / {task.total+1}]",
+            description=f" [bold]{cmd_name} [{task.completed} / {task.total+1}]",
             total=task.total + 1,
             refresh=True,
         )
     if "Pulled" in line:
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed + 1} / {task.total}]",
+            description=f" [bold]{cmd_name} [{task.completed + 1} / {task.total}]",
             completed=task.completed + 1,
             refresh=True,
         )
@@ -427,14 +430,14 @@ def check_building(line: str, cmd_name: str, progress_bar: Progress) -> None:
     if load_pattern.match(line):
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed} / {task.total +1}]",
+            description=f" [bold]{cmd_name} [{task.completed} / {task.total +1}]",
             total=task.total + 1,
             refresh=True,
         )
     if build_pattern.match(line):
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed+1} / {task.total}]",
+            description=f" [bold]{cmd_name} [{task.completed+1} / {task.total}]",
             completed=task.completed + 1,
             refresh=True,
         )
@@ -452,14 +455,14 @@ def check_launching(line: str, cmd_name: str, progress_bar: Progress) -> None:
     if "Starting" in line:
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed} / {task.total+1}]",
+            description=f" [bold]{cmd_name} [{task.completed} / {task.total+1}]",
             total=task.total + 1,
             refresh=True,
         )
     if "Started" in line:
         progress_bar.update(
             0,
-            description=f"⌛ [bold]{cmd_name} [{task.completed + 1} / {task.total}]",
+            description=f" [bold]{cmd_name} [{task.completed + 1} / {task.total}]",
             completed=task.completed + 1,
             refresh=True,
         )
@@ -610,7 +613,14 @@ def execute_commands(
     if isinstance(cmds, dict):
         console.print("[bold green]⠋[bold blue] Launching Docker Images [/bold blue]\t")
         for cmd_name, cmd in cmds.items():
-            with Progress(console=console, auto_refresh=False) as progress:
+            with Progress(
+                SpinnerColumn(),
+                TextColumn("[progress.description]{task.description}"),
+                BarColumn(),
+                TextColumn("[progress.percentage]{task.percentage:.2f}%   "),
+                console=console,
+                auto_refresh=True,
+            ) as progress:
                 if silent:
                     progress.add_task(
                         f"[bold green]{cmd_name} Images",


Test patch: