188 Commits

Author SHA1 Message Date
James E. Blair
96bac7b486 Add zookeeper-statsd
This adds a program, zookeeper-statsd, which monitors zookeeper
metrics and reports them to statsd.  It also adds a container to
run that program.  And it runs the container on each of the
ZooKeeper quorum members.  And it updates the graphite host to
allow statsd traffic from quorum members.  And it updates the
4-letter-word whitelist to allow the mntr command (which is used
to gather metrics) to be issued.

Change-Id: I298f0b13a05cc615d8496edd4622438507fc5423
2021-03-17 14:52:31 -07:00
Clark Boylan
680ed17ecd Add new opendev.org nodepool launchers
This adds the new focal nodepool launchers replacements for nl02-04 to
our inventory. This will configure them with an idle configuration. We
then confirm they are happy running in an idle state then switch over
the config from the old to new servers.

Depends-On: https://review.opendev.org/c/openstack/project-config/+/780982
Change-Id: Iea645925caaeee6f498aa690c4f2c848f6899317
2021-03-16 15:21:58 -07:00
Zuul
6df7767200 Merge "Add nl01.opendev.org to our inventory" 2021-03-16 16:45:48 +00:00
Clark Boylan
3f2dd0e681 Enable srvr, stat and dump commands in the zk cluster
Zookeeper supports a number of "4 letter" commands [0] which are useful
for debugging and general diagnostics. By default only srvr is enabled,
but we want to add stat and dump to see details on server and client
connection statuses.

We do this via the 4lw.commands.whitelist configuration option [1] and
not the docker image env vars because we're mounting a zoo.cfg in
already.

[0] https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_4lw
[1] https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_clusterOptions

Change-Id: I24ea9b37cd5766c9d393106e8eab34623cad1624
2021-03-15 16:57:21 -07:00
Clark Boylan
ed61423b6b Add nl01.opendev.org to our inventory
This is a new focal replacement for nl01.openstack.org. We keep
nl01.openstack.org in our inventory for now because we want ansible to
update the nodepool.yaml configs for these two hosts to coordinate a
hand off of responsibilities once we are happy with the new deployment.

We also switch the testing hostname to nl04.openstack.org as this will
be the last nodepool launcher to be removed. When we swap it out the
testing will be updated to use focal hosts.

Depends-On: https://review.opendev.org/c/openstack/project-config/+/779863
Change-Id: Ib3ea6586fe0567c1edf6255ee9be50164d35db62
2021-03-15 09:48:22 -07:00
Martin Kopec
834e39fc7e refstack: Edit URL of public RefStackAPI
The previous refstack server had 'api' in the endpoint
addresses of API calls. Let's try to set it in the new
instance as well to keep the same interface.

Also, fix the typo in the testinfra host match and in
the test name.

Change-Id: I7319990144396b3a753678975a09b0add3ac4465
2021-03-10 14:09:20 +11:00
Zuul
d1ac0aee2d Merge "etherpad: fix robots.txt" 2021-02-24 00:02:04 +00:00
Ian Wienand
5a1b8ac179 grafana: take some screenshots during testing
Take some simple screenshots for basic validation of any new releases.

Change-Id: I52770032a6cc91d76da23194f58474f5ceeaed38
2021-02-17 10:43:26 +11:00
Ian Wienand
c7de005738 grafana: ensure snapshots api returns a 403
Change-Id: I216528a76307189d8d87bd2fcfeff95c6ceb53cc
2021-02-15 17:01:15 +11:00
Zuul
03f5e8e0de Merge "borg-backup-server: run a weekly backup verification" 2021-02-11 05:53:16 +00:00
Ian Wienand
0d01d941b1 borg-backup-server: run a weekly backup verification
This checks the backup archives and alerts us if anything seems wrong.
This will take a few hours, so we run once a week.

Change-Id: I832c0d29a37df94d4bf2704c59bb3f8d855c3cc8
2021-02-11 00:43:16 +00:00
Zuul
7da2eeb05f Merge "borg testing: catch stdout and stderr from test prune correctly" 2021-02-10 01:33:36 +00:00
Zuul
1d79574d82 Merge "borg-backup-server: add script for pruning borg backups" 2021-02-10 01:28:33 +00:00
Ian Wienand
1a3ae8cdd8 borg testing: catch stdout and stderr from test prune correctly
Change-Id: I783b319c9395b8bfabec8f8670d0cbc1419f5e1e
2021-02-10 10:05:07 +11:00
Zuul
f526060e39 Merge "Deploy refstack with ansible docker" 2021-02-09 03:58:22 +00:00
Ian Wienand
4f0bfa6d9d borg-backup-server: add script for pruning borg backups
This adds a script that performs a manual pruning of backup
directories.

