Remotes management is way too long
This is tangentially related to #823.
Currently,adding a remote will automatically update the cache of available packages. We did this because at the time, the main interaction was adding a remote manually in the terminal, which Yohan was doing when he deployed the first few boxes that had access to the catalog.
Since then, the situation has changed:
- everything is automatically done in Ansiblecube
- we have multiple remotes
A typical Koombook will have access to 5 or more remotes.
Here's what happens when I add 5 remotes the way Ansiblecube does it:
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:07:38
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |=============| 48.0 KiB/38.6 KiB (0.0 KiB/s) | ETA: 11:07:46
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:07:48
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |=============| 48.0 KiB/38.6 KiB (0.0 KiB/s) | ETA: 11:07:58
Download: 100.00% |==============| 16.0 KiB/2.6 KiB (0.0 KiB/s) | ETA: 11:08:00
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:08:00
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |=============| 48.0 KiB/38.6 KiB (0.0 KiB/s) | ETA: 11:08:10
Download: 100.00% |==============| 16.0 KiB/2.6 KiB (0.0 KiB/s) | ETA: 11:08:12
Download: 100.00% |============| 48.0 KiB/34.7 KiB (16.0 KiB/s) | ETA: 11:08:12
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:08:14
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |==============| 16.0 KiB/2.6 KiB (0.0 KiB/s) | ETA: 11:08:25
Download: 100.00% |=============| 48.0 KiB/34.7 KiB (0.0 KiB/s) | ETA: 11:08:25
Download: 100.00% |==============| 16.0 KiB/4.6 KiB (0.0 KiB/s) | ETA: 11:08:27
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:08:27
Download: 100.00% |============| 48.0 KiB/38.6 KiB (16.0 KiB/s) | ETA: 11:08:27
real 1m1.582s
user 0m58.000s
sys 0m2.730s
That's right, over one minute! That's a big chuck of the time Ansiblecube takes to setup a box. We just download the same things over and over again. And I have fiber at home, so the cost would be much worse on a Koombook at the other end of the world.
If instead we stop updating the cache after adding a remote, and only update it once at the end:
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
IDEASCUBE_ID=kb
Importing settings from ideascube.conf.kb
Download: 100.00% |==============| 16.0 KiB/7.9 KiB (0.0 KiB/s) | ETA: 11:06:10
Download: 100.00% |=============| 48.0 KiB/34.7 KiB (0.0 KiB/s) | ETA: 11:06:11
Download: 100.00% |============| 48.0 KiB/38.6 KiB (16.0 KiB/s) | ETA: 11:06:13
Download: 100.00% |==============| 16.0 KiB/4.6 KiB (0.0 KiB/s) | ETA: 11:06:15
Download: 100.00% |==============| 16.0 KiB/2.6 KiB (0.0 KiB/s) | ETA: 11:06:15
real 0m52.723s
user 0m48.870s
sys 0m3.270s
Isn't that much better?
It's not just the time it takes, though: we should avoid downloading stuff if we can.