dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
72 stars 39 forks source link

Show progress in Listr for slow tasks #96

Closed strophy closed 1 month ago

strophy commented 3 years ago

Listr can appear to hang when doing a slow operation like downloading images for the first time. We should show this progress.

Expected Behavior

Progress bar should be included in Listr output

Current Behavior

Listr appears to hang

Possible Solution

Redirect stream from docker-compose to Listr task.output?

Alternatives Considered

Additional Context

antouhou commented 3 years ago

Oh yeah, that would be great. Just thought about it yesterday - mn-bootstrap works very slowly in Travis and no build passes at the moment, so that would help a lot with that

strophy commented 3 years ago

I got really stuck here trying to understand streams and promises, so I'm not sure if this approach is correct. Output currently looks like this:

strophy@X250:~/Code/docker-dashd$ mn setup
mn-bootstrap 0.18.0-dev.1

✔ Set configuration preset
  › Selected testnet as default config
✔ Set node type
  › Selected fullnode type
✔ Configure external IP address
  › 71.198.220.130 is set
✔ Initialize Tenderdash
✔ Update config 
strophy@X250:~/Code/docker-dashd$ mn start
✔ Start testnet full node
  ✔ Check node is not started
  ✔ Start services 
Creating network "dash_masternode_testnet_default" with the default driver
Creating volume "dash_masternode_testnet_core_data" with default driver
Creating volume "dash_masternode_testnet_drive_abci_data" with default driver
Creating volume "dash_masternode_testnet_drive_mongodb_data" with default driver
Pulling dapi_tx_filter_stream (dashpay/dapi:0.17)...
0.17: Pulling from dashpay/dapi
Digest: sha256:4a4de51e33d44b028adeecd34629eb07d01874c3bedc304ef0efdd761f68eac2
Status: Downloaded newer image for dashpay/dapi:0.17
Creating dash_masternode_testnet_drive_mongodb_1 ... done
Creating dash_masternode_testnet_core_1          ... done
Creating dash_masternode_testnet_sentinel_1      ... done
Creating dash_masternode_testnet_drive_abci_1    ... done
Creating dash_masternode_testnet_dapi_insight_1     ... done
Creating dash_masternode_testnet_drive_tenderdash_1      ... done
Creating dash_masternode_testnet_dapi_tx_filter_stream_1 ... done
Creating dash_masternode_testnet_dapi_api_1              ... done
Creating dash_masternode_testnet_dapi_envoy_1            ... done
Creating dash_masternode_testnet_dapi_nginx_1            ... done
strophy@X250:~/Code/docker-dashd$

I wonder if we could at least match the indentation of the task displaying the output somehow? And maybe filter to only show some of the output (e.g. lines starting with "Pulling")?

dashameter commented 3 years ago

Can we also show an error if a docker container keeps restarting ? (Drive likes to do that, then you just see a stuck Task without a title but you don't know if it just tasks long or if something has gone bad in the background)

dash-maverick commented 2 years ago

closed because obsolete at this point (dashmate is operating differently at this point)

dash-maverick commented 2 years ago

It turned out to be still valid, sorry for my mistake. It's just a nice-to-have. It can remain as an open issue, it's a nice easy one for a community contribution as well.