rust-lang / rustwide

Execute your code on the Rust ecosystem.
Apache License 2.0
181 stars 41 forks source link

Show progress for docker commands #9

Open jyn514 opened 4 years ago

jyn514 commented 4 years ago

When building a crate for docs.rs, I get the following output, followed by 15 minutes without anything happening:

2019/10/25 01:20:53 [INFO] rustwide::cmd::sandbox: pulling image rustops/crates-build-env from Docker Hub
2019/10/25 01:20:53 [INFO] rustwide::cmd: running `"docker" "pull" "rustops/crates-build-env"`
2019/10/25 01:20:55 [INFO] rustwide::cmd: [stdout] Using default tag: latest
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] latest: Pulling from rustops/crates-build-env
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] 5667fdb72017: Already exists
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] d83811f270d5: Already exists
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] ee671aafb583: Already exists
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] 7fc152dfb3a6: Already exists
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] 5c0b1d519321: Pulling fs layer
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] 4f2b8f293757: Pulling fs layer
2019/10/25 01:20:56 [INFO] rustwide::cmd: [stdout] 2fa8e23f28c7: Pulling fs layer
2019/10/25 01:20:57 [INFO] rustwide::cmd: [stdout] 5c0b1d519321: Verifying Checksum
2019/10/25 01:20:57 [INFO] rustwide::cmd: [stdout] 5c0b1d519321: Download complete
2019/10/25 01:20:57 [INFO] rustwide::cmd: [stdout] 2fa8e23f28c7: Download complete
2019/10/25 01:20:57 [INFO] rustwide::cmd: [stdout] 5c0b1d519321: Pull complete

If I run docker pull rustops/crates-build-env manually on the host machine, I can see that it's trying to download a 1.3 GB image, which takes quite a while on my internet connection. Would it be possible to show this progress in rustwide so it doesn't seem like nothing is happening?

jyn514 commented 4 years ago

Same request when rustup is downloading components.

pietroalbini commented 4 years ago

Hmm, it's a bit hard to do that, as neither of those programs output the progress bar when not running under a tty. Docker could probably be solved by using the API (#7) and implementing the progress bar ourselves, but I'm not sure how to do that for rustup.

jyn514 commented 4 years ago

As a workaround, could rustwide unconditionally print 'still running \<command>' every 1-5 minutes, the same way that cargo test prints 'still running after 60 seconds'?

regexident commented 3 years ago

Even just adding a "The next steps might take a while. Hang tight!" right before starting docker tasks that are known to run for a while would still be better than just "hanging" for minutes, I think.

Providing an actual progress would be even better, of course. But either way would be an improvement to the status quo.

jyn514 commented 3 years ago

This should be a lot better after https://github.com/rust-lang/docs.rs/pull/1360.