Change-Id: I9559bb8aeeef06b95fb9e172a2c5bfb5be5b480e
2021-02-09 11:29:46 +11:00
Clark Boylan
a4604ae0b3 Deploy refstack with ansible docker
This adds a dockerfile to build an opendevorg/refstack image as well as
the jobs to build and publish it.

Change-Id: Icade6c713fa9bf6ab508fd4d8d65debada2ddb30
2021-02-05 19:23:34 +00:00
Clark Boylan
523bab52fc Check that git clone against x/ project succeeds in testing
Previously the test was checking that stderr reported "Cloning into
$PATH" which also happens in failure cases. We add an explicit check for
a successful command return code to ensure that we aren't failing with
that output.

Change-Id: Iec51217f2cc97e6a56ff9d8b7a260650010f229f
2021-02-01 08:16:21 -08:00
Clark Boylan
d292d853e9 Test x/ project clones in Gerrit
This will help us catch any regressions in our workaround for handling
x/ routes in Gerrit. We update the test project in Gerrit to be
x/test-project then add a testinfra test to clone it.

If we can clone x/test-project then our workaround continues to
function.

Change-Id: I50e4cb1a5d3c9f7c4405500f09bf6c3be3e7df9c
2021-02-01 16:19:46 +11:00
Ian Wienand
9f4cbcfbc2 Expand gerrit testing to multiple changes
This reworks the gerrit testing slightly to give some broader
coverage.

It sets up ssh keys for the user; not really necessary but can be
helpful when interacting on a held host.

It sets up groups and verification labels just so Zuul can comment
with -2/+2; again this is not really necessary, but makes things a
little closer to production reality.

We make multiple changes, so we can better test navigating between
them.  The change comments are updated to have some randomness in them
so they don't all look the same.  We take screen shots of two change
pages to validate the navigation between them.

Change-Id: I60b869e4fdcf8849de836e33db643743128f8a70
2021-02-01 14:06:08 +11:00
Ian Wienand
738b4ba739 gerrit: Install zuul-summary-results plugin
This installs the zuul-summary-results plugin into our gerrit
container.  testinfra is updated to take a screenshot of the plugin in
action.

Change-Id: Ie0a165cc6ffc765c03457691901a1dd41ce99d5a
2021-01-18 07:58:23 -08:00
Ian Wienand
d1694d4c98 gerrit: Initalize in testing
By setting the auth type to DEVELOPMENT_BECOME_ANY_ACCOUNT and passing
--dev to the init process, gerrit will create an initial admin user
for us.  We leverage this user to create a sample project, change,
Zuul user and sample CI result comment.

We also update testinfra to take some screenshots of gerrit and report
them back.

Change-Id: I56cda99790d3c172e10b664e57abeca10efc5566
2021-01-18 07:58:23 -08:00
Clark Boylan
4d41c1002c Fix review01's fqdn in infratesting
This server is canonicallly named review01.openstack.org in inventory.
We need to use that inventory name in our testing.

Change-Id: I1d16469f5abb764978945b5209e01a4e7d2ccb3d
2021-01-18 07:58:23 -08:00
Ian Wienand
595dfd1166 system-config-run-review: remove review-dev server
We don't need to test two servers in this test; remove review-dev.
Consensus seems to be this was for testing plans that have now been
superseded.

Change-Id: Ia4db5e0748e1c82838000c9b655808c3d8b74461
2020-12-15 11:09:17 +11:00
Ian Wienand
927046f18a bup: Remove from hosts
To complete our transition to borg backups, remove bup-related bits
from backup hosts.  All hosts have been backing up with borg since
Ic3adfd162fa9bedd84402e3c25b5c1bebb21f3cb.

Change-Id: Ie99f8cee9befee28bcf74bff9f9994c4b17b87ff
2020-12-11 09:09:53 +11:00
Zuul
e48ac000e3 Merge "codesearch: Add robots.txt" 2020-11-23 05:41:33 +00:00
Zuul
03edbd8b14 Merge "docker: install rsyslog to capture container output" 2020-11-20 09:12:23 +00:00
Ian Wienand
90106e917a etherpad: fix robots.txt
Fix the path to robots.txt and ensure it exists with testinfra

Change-Id: Iacf9db38ee61cb8f17f261b422c0f2ac1d0b5e45
2020-11-20 19:13:37 +11:00
Ian Wienand
1288de67aa codesearch: Add robots.txt
We don't want anything on the codesearch page indexed

Change-Id: I556b77013cf1b7ff2c03426fea92a6d445131f6d
2020-11-20 19:13:32 +11:00
Ian Wienand
368466730c Migrate codesearch site to container
The hound project has undergone a small re-birth and moved to

 https://github.com/hound-search/hound

