Using Deb Proxy to cache Debs to minimize time starting-up machines and its installation scripts

John Meinel john at arbash-meinel.com
Thu Jul 6 07:13:04 UTC 2017


For what its worth, I use "apt-cacher-ng" to do this very thing and have
~/.local/share/juju/clouds.yaml:
clouds:
  lxd:
    type: lxd
    config:
      apt-http-proxy: http://192.168.0.106:3142
      apt-https-proxy: http://192.168.0.106:3142
      enable-os-upgrade: false

As long as you're keeping your images up to date (which is an attribute of
the LXD images which Juju should be setting with newer versions), then you
don't really need the 'apt upgrade' step because it just spends time to
find there is nothing new.

IIRC, I didn't have to do any custom configuration on apt-cacher-ng, nor
did I have to expose it to the bridge, because my host is already
configured to allow containers to talk to the host, so I can just configure
the hosts local network address. (I also use this same proxy for my local
MAAS deployment, so the apt cache gets used either way).

I don't know if there are advantages to squid-deb-proxy vs apt-cacher-ng, I
just found that "apt install apt-cacher-ng" and then setting the cloud
config was sufficient. (apt-cacher-ng also puts up a web page at a specific
port so you can see if the cache is getting used and what the hit/miss rate
is.)

John
=:->



On Thu, Jul 6, 2017 at 2:13 AM, Menno Smits <menno.smits at canonical.com>
wrote:

> Hi Naz,
>
> I use squid-deb-proxy to speed up deployments and it works well. If you're
> using the lxd provider install the proxy on the host machine so that all
> controllers and models benefit from the packages cached during previous
> deployments.
>
> Ensure that squid-deb-proxy is configured to listen on the address of the
> lxdbr0 bridge and remember to tell your Juju controllers and models to use
> the proxy via the apt-http-proxy option. There's more detail on setting
> this up here:  https://github.com/juju/juju/wiki/Faster-LXD . There a
> suggestion at the bottom of the page for defining a custom cloud type which
> includes the options for speeding up test/development deployments. That
> might be a good starting point for you.
>
> Regards,
> Menno
>
>
>
> On 6 July 2017 at 07:17, N. S. <n5pascal at hotmail.com> wrote:
>
>> Hi,
>>
>> I am running juju latest version on local LXD.
>>
>> When deploying services,
>>
>> FOR each new machine, the "cloud init log" of the LXC in question
>> captures some "apt-get install <some debs>"
>> before starting up the machine and then i see that it's up to the
>> "install" hook to install additional software and configure them.
>>
>> In my situation,
>> I have some repetitive machines.
>>
>>
>> I am thinking of using SQUID DEB PROXY or SIMILAR to cache the Debs for
>> faster deploy of subsequent machines.
>>
>> My questions are:
>>
>> I.
>> Where should I install and configure SQUID DEB PROXY or a similar PROXY?
>> Is it on
>> 1.
>> The host machine running the LXD including the controller juju-abcd-0?
>> Or
>> 2.
>> The controller machine juju-abcd-0 itself?
>>
>> So that I increase the "hit" rate of the needed-to-be-downloaded Debs and
>> decease the readiness time?
>>
>> II. What proxy do you recommend?
>>
>>
>> Thanks
>> Br
>> Naz
>>
>>
>>
>> --
>> Juju mailing list
>> Juju at lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
>> an/listinfo/juju
>>
>>
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20170706/81be9f8c/attachment.html>


More information about the Juju mailing list