12 Commits

Author SHA1 Message Date
Ian Wienand
f8ca888b2b install-docker: remove fix from prior change
This file is now removed (I0cbcd4694a4796573fe48383756be03597d2da0f);
get rid of this to avoid any confusion.

Change-Id: I837d1fccbfa2461eb1315eac54c2a017fcb86511
2021-02-25 09:19:02 +11:00
Ian Wienand
3303199ba6 install-docker: move rsyslog handler earlier
This syslog configuration is what sends any logs with a program-name
of "docker-<foo>" to /var/log/containers/foo.log.  However, at 98-
level the rules are after the default 50- rules, so we're seeing the
logs copied to both syslog and /var/log/containers.  Since this
contains a "stop" command, we should move this earlier before the
default rules and the docker logs will not be duplicated.

Change-Id: I0cbcd4694a4796573fe48383756be03597d2da0f
2021-02-25 09:16:16 +11:00
Ian Wienand
54a62d9aaf install-docker: stop duplicated rsyslog logs
I missed a "stop" command in the rsyslogd capture introduced with
I940a5b05057e832e2efad79d9a2ed5325020ed0c.  This means logs were also
falling though and being put into /var/log/syslog as well, which was
not the intent.

Add the stop command so the logs only go to the container logfile.

Change-Id: I8c577fe259de68178404d74e0bea543691af7d87
2020-11-25 11:23:15 +11:00
Ian Wienand
694241ad77 docker: install rsyslog to capture container output
This started with me wondering why gerritbot was putting all its
output into /var/log/syslog -- it turns out Xenial docker is
configured to use journalctl (which forwards to syslog) and Bionic
onwards uses json-file.

Both are sub-optimial; but particularly the json-file because we lose
the logs when the container dies.  This proposes moving to a more
standard model of having the containers log to syslog and redirecting
that to files on disk.

Install a rsyslog configuration to capture "docker-*" program names
and put them into logfiles in /var/log/containers.  Also install
rotation for these files.

In an initial group of docker-compose files, setup logging to syslog
which should then be captured into these files.  Add some basic
testing.

If this works OK, I think we can standardise our docker-compose files
like this to caputure the logs the same everywhere.

Change-Id: I940a5b05057e832e2efad79d9a2ed5325020ed0c
2020-10-19 16:06:03 +11:00
Clark Boylan
3966bcdf4e Add dev packages on arm64 for docker-compose installation
We install docker-compose from pypi in order to get newer features
(particularly useful for gerrit). On x86 all the deps for this have
wheels and we don't need build deps but on arm64 wheels don't exist for
things like cffi. Add build-essential, python3-dev, libffi-dev, and
libssl-dev to ensure we can build the necessary deps to install
docker-compose on arm64.

Change-Id: Id9c61dc904d34d2f7cbe17c70ad736a9562bb923
2020-09-08 13:01:34 -07:00
Ian Wienand
ecad907fd8 install-docker: remove arch match
There's no need to force the arch match in the sources.list; this
breaks arm64 installs.

Change-Id: If7bbfc567e117d3dabc3ba97a8701fa7b9db02f3
2020-04-30 08:38:41 +10:00
Clark Boylan
5141306c71 Cleanup unneeded things post docker-compose upgrade
The zookeeper role can use the default pip installed docker-compose now.
We can also stop ensuring the distro package is removed as this has run
on all hosts at this point.

Change-Id: Ia034ae7d2c8e38494050698e1bfac0cc273dd200
2020-04-20 09:47:12 -07:00
Clark Boylan
02a81a5c7f Install pip3 for docker-compose installation
We need newer docker-compose for functionality like stop_grace_period
and the easiest way to get that is via pypi. To install from there we
need pip.

This also fixes pip3 to work on xenial which doesn't have a
python3-distutils package.

Change-Id: I5f5431cac7eb191f2f5443892292ca5a236fe1e6
2020-04-17 13:28:03 -07:00
Clark Boylan
8eb981b47f Install docker-compose from pypi
We want to use stop_grace_period to manage gerrit service stops. This
feature was added in docker-compose 1.10 but the distro provides 1.5.
Work around this by installing docker-compose from pypi.

This seems like a useful feature and we want to manage docker-compose
the same way globally so move docker-compose installation into the
install-docker role.

New docker-compose has slightly different output that we must check for
in the gitea start/stop machinery. We also need to check for different
container name formatting in our test cases. We should pause here and
consider if this has any upgrade implications for our existing services.

Change-Id: Ia8249a2b84a2ef167ee4ffd66d7a7e7cff8e21fb
2020-04-16 12:08:00 -07:00
Monty Taylor
8725a1ee53 Squash two ansible warnings
Add bool to use_upstream_docker conditional

This is an ansible behavior change that's coming in 2.12 but is
currently spewing warnings. The warnings make the log really hard
to read, so just fix it.

Disable group name auto-renaming

If you have group names with non-python identifier characters, it
prevents you from looking it up in jinja like "groups.group-name"
so ansible auto-transforms it so you can do "groups.group_name".
This is a confusing behavior which is going away. However, ansible
is warning everyone who has groups with characters in them as it
has no idea how you might be accessing those group names. Add
a config setting to suppress the warning about -'s in group names.

Change-Id: Ib3262025799af7c3171ed0b079cb1dd969075931
2019-10-20 08:02:43 +09:00
James E. Blair
bf2d53eb7d Don't install a blank docker daemon config
It's not necessary to install an empty config file, and doing so
will prevent us from using other roles to configure mirrors on
test hosts.

Change-Id: I3d7eb615f1e297fde2d693b5fc64bc6e691e2c22
2019-02-20 09:09:52 -08:00
Ian Wienand
f07bf2a507 Import install-docker role
This is a role for installing docker on our control-plane servers.

It is based on install-docker from zuul-jobs.

Basic testinfra tests are added; because docker fiddles the iptables
rules in magic ways, the firewall testing is moved out of the base
tests and modified to partially match our base firewall configuration.

Change-Id: Ia4de5032789ff0f2b07d4f93c0c52cf94aa9c25c
2018-12-14 11:30:47 -08:00