which has broken our deployment.  We've talked about leaving
codesearch up to gitea, but it's not quite there yet.  There seems to
be no point working on the puppet now.

This builds a container than runs houndd.  It's an opendev specific
container; the config is pulled from project-config directly.

There's some custom scripts that drive things.  Some points for
reviewers:

 - update-hound-config.sh uses "create-hound-config" (which is in
   jeepyb for historical reasons) to generate the config file.  It
   grabs the latest projects.yaml from project-config and exits with a
   return code to indicate if things changed.

 - when the container starts, it runs update-hound-config.sh to
   populate the initial config.  There is a testing environment flag
   and small config so it doesn't have to clone the entire opendev for
   functional testing.

 - it runs under supervisord so we can restart the daemon when
   projects are updated.  Unlike earlier versions that didn't start
   listening till indexing was done, this version now puts up a "Hound
   is not ready yet" message when while it is working; so we can drop
   all the magic we were doing to probe if hound is listening via
   netstat and making Apache redirect to a status page.

 - resync-hound.sh is run from an external cron job daily, and does
   this update and restart check.  Since it only reloads if changes
   are made, this should be relatively rare anyway.

 - There is a PR to monitor the config file
   (https://github.com/hound-search/hound/pull/357) which would mean
   the restart is unnecessary.  This would be good in the near and we
   could remove the cron job.

 - playbooks/roles/codesearch is unexciting and deploys the container,
   certificates and an apache proxy back to localhost:6080 where hound
   is listening.

I've combined removal of the old puppet bits here as the "-codesearch"
namespace was already being used.

Change-Id: I8c773b5ea6b87e8f7dfd8db2556626f7b2500473
2020-11-20 07:41:12 +11:00
Zuul
77c930c2bb Merge "grafana: fix typo in test name" 2020-11-05 22:38:02 +00:00
Ian Wienand
a529cdc221 grafana: fix typo in test name
Change-Id: I1365432255dce16e3ad3294d78300a8f72f5f689
2020-11-05 13:57:04 +11:00
Ian Wienand
eb07ab3613 borg-backup: add fuse
Add the FUSE dependencies for our hosts backed up with borg, along
with a small script to make mounting the backups easier.  This is the
best way to recover something quickly in what is sure to be a
stressful situation.

Documentation and testing is updated.

Change-Id: I1f409b2df952281deedff2ff8f09e3132a2aff08
2020-11-05 11:56:46 +11:00
Ian Wienand
77eb5dfb66 reprepro: install keytab
In converting this to ansible I forgot to install the reprepro keytab.
The encoded secret has been added for production.

Change-Id: I39d586e375ad96136cc151a7aed6f4cd5365f3c7
2020-10-27 15:14:47 +11:00
Ian Wienand
5596d57be7 reprepro: fixup script name
Everything expects this to be called 'reprepro-mirror-update' (no
.sh); rename the file.

Change-Id: I8ec6ff4ed2afe6487959ef56dc0603f9d316d1a3
2020-10-27 15:09:46 +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
Ian Wienand
3eceba5749 reprepro: convert to Ansible
This converts the reprepro configuration from our existing puppet to
Ansible.

This takes a more direct approach; the templating done by the puppet
version started simple but over the years grew several different
options to handle various use-cases.  This means you not only had to
understand the rather obscure reprepro configuration, but then *also*
figure out how to translate that from our puppet template layers.

Here the configuration files are kept directly (they were copied from
the existing mirror-update.openstack.org) and deployed with some light
wrapper tasks in reprepro/tasks/utils which avoids most duplication.

Note the initial cron jobs are left disabled so we can run some manual
testing before letting it go automatically.

Change-Id: I96a9ff1efbf51c4164621028b7a3a1e2e1077d5c
2020-10-19 14:06:57 +11:00
Clark Boylan
9b6398394d Remove docker v1 registry proxy from our mirrors
Docker has long planned to turn this off and it appears that they have
done so. Planning details can be found at:
https://www.docker.com/blog/registry-v1-api-deprecation/

Removing this simplifies our configs as well as testing. Do this as part
of good hygiene.

Change-Id: I11281167a87ba30b4ebaa88792032aec1af046c1
2020-10-16 12:35:37 -07:00
Ian Wienand
a86ba4590b install-borg: bump to latest version
Since we haven't used this anywhere yet, let's start with the latest
version.

Fix role matching for job too.

Change-Id: I22620fc7ade8fbdb664100ef6b6ab98c93d6104f
2020-10-12 15:07:38 +11:00
Ian Wienand
03727e4941 tarballs.opendev.org: better redirects
This matches the file, which got lost in my original script because I
didn't quote a $.  Also add some quotes for better grouping.

Change-Id: I335e89616f093bdd2f0599b1ea1125ec642515ba
2020-10-02 12:22:28 +10:00
Zuul
083e8b43ea Merge "Add borg-backup roles" 2020-10-01 07:36:47 +00:00
Clark Boylan
9fdbd56d16 Remove nb04
This was a host used to transition to docker run nodepool builders. That
transition has been completed for nb01.opendev.org and nb02.opendev.org
and we don't need the third x86 builder.

Change-Id: I93c7fc9b24476527b451415e7c138cd17f3fdf9f
2020-09-18 11:12:04 -07:00
Ian Wienand
139dd374ec letsencrypt test: fix email match
It seems acme.sh might have been rewriting this with quotes, and has
now stopped doing that.  Fix the match.

Change-Id: I3c363c498580b79a1a9ed07da6ed3ac72807383b
2020-08-25 14:42:54 +10:00
Clark Boylan
506a11f9d2 Add ansible role to manage gerritbot
This new ansible role deploys gerritbot with docker-compose on
eavesdrop.openstack.org. This way we can run it where the other bots
live.

Testing is rudimentary for now as we don't really want to connect to a
production gerrit and freenode. We check things the best we can.

We will want to coordinate deployment of this change with disabling the
running service on the gerrit server.

Depends-On: https://review.opendev.org/745240
Change-Id: I008992978791ff0a38f92fb4bc529ff643f01dd6
2020-08-07 13:20:18 -07:00
Ian Wienand
028d655375 Add borg-backup roles
This adds roles to implement backup with borg [1].

Our current tool "bup" has no Python 3 support and is not packaged for
Ubuntu Focal.  This means it is effectively end-of-life.  borg fits
our model of servers backing themselves up to a central location, is
well documented and seems well supported.  It also has the clarkb seal
of approval :)

As mentioned, borg works in the same manner as bup by doing an
efficient back up over ssh to a remote server.  The core of these
roles are the same as the bup based ones; in terms of creating a
separate user for each host and deploying keys and ssh config.

This chooses to install borg in a virtualenv on /opt.  This was chosen
for a number of reasons; firstly reading the history of borg there
have been incompatible updates (although they provide a tool to update
repository formats); it seems important that we both pin the version
we are using and keep clients and server in sync.  Since we have a
hetrogenous distribution collection we don't want to rely on the
packaged tools which may differ.  I don't feel like this is a great
application for a container; we actually don't want it that isolated
from the base system because it's goal is to read and copy it offsite
with as little chance of things going wrong as possible.

Borg has a lot of support for encrypting the data at rest in various
ways.  However, that introduces the possibility we could lose both the
key and the backup data.  Really the only thing stopping this is key
management, and if we want to go down this path we can do it as a
follow-on.

The remote end server is configured via ssh command rules to run in
append-only mode.  This means a misbehaving client can't delete its
old backups.  In theory we can prune backups on the server side --
something we could not do with bup.  The documentation has been
updated but is vague on this part; I think we should get some hosts in
operation, see how the de-duplication is working out and then decide
how we want to mange things long term.

Testing is added; a focal and bionic host both run a full backup of
themselves to the backup server.  Pretty cool, the logs are in
/var/log/borg-backup-<host>.log.

No hosts are currently in the borg groups, so this can be applied
without affecting production.  I'd suggest the next steps are to bring
up a borg-based backup server and put a few hosts into this.  After
running for a while, we can add all hosts, and then deprecate the
current bup-based backup server in vexxhost and replace that with a
borg-based one; giving us dual offsite backups.

[1] https://borgbackup.readthedocs.io/en/stable/

Change-Id: I2a125f2fac11d8e3a3279eb7fa7adb33a3acaa4e
2020-07-21 17:36:50 +10:00
Zuul
fdb446f0e3 Merge "testinfra: silence yaml.load() warnings" 2020-07-16 23:45:51 +00:00
James E. Blair
7a32463f9d Revert "Revert "Add Zookeeper TLS support""
This reverts commit 05021f11a29a0213c5aecddf8e7b907b7834214a.

This switches Zuul and Nodepool to use Zookeeper TLS.  The ZK
cluster is already listening on both ports.

Change-Id: I03d28fb75610fbf5221eeee28699e4bd6f1157ea
2020-07-15 15:45:48 -07:00
Ian Wienand
711b2493a9 testinfra: silence yaml.load() warnings
Switch to safe_load to silence warnings in output

Change-Id: If91f79a4648920999de8e6bf6e0c9fec82fde233
2020-07-15 07:03:22 +10:00
Zuul
623c93d632 Merge "gitea: crawler UA reject rules" 2020-07-07 21:10:54 +00:00
Zuul
466e14b5f7 Merge "gitea: Add reverse proxy option" 2020-07-07 21:07:57 +00:00