Repository: mars-project/mars

Issue:
[BUG] Task progress bar format is not uniform
<!--
Thank you for your contribution!

Please review https://github.com/mars-project/mars/blob/master/CONTRIBUTING.rst before opening an issue.
-->

**Describe the bug**
The task progress bar numbers are not aligned, and the number of digits of the data is inconsistent. We i run the following codes:
```python
import mars
import mars.tensor as mt
import mars.dataframe as md


mars.new_session()
df = md.DataFrame(
    mt.random.randint(1, 100, size=(1000, 10), chunk_size=(130, 5)),
    columns=list("ABCDEFGHIJ"),
)
df.describe().execute()
```
 it prints:
```
   1%|▋                                                            | 1.1544011544011543/100 [00:02<01:26,  1.15it/s]
 20%|████████████▏                                                | 20.057720057720058/100 [00:03<00:06, 11.56it/s]
 35%|█████████████████████▍                                        | 34.63203463203463/100 [00:04<00:05, 12.71it/s]
 46%|████████████████████████████▎                                | 46.320346320346324/100 [00:05<00:04, 12.31it/s]
 59%|████████████████████████████████████▌                         | 58.87445887445888/100 [00:06<00:03, 12.39it/s]
 72%|██████████████████████████████████████████████                  | 72.005772005772/100 [00:07<00:02, 12.64it/s]
 85%|████████████████████████████████████████████████████▊         | 85.28138528138528/100 [00:08<00:01, 12.85it/s]
100%|██████████████████████████████████████████████████████████████████████████| 100.0/100 [00:09<00:00, 10.89it/s]
```

**To Reproduce**
To help us reproducing this bug, please provide information below:
1. Your Python version: 3.7.9
2. The version of Mars you use: master
3. Versions of crucial packages, such as numpy, scipy and pandas
4. Full stack of the error.
5. Minimized code to reproduce the error.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.



Discussion:

Resolving patch:
diff --git a/mars/deploy/oscar/session.py b/mars/deploy/oscar/session.py
--- a/mars/deploy/oscar/session.py
+++ b/mars/deploy/oscar/session.py
@@ -1571,7 +1571,11 @@ def __init__(self, show_progress):
                 else:
                     self.progress_bar = None
             else:
-                self.progress_bar = tqdm(total=100)
+                self.progress_bar = tqdm(
+                    total=100,
+                    bar_format="{l_bar}{bar}| {n:6.2f}/{total_fmt} "
+                    "[{elapsed}<{remaining}, {rate_fmt}{postfix}]",
+                )
 
         self.last_progress: float = 0.0
 
diff --git a/mars/oscar/backends/ray/communication.py b/mars/oscar/backends/ray/communication.py
--- a/mars/oscar/backends/ray/communication.py
+++ b/mars/oscar/backends/ray/communication.py
@@ -100,12 +100,7 @@ def __reduce__(self):
 
 
 @lazy_import_on_load(ray)
-def _init_ray_metrics():
-    # Note: Must init metrics before using and here initializing metrics
-    # with ray backend.
-    from ....metrics import init_metrics
-
-    init_metrics("ray")
+def _init_ray_serialization_deserialization():
     _ray_serialize = ray.serialization.SerializationContext.serialize
     _ray_deserialize_object = ray.serialization.SerializationContext._deserialize_object
     serialized_bytes_counter = Metrics.counter(


Test patch: