Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing the verbosity of wget progress updates when build output is not connected to a tty #397

Open
lopopolo opened this issue Mar 25, 2021 · 2 comments

Comments

@lopopolo
Copy link

Hi 👋 Thank you for ruby-install.

I'm using ruby-install in a Docker container to install a pinned Ruby version.

By default, ruby-installer will use wget, if it is installed, to download the source tarball. The default progress reporting option for wget is quite verbose and bloats the build log for the container.

hadolint, a tool for linting Dockerfiles, suggests passing --progress=dot:giga to limit the verbosity of wget progress updates.

Would making this behavior the default or exposing a CLI switch be something suitable for this project?

Build log

Docker build log of ruby-install invocation
+ /opt/ruby-install-0.8.1/bin/ruby-install --no-install-deps --install-dir /usr/local/ ruby 2.6.3 -- --disable-install-rdoc
>>> Updating ruby versions ...
>>> Installing ruby 2.6.3 into /usr/local/ ...
>>> Downloading https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.xz into /usr/local/src ...
--2021-03-25 03:15:15--  https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.xz
Resolving cache.ruby-lang.org (cache.ruby-lang.org)... 151.101.53.178, 2a04:4e42:d::434
Connecting to cache.ruby-lang.org (cache.ruby-lang.org)|151.101.53.178|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11904360 (11M) [application/x-tar]
Saving to: '/usr/local/src/ruby-2.6.3.tar.xz.part'

     0K .......... .......... .......... .......... ..........  0% 1.52M 7s
    50K .......... .......... .......... .......... ..........  0% 1.96M 7s
   100K .......... .......... .......... .......... ..........  1% 1.26M 7s
   150K .......... .......... .......... .......... ..........  1% 1.95M 7s
   200K .......... .......... .......... .......... ..........  2% 1.24M 7s
   250K .......... .......... .......... .......... ..........  2% 1.63M 7s
   300K .......... .......... .......... .......... ..........  3% 1.88M 7s
   350K .......... .......... .......... .......... ..........  3% 2.03M 7s
   400K .......... .......... .......... .......... ..........  3% 1.95M 7s
   450K .......... .......... .......... .......... ..........  4% 1.74M 7s
   500K .......... .......... .......... .......... ..........  4% 1.89M 6s
   550K .......... .......... .......... .......... ..........  5% 2.14M 6s
   600K .......... .......... .......... .......... ..........  5% 2.10M 6s
   650K .......... .......... .......... .......... ..........  6% 2.31M 6s
   700K .......... .......... .......... .......... ..........  6% 2.32M 6s
   750K .......... .......... .......... .......... ..........  6% 2.58M 6s
   800K .......... .......... .......... .......... ..........  7% 2.59M 6s
   850K .......... .......... .......... .......... ..........  7% 2.03M 6s
   900K .......... .......... .......... .......... ..........  8% 2.44M 5s
   950K .......... .......... .......... .......... ..........  8% 2.48M 5s
  1000K .......... .......... .......... .......... ..........  9% 2.48M 5s
  1050K .......... .......... .......... .......... ..........  9% 3.04M 5s
  1100K .......... .......... .......... .......... ..........  9% 2.71M 5s
  1150K .......... .......... .......... .......... .......... 10% 2.59M 5s
  1200K .......... .......... .......... .......... .......... 10% 2.77M 5s
  1250K .......... .......... .......... .......... .......... 11% 2.05M 5s
  1300K .......... .......... .......... .......... .......... 11% 2.40M 5s
  1350K .......... .......... .......... .......... .......... 12% 3.26M 5s
  1400K .......... .......... .......... .......... .......... 12% 2.84M 5s
  1450K .......... .......... .......... .......... .......... 12% 2.99M 5s
  1500K .......... .......... .......... .......... .......... 13% 2.91M 5s
  1550K .......... .......... .......... .......... .......... 13% 3.03M 5s
  1600K .......... .......... .......... .......... .......... 14% 3.13M 4s
  1650K .......... .......... .......... .......... .......... 14% 2.23M 4s
  1700K .......... .......... .......... .......... .......... 15% 2.43M 4s
  1750K .......... .......... .......... .......... .......... 15% 2.89M 4s
  1800K .......... .......... .......... .......... .......... 15% 3.17M 4s
  1850K .......... .......... .......... .......... .......... 16% 3.13M 4s
  1900K .......... .......... .......... .......... .......... 16% 3.11M 4s
  1950K .......... .......... .......... .......... .......... 17% 2.50M 4s
  2000K .......... .......... .......... .......... .......... 17% 2.92M 4s
  2050K .......... .......... .......... .......... .......... 18% 2.04M 4s
  2100K .......... .......... .......... .......... .......... 18% 2.59M 4s
  2150K .......... .......... .......... .......... .......... 18% 2.93M 4s
  2200K .......... .......... .......... .......... .......... 19% 3.29M 4s
  2250K .......... .......... .......... .......... .......... 19% 3.15M 4s
  2300K .......... .......... .......... .......... .......... 20% 3.78M 4s
  2350K .......... .......... .......... .......... .......... 20% 4.13M 4s
  2400K .......... .......... .......... .......... .......... 21% 3.42M 4s
  2450K .......... .......... .......... .......... .......... 21% 2.45M 4s
  2500K .......... .......... .......... .......... .......... 21% 3.76M 4s
  2550K .......... .......... .......... .......... .......... 22% 4.21M 4s
  2600K .......... .......... .......... .......... .......... 22% 3.24M 4s
  2650K .......... .......... .......... .......... .......... 23% 3.30M 4s
  2700K .......... .......... .......... .......... .......... 23% 4.29M 4s
  2750K .......... .......... .......... .......... .......... 24% 3.22M 4s
  2800K .......... .......... .......... .......... .......... 24% 3.95M 3s
  2850K .......... .......... .......... .......... .......... 24% 2.50M 3s
  2900K .......... .......... .......... .......... .......... 25% 3.98M 3s
  2950K .......... .......... .......... .......... .......... 25% 3.76M 3s
  3000K .......... .......... .......... .......... .......... 26% 4.50M 3s
  3050K .......... .......... .......... .......... .......... 26% 3.44M 3s
  3100K .......... .......... .......... .......... .......... 27% 3.90M 3s
  3150K .......... .......... .......... .......... .......... 27% 3.97M 3s
  3200K .......... .......... .......... .......... .......... 27% 3.44M 3s
  3250K .......... .......... .......... .......... .......... 28% 2.86M 3s
  3300K .......... .......... .......... .......... .......... 28% 5.06M 3s
  3350K .......... .......... .......... .......... .......... 29% 4.04M 3s
  3400K .......... .......... .......... .......... .......... 29% 3.79M 3s
  3450K .......... .......... .......... .......... .......... 30% 4.81M 3s
  3500K .......... .......... .......... .......... .......... 30% 4.65M 3s
  3550K .......... .......... .......... .......... .......... 30% 3.42M 3s
  3600K .......... .......... .......... .......... .......... 31% 4.69M 3s
  3650K .......... .......... .......... .......... .......... 31% 3.16M 3s
  3700K .......... .......... .......... .......... .......... 32% 3.98M 3s
  3750K .......... .......... .......... .......... .......... 32% 3.74M 3s
  3800K .......... .......... .......... .......... .......... 33% 4.08M 3s
  3850K .......... .......... .......... .......... .......... 33% 4.88M 3s
  3900K .......... .......... .......... .......... .......... 33% 3.82M 3s
  3950K .......... .......... .......... .......... .......... 34% 5.72M 3s
  4000K .......... .......... .......... .......... .......... 34% 4.19M 3s
  4050K .......... .......... .......... .......... .......... 35% 3.30M 3s
  4100K .......... .......... .......... .......... .......... 35% 5.03M 3s
  4150K .......... .......... .......... .......... .......... 36% 3.90M 3s
  4200K .......... .......... .......... .......... .......... 36% 6.11M 3s
  4250K .......... .......... .......... .......... .......... 36% 3.91M 3s
  4300K .......... .......... .......... .......... .......... 37% 4.26M 3s
  4350K .......... .......... .......... .......... .......... 37% 4.60M 2s
  4400K .......... .......... .......... .......... .......... 38% 3.58M 2s
  4450K .......... .......... .......... .......... .......... 38% 4.14M 2s
  4500K .......... .......... .......... .......... .......... 39% 4.36M 2s
  4550K .......... .......... .......... .......... .......... 39% 4.95M 2s
  4600K .......... .......... .......... .......... .......... 39% 4.19M 2s
  4650K .......... .......... .......... .......... .......... 40% 5.26M 2s
  4700K .......... .......... .......... .......... .......... 40% 4.02M 2s
  4750K .......... .......... .......... .......... .......... 41% 5.00M 2s
  4800K .......... .......... .......... .......... .......... 41% 4.82M 2s
  4850K .......... .......... .......... .......... .......... 42% 4.06M 2s
  4900K .......... .......... .......... .......... .......... 42% 4.51M 2s
  4950K .......... .......... .......... .......... .......... 43% 4.57M 2s
  5000K .......... .......... .......... .......... .......... 43% 7.44M 2s
  5050K .......... .......... .......... .......... .......... 43% 4.08M 2s
  5100K .......... .......... .......... .......... .......... 44% 6.16M 2s
  5150K .......... .......... .......... .......... .......... 44% 4.83M 2s
  5200K .......... .......... .......... .......... .......... 45% 3.89M 2s
  5250K .......... .......... .......... .......... .......... 45% 4.03M 2s
  5300K .......... .......... .......... .......... .......... 46% 5.84M 2s
  5350K .......... .......... .......... .......... .......... 46% 5.52M 2s
  5400K .......... .......... .......... .......... .......... 46% 4.60M 2s
  5450K .......... .......... .......... .......... .......... 47% 5.16M 2s
  5500K .......... .......... .......... .......... .......... 47% 6.91M 2s
  5550K .......... .......... .......... .......... .......... 48% 5.56M 2s
  5600K .......... .......... .......... .......... .......... 48% 4.37M 2s
  5650K .......... .......... .......... .......... .......... 49% 4.01M 2s
  5700K .......... .......... .......... .......... .......... 49% 6.45M 2s
  5750K .......... .......... .......... .......... .......... 49% 4.43M 2s
  5800K .......... .......... .......... .......... .......... 50% 6.77M 2s
  5850K .......... .......... .......... .......... .......... 50% 5.12M 2s
  5900K .......... .......... .......... .......... .......... 51% 5.14M 2s
  5950K .......... .......... .......... .......... .......... 51% 4.53M 2s
  6000K .......... .......... .......... .......... .......... 52% 5.78M 2s
  6050K .......... .......... .......... .......... .......... 52% 3.58M 2s
  6100K .......... .......... .......... .......... .......... 52% 5.35M 2s
  6150K .......... .......... .......... .......... .......... 53% 6.71M 2s
  6200K .......... .......... .......... .......... .......... 53% 4.12M 2s
  6250K .......... .......... .......... .......... .......... 54% 7.03M 2s
  6300K .......... .......... .......... .......... .......... 54% 7.10M 2s
  6350K .......... .......... .......... .......... .......... 55% 3.88M 2s
  6400K .......... .......... .......... .......... .......... 55% 6.59M 2s
  6450K .......... .......... .......... .......... .......... 55% 3.60M 2s
  6500K .......... .......... .......... .......... .......... 56% 5.28M 2s
  6550K .......... .......... .......... .......... .......... 56% 5.79M 1s
  6600K .......... .......... .......... .......... .......... 57% 6.43M 1s
  6650K .......... .......... .......... .......... .......... 57% 4.82M 1s
  6700K .......... .......... .......... .......... .......... 58% 4.43M 1s
  6750K .......... .......... .......... .......... .......... 58% 6.97M 1s
  6800K .......... .......... .......... .......... .......... 58% 4.27M 1s
  6850K .......... .......... .......... .......... .......... 59% 5.57M 1s
  6900K .......... .......... .......... .......... .......... 59% 9.20M 1s
  6950K .......... .......... .......... .......... .......... 60% 4.67M 1s
  7000K .......... .......... .......... .......... .......... 60% 6.17M 1s
  7050K .......... .......... .......... .......... .......... 61% 5.19M 1s
  7100K .......... .......... .......... .......... .......... 61% 6.34M 1s
  7150K .......... .......... .......... .......... .......... 61% 7.11M 1s
  7200K .......... .......... .......... .......... .......... 62% 5.38M 1s
  7250K .......... .......... .......... .......... .......... 62% 4.94M 1s
  7300K .......... .......... .......... .......... .......... 63% 5.91M 1s
  7350K .......... .......... .......... .......... .......... 63% 5.96M 1s
  7400K .......... .......... .......... .......... .......... 64% 9.52M 1s
  7450K .......... .......... .......... .......... .......... 64% 4.66M 1s
  7500K .......... .......... .......... .......... .......... 64% 8.23M 1s
  7550K .......... .......... .......... .......... .......... 65% 3.87M 1s
  7600K .......... .......... .......... .......... .......... 65% 7.88M 1s
  7650K .......... .......... .......... .......... .......... 66% 5.20M 1s
  7700K .......... .......... .......... .......... .......... 66% 6.91M 1s
  7750K .......... .......... .......... .......... .......... 67% 5.57M 1s
  7800K .......... .......... .......... .......... .......... 67% 5.41M 1s
  7850K .......... .......... .......... .......... .......... 67% 4.83M 1s
  7900K .......... .......... .......... .......... .......... 68% 9.82M 1s
  7950K .......... .......... .......... .......... .......... 68% 5.37M 1s
  8000K .......... .......... .......... .......... .......... 69% 6.18M 1s
  8050K .......... .......... .......... .......... .......... 69% 4.43M 1s
  8100K .......... .......... .......... .......... .......... 70% 6.57M 1s
  8150K .......... .......... .......... .......... .......... 70% 4.34M 1s
  8200K .......... .......... .......... .......... .......... 70% 5.74M 1s
  8250K .......... .......... .......... .......... .......... 71% 11.3M 1s
  8300K .......... .......... .......... .......... .......... 71% 5.74M 1s
  8350K .......... .......... .......... .......... .......... 72% 6.99M 1s
  8400K .......... .......... .......... .......... .......... 72% 7.79M 1s
  8450K .......... .......... .......... .......... .......... 73% 3.82M 1s
  8500K .......... .......... .......... .......... .......... 73% 9.06M 1s
  8550K .......... .......... .......... .......... .......... 73% 5.12M 1s
  8600K .......... .......... .......... .......... .......... 74% 5.89M 1s
  8650K .......... .......... .......... .......... .......... 74% 5.92M 1s
  8700K .......... .......... .......... .......... .......... 75% 8.30M 1s
  8750K .......... .......... .......... .......... .......... 75% 7.33M 1s
  8800K .......... .......... .......... .......... .......... 76% 5.42M 1s
  8850K .......... .......... .......... .......... .......... 76% 4.99M 1s
  8900K .......... .......... .......... .......... .......... 76% 6.69M 1s
  8950K .......... .......... .......... .......... .......... 77% 5.08M 1s
  9000K .......... .......... .......... .......... .......... 77% 9.16M 1s
  9050K .......... .......... .......... .......... .......... 78% 7.07M 1s
  9100K .......... .......... .......... .......... .......... 78% 3.94M 1s
  9150K .......... .......... .......... .......... .......... 79% 10.6M 1s
  9200K .......... .......... .......... .......... .......... 79% 8.09M 1s
  9250K .......... .......... .......... .......... .......... 79% 4.12M 1s
  9300K .......... .......... .......... .......... .......... 80% 7.14M 1s
  9350K .......... .......... .......... .......... .......... 80% 7.38M 1s
  9400K .......... .......... .......... .......... .......... 81% 4.97M 1s
  9450K .......... .......... .......... .......... .......... 81% 7.29M 1s
  9500K .......... .......... .......... .......... .......... 82% 8.10M 1s
  9550K .......... .......... .......... .......... .......... 82% 5.45M 1s
  9600K .......... .......... .......... .......... .......... 83% 8.89M 1s
  9650K .......... .......... .......... .......... .......... 83% 5.45M 0s
  9700K .......... .......... .......... .......... .......... 83% 5.27M 0s
  9750K .......... .......... .......... .......... .......... 84% 8.98M 0s
  9800K .......... .......... .......... .......... .......... 84% 7.15M 0s
  9850K .......... .......... .......... .......... .......... 85% 4.67M 0s
  9900K .......... .......... .......... .......... .......... 85% 11.1M 0s
  9950K .......... .......... .......... .......... .......... 86% 6.64M 0s
 10000K .......... .......... .......... .......... .......... 86% 5.51M 0s
 10050K .......... .......... .......... .......... .......... 86% 6.05M 0s
 10100K .......... .......... .......... .......... .......... 87% 6.27M 0s
 10150K .......... .......... .......... .......... .......... 87% 7.74M 0s
 10200K .......... .......... .......... .......... .......... 88% 8.47M 0s
 10250K .......... .......... .......... .......... .......... 88% 4.47M 0s
 10300K .......... .......... .......... .......... .......... 89% 11.5M 0s
 10350K .......... .......... .......... .......... .......... 89% 8.38M 0s
 10400K .......... .......... .......... .......... .......... 89% 5.30M 0s
 10450K .......... .......... .......... .......... .......... 90% 5.94M 0s
 10500K .......... .......... .......... .......... .......... 90% 7.13M 0s
 10550K .......... .......... .......... .......... .......... 91% 5.48M 0s
 10600K .......... .......... .......... .......... .......... 91% 9.77M 0s
 10650K .......... .......... .......... .......... .......... 92% 8.27M 0s
 10700K .......... .......... .......... .......... .......... 92% 5.46M 0s
 10750K .......... .......... .......... .......... .......... 92% 8.39M 0s
 10800K .......... .......... .......... .......... .......... 93% 6.63M 0s
 10850K .......... .......... .......... .......... .......... 93% 6.30M 0s
 10900K .......... .......... .......... .......... .......... 94% 7.75M 0s
 10950K .......... .......... .......... .......... .......... 94% 7.99M 0s
 11000K .......... .......... .......... .......... .......... 95% 7.40M 0s
 11050K .......... .......... .......... .......... .......... 95% 6.88M 0s
 11100K .......... .......... .......... .......... .......... 95% 6.86M 0s
 11150K .......... .......... .......... .......... .......... 96% 7.99M 0s
 11200K .......... .......... .......... .......... .......... 96% 7.05M 0s
 11250K .......... .......... .......... .......... .......... 97% 4.86M 0s
 11300K .......... .......... .......... .......... .......... 97% 5.56M 0s
 11350K .......... .......... .......... .......... .......... 98% 7.93M 0s
 11400K .......... .......... .......... .......... .......... 98% 7.61M 0s
 11450K .......... .......... .......... .......... .......... 98% 8.60M 0s
 11500K .......... .......... .......... .......... .......... 99% 7.42M 0s
 11550K .......... .......... .......... .......... .......... 99% 7.65M 0s
 11600K .......... .......... .....                           100% 6.13M=2.7s

