Page MenuHomePhabricator

set apt to Wikimedia mirror instead of http://nova.clouds.archive.ubuntu.com/ubuntu/
Closed, DeclinedPublic

Description

I noticed on integration-dev.eqiad.wmflabs (and probably everywhere) that apt is configured to point to http://nova.clouds.archive.ubuntu.com/ubuntu/

$ egrep -v '^(#|$)' /etc/apt/sources.list
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ precise main
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ precise main
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ precise-updates main
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ precise-updates main
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ precise universe
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ precise-updates universe
deb http://security.ubuntu.com/ubuntu precise-security main
deb-src http://security.ubuntu.com/ubuntu precise-security main
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe

With so many instances around, I guess we will save quite a bunch of bandwidth and latency by pointing to our own mirror:

https://launchpad.net/ubuntu/+mirror/ubuntu.wikimedia.org-archive
http://ubuntu.wikimedia.org/ubuntu/


Version: unspecified
Severity: enhancement

Details

Reference
bz66121

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:12 AM
bzimport added a project: Cloud-VPS.
bzimport set Reference to bz66121.
bzimport added a subscriber: Unknown Object (MLST).

scott.leea wrote:

Unless I'm doing this wrong, it seems to work. I just had to replace the URLs and then apt-get update -- I tested an nginx install and it worked.

$ egrep -v '^(#|$)' /etc/apt/sources.list
deb http://ubuntu.wikimedia.org/ubuntu/ trusty main
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty main
deb http://ubuntu.wikimedia.org/ubuntu/ trusty-updates main
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty-updates main
deb http://ubuntu.wikimedia.org/ubuntu/ trusty universe
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty universe
deb http://ubuntu.wikimedia.org/ubuntu/ trusty-updates universe
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty-updates universe
deb http://ubuntu.wikimedia.org/ubuntu/ trusty-security main
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty-security main
deb http://ubuntu.wikimedia.org/ubuntu/ trusty-security universe
deb-src http://ubuntu.wikimedia.org/ubuntu/ trusty-security universe

Yup that would do. We need a puppet patch to adjust the sources.list on all labs instances.

I don't think sources.list comes from puppet, though. At least, I just dropped a test line into mine and it persisted over a puppet run.

There's puppet, and sources.list.d, and the original image all involved here. I don't yet know where the changes need to land.

I guess sources.list is the default coming with whatever ubuntu package. We could get puppet to override it entirely maybe?

I think we need both (amend the image + puppet file) so that new instances are built faster and old instances get updated as well. Creating Tools instances takes forever, so if we could at least cut down on the light years to the apt source ... :-)

On second thought and a look at /etc/apt -- shouldn't apt-get already prefer the WMF repo due to /etc/apt/preferences.d/wikimedia{,.pref}?

chasemp subscribed.

I have too many tasks in my backlog and after two years I guess it is safe to say that this will not be done. Seems it is just fine to use Ubuntu/Debian CDN afterall :]

scfc claimed this task.
scfc lowered the priority of this task from Medium to Low.

Looking at modules/labs_vmbuilder/files/postinst.copy, it should be enough to puppetize the change to /etc/apt/sources.list. The VM builders then hand that change down to the images they build. I'll give it a try and benchmark if for example a Toolforge execution node gets spawned faster.

I tested this twice with toollabs::node::compute::general and toollabs::compute (ignoring errors & Co.) with the default sources.list and one pointing to ubuntu.wikimedia.org. In the first test, Puppet's wallclock runtime reduced from 31:02 to 22:33, in the second from 29:54 to 23:06. That's an improvement of roughly a quarter, so I think this is worth pursuing further.

Dzahn raised the priority of this task from Low to Medium.Jan 16 2017, 5:14 PM
Dzahn subscribed.
scfc removed scfc as the assignee of this task.

I still think this is worthwhile to pursue, but it's too "complicated" for my liking in the existing setup. Ideally (IMVHO), /etc/apt wouldn't be set up by copying the VM builder's directory, but with a more declarative approach in vmbuilder.cfg.erb that ensures that the repositories are ready to use at boot. You can achieve some of the same effect with a Puppet exec that changes /etc/apt/sources.list if necessary, but that only adds to a pile of interacting systems that are hard to understand and "race conditions" (> 30 minutes :-)) for the sources for packages that are hard to debug.

With python-vm-builder being unmaintained and somewhat broken, the path to testing a cleaner setup is effectively blocked, so I won't go down that road. As I'm not fond of the Puppet exec solution, I'm closing this issue again as declined.