2021-03-25 03:15:19 (4.16 MB/s) - '/usr/local/src/ruby-2.6.3.tar.xz.part' saved [11904360/11904360]

>>> Verifying ruby-2.6.3.tar.xz ...
>>> Extracting ruby-2.6.3.tar.xz to /usr/local/src/ruby-2.6.3 ...
>>> Configuring ruby 2.6.3 ...
....

Example

I've added --progress=dot:giga elsewhere in my Dockerfile and it renders output like this:

+ wget --progress=dot:giga https://static.rust-lang.org/rustup/archive/1.23.1/x86_64-unknown-linux-gnu/rustup-init
--2021-03-25 03:14:59--  https://static.rust-lang.org/rustup/archive/1.23.1/x86_64-unknown-linux-gnu/rustup-init
Resolving static.rust-lang.org (static.rust-lang.org)... 65.8.17.19, 65.8.17.81, 65.8.17.112, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|65.8.17.19|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12817272 (12M) [binary/octet-stream]
Saving to: 'rustup-init'

     0K ........ ....                      100% 19.3M=0.6s

2021-03-25 03:14:59 (19.3 MB/s) - 'rustup-init' saved [12817272/12817272]
@havenwood
Copy link
Collaborator

My only concern is portability. It might be worth considering how broadly this works but spot checking it seems good. Also, works on my machine!

@postmodern
Copy link
Owner

Great idea, although I tend to not recommend using ruby-install in a Dockerfile (manually building ruby or using the official ruby docker images is probably easier). Alternatively, we should pass --quiet to wget if stdout is not a TTY? We would also need to make a similar change to the curl command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants