Commit Graph

29 Commits

Author SHA1 Message Date
Clark Boylan 6e61cbff2e Stop ansipuppeting the old cgit farm
We have replaced the cgit farm with a gitea farm. Stop managing the cgit
farm. This removes testing for centos7 as these were our only centos7
nodes.

Depends-On: https://review.opendev.org/654549
Change-Id: Ia48ff10cb88d51f609e8b28de176c72f7a9ee24f
2019-04-22 15:50:08 +00:00
Monty Taylor 15663daaf7 Add iptables role
Co-Authored-By: James E. Blair <corvus@inaugust.com>
Change-Id: Id8b347483affd710759f9b225bfadb3ce851333c
Depends-On: https://review.openstack.org/596503
2018-08-27 14:33:32 +00:00
James E. Blair ec69c4706d haproxy: don't manage rsyslog service
Ansible handles rsyslog, so rather than having both systems attempting
to manage the service, just let Ansible do it.  However, we still install
the haproxy rsyslog config file in Puppet for now.  The downside of that
is that an initial server build, or change to the config file, will not
cause rsyslog to reload.  That will need to be done manually until the
rest of this is ported to Ansible.

Change-Id: I19060fddf55e7e9f7030e49592f20a4a7faca429
2018-08-17 11:37:58 -07:00
Monty Taylor bab6fcad3c
Remove base.yaml things from openstack_project::server
Now that we've got base server stuff rewritten in ansible, remove the
old puppet versions.

Depends-On: https://review.openstack.org/588326
Change-Id: I5c82fe6fd25b9ddaa77747db377ffa7e8bf23c7b
2018-08-16 17:25:10 -05:00
Ian Wienand 35f7f0dd78 Add python2-statsd for haproxy stats
We haven't been receiving any stats since presumably the server
upgrade, because the statsd package wasn't installed.

Change-Id: I98d2625e5a44e9c416baca2fc60eb5304a08a58a
2018-06-12 10:10:08 +10:00
Ian Jackson f5f9e47e51 Increase git daemon haproxy timeout
On a slow computer, this rune fails:

  git clone -q --mirror git://git.openstack.org/openstack/nova.git nova </dev/null >log 2>&1

Having straced and tcpdumped, what seems to happen is that the server
sends a list of all the refs and corresponding object ids.  Then the
client spends quite a while thinking.  Firstly the git client process
sits on the cpu for a while, and then it spends a while statting files
correspondong to the various objects.

This thinking takes much longer than is usually the case for `git
clone' because the nova.git repo contains so many refs (>100K refs).

I was only able to repro the problem on a somewhat overloaded VM, and
only with -q and redirecting output to files.  I conjecture that git
does something slightly different if it wants to print progess info.

(The practical problem for me is that this causes our git caching
proxy to be unable to clone nova.git.)

In my tests, the slow system took 2 mins 48 seconds between being told
the last ref, and coming back to start asking for objects.  This time
may well be significantly longer on an even slower computer.

I suggest setting the timeout to 15 minutes, which gives a factor of 5
safety margin over what I actually observed.

NB that I have not been able to actually test this change.

Change-Id: I0e6c00564fdc91dcd6933c17965c493553f8aea3
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2016-12-14 07:27:11 -08:00
James E. Blair 86372b0dcf Sent HAProxy stats to statsd
This adds a script and associated config/init files to periodically
read stats from HAProxy and send them to statsd/graphite.

Change-Id: I77122feacee406b12b3cd0159449c449f2bd35c1
2015-11-23 17:23:10 -08:00
Clark Boylan 944e09e769 Allow haproxy to bind to all ports in selinux
By default haproxy can only bind to HTTP(S) ports all other ports can't
be bound due to the selinux policy. Simple fix for this is to toggle the
boolean that allows haproxy to bind any port in the selinux policy. Do
this with an exec that first checks if the boolean is set.

Change-Id: I49c8bdc3586fa82cd954a6ef9be27f48f9a623ec
2015-11-20 12:18:06 -08:00
Timothy Chavez e130792ed9 Parameterize setting the selinux mode
By parameterizing the selinux mode we can set the mode and pass the mode
to other classes so they can make decisions on whether or not to run
selinux commands as part of their configuration.

Depends-On: I21add092d9d09077f2b23760a384f5a5cb91d86a
Change-Id: I86a5bb006b6ab9d64f7fbd894c967428cfaed8f8
2015-09-10 13:38:53 -05:00
Clark Boylan 07e07186c8 Switch to centos7 git01 and git02 hosts
Continue the great switch to centos7 for git backends and replace git01
and 02. Since these are the last two backends to be swapped out switch
the balance method back to leastconn as we will go back to having
homogenous git backends and can get away with leastconn balancing.

Change-Id: Ib3180587892bb46b3dc9d6a7dea28a28da85c3b3
2015-09-03 16:02:38 -07:00
Clark Boylan 431da49406 Use source balancing to transition to centos7
We currently see some odd behavior with shallow clones using the
leastconn balance method. Theory is that having a mix of centos6 and
centos7 git backends introduces this as a client may end up talking to
different git versions on the backends. Using a specific backend never
has an issue but using the haproxy load balancer does have problems
occasionally.

Work around this by forcing each client to use a single backend via the
source haproxy balance method. Then when the entire cluster of backends
is centos7 based we can switch back to leastconn balancing.

Change-Id: If78ff254388870f90a8b1f4821f4eef98f616d64
2015-09-02 07:24:56 -07:00
Jeremy Stanley 710fec8521 Increase git haproxy maxconn from 32 to 256
It seems from the logs that we're regularly hitting the max 32
connections limit in haproxy for the git protocol backend under
periods of moderate to high load. Increase this to 256, and also
increase the backlog to 256 so that we can have up to one backlogged
connection per active connection.

In theory 256 should be a sane max since we have leastconn balancing
across 8 backends running persistent git-daemon with its default max
connections value of 32.

Change-Id: I80785348b8abb831a2f833a535a5e4234ce3e7f3
2015-07-17 17:12:24 +00:00
James E. Blair 6af76957e5 Switch git haproxy from balance source to leastconn
Switch from balancing across backends based on source ip address
hash to least number of connections.

Because we have git repos of many sizes, some of which take seconds
to clone, others minutes, we can end up with a load imbalance across
our git backends.  Further, organizations that use NAT to put a
large number of systems behind a single IP address further exacerbate
the imbalance.  Switch to least-connections for load balancing to
better utilize our backends, and hopefully smooth peak loads across
them.

Change-Id: I7ea5e2ff0c98c46237a975989bd014149de01b04
2015-06-20 15:25:58 -07:00
Joshua Hesketh 2213b782df Up the haproxy timeout for git-fe*
Currently we are hitting the limit on cloning nova (and apparently
maybe neutron) where the connection is reset during the
git-upload-pack and the clone fails.

Try increasing the HAProxy defaults.

Change-Id: I0072742f82a54b492395cb7db45e2946c6d841c7
2015-06-17 22:58:40 +10:00
Clark Boylan 6ab8bd166a Install lsof on the git mirror nodes
lsof is a very valuable tool for debugging connectivity issues. It is
not installed on our centos6 nodes by default. Install it here so that
we have it available for debugging connections issues.

Change-Id: I836b6bb4e852a2fbbff8d3a1620920de8d03b112
2014-11-20 14:58:27 -08:00
K Jonathan Harker c29a9dd8df Only include selinux bits on rhel-based systems
The gate-config-puppet-apply test will try to run everything on a
bare-precise node, so even though this doesn't occur in production it is
being tested.

Change-Id: I13b03a7476e30cbb26dc820bb4cf5b56c4018669
2014-05-30 15:36:07 -07:00
Jeremy Stanley 9f0d0dfc83 Fix rsyslog duplicate declaration for git.o.o
It's already declared in the template class, which is included by
the git class.

Change-Id: I94b660f13f93a459a9c130804f0d9b3409055138
2014-02-27 00:12:55 +00:00
Clark Boylan 85c01e9f50 Update git.o.o configs for better rolling reboots
* modules/openstack_project/manifests/git.pp: Give the haproxy stats
socket admin level permissions. Make the socket owned by user root and
group root with mode of 0600. This is necessary to provide instructions
to enable and disable backend servers through the stats socket. Also,
install socat on this server so that commands can be given through the
stats socket.

* modules/openstack_project/manifests/git.pp: Enable git-daemon service
so that it starts running at boot.

Change-Id: Ic38114bdbd9fd1e9ab711e636deaadb15f9c7fe3
2013-10-25 11:18:22 -07:00
Clark Boylan 1c0c4b18df Move location of haproxy rsyslog conf file.
The haproxy rsyslog config file was left in the cgit module despite
pulling the haproxy stuff out of cgit and putting it in
openstack_project. Move the rsyslog config file into the
openstack_project module where it belongs.

Change-Id: I0fc45f7497f0f2682bbc5c7ae0da546a71b67188
2013-08-28 15:53:38 -07:00
Clark Boylan f22f8f5aa1 Split git.o.o haproxy out of cgit module.
* manifests/site.pp: Use distinct manifests for git.o.o and git.o.o
backends. This allows for the haproxy server to not serve git content
and purely be a load balancer.

* modules/cgit/manifests/init.pp: Remove haproxy from cgit module.
Remove stale xinetd cleanup. Select git daemon port when selecting
HTTP(S) ports.

* modules/openstack_project/manifests/git.pp: Make git.pp a manifest to
load balance git servers with haproxy.

* modules/openstack_project/manifests/git_backend.pp: New manifest to
manage servers that actually serve git content. They sit behind a load
balancer.

* modules/openstack_project/manifests/review.pp: Stop replicating repos
to git load balancer.

Change-Id: I343a0d1e0a7b93874c2e2299ed974a3304957efb
2013-08-26 12:05:26 -07:00
James E. Blair 491363edd6 Add a mirror repack cron to git servers
Like the one on gerrit, but this one adds pack-refs (because
the git server on centos seems to deal with that better).

Change-Id: I1ed497a3690d2c030408010dbd56b6cd916b47fa
2013-08-22 12:14:49 -07:00
Clark Boylan dea75ed695 Load balance git requests.
* install_modules.sh: Add puppetlabs-haproxy forge module.

* modules/cgit/manifests/init.pp: Add haproxy config to load balance
https, https and git protocol git access. Each git server will host git
http on port 8080, https on port 4443 and git protocol on 29418. These
endpoints will then be load balanced by a single haproxy instance
listening on ports 80, 443 and 9418. The use of haproxy and having
services listen on offset ports to accomodate haproxy is toggleable
using the $balance_git and $behind_proxy boolean flags.
Additionally, configure rsyslog for haproxy.

* modules/cgit/files/rsyslog.haproxy.conf: Enable syslog over UDP on
port 514. This is needed by haproxy to perform logging. Send local0
messages to /var/log/haproxy.log.

* modules/cgit/templates/ssl.conf.erb: Make Apache https listen port
configurable. Remove default virtualhost.

* modules/cgit/templates/httpd.conf.erb: Make Apache http listen port
configurable.

* modules/cgit/templates/git.vhost..erb: Make Apache http(s) listen
ports configuruable. Allow http without redirecting to https as a
fallback option to accomodate CentOS clients.

* modules/openstack_project/manifests/git.pp: Pass load balancer
variables through to the cgit manifest.

* manifests/site.pp: Configure git.o.o to run the load balancer haproxy
and balance across the new gitXX.o.o nodes.

Change-Id: Icefc5923cff9a7c6ce62c1923ec2ea87ebc6474a
2013-08-22 10:52:04 -07:00
Elizabeth Krumbach Joseph 8dd215bece Add static web directory for cgit & initial files
Create and define a static directory for cgit to use.

Add initial favicon and logo files and include in cgitrc.

Also include custom CSS and background image.

Change-Id: If1e20d8e62557cc90aafbf92f4291b964400e029
2013-08-16 16:41:30 -07:00
Elizabeth Krumbach ceb405b4bb Fix ssl location for git.o.o on CentOS
Attempted to put Apache ssl certificates for git.o.o into the
/etc/ssl/ and /etc/ssl/ directories, but this is a bit of a
Debianism. Updating to RedHat style /etc/pki/tls directories.

Change-Id: Icb83ee2601d29ad679e7c8503a406faeb5153727
2013-08-07 21:22:40 -07:00
Elizabeth Krumbach 64dd0f2b8f Fix double-declaration of cgit class
The cgit class was declared twice, fixing up syntax so it's not.

Change-Id: I94691090e9c5fb49153dbc89ed414e2e7a37afa4
2013-08-07 16:33:55 -07:00
Elizabeth Krumbach 8b81e9d213 Add httpd ssl support to git.openstack.org
Certificates have been added to hiera, now adding the support for
https in a new apache file.

Change-Id: I8447d60a15779b103556e53f04accf671dbf4843
2013-08-06 16:26:52 -07:00
Elizabeth Krumbach 753d8813ad Fix jeepyb class issue on git.o.o
Of course jeepyb::git doesn't really exist, so class failed in
initial attmept to fix missing variables. Moved variables and
comment to an existing class.

Change-Id: I172588eae4b03427f1ee7862073cd50ca4e5a14e
2013-07-19 14:53:36 -07:00
Elizabeth Krumbach f33d45dca6 Add jeepyb & cgit repo creation script to git.o.o
Includes the jeepyb and required pip modules to the new
git.openstack.org server.

Also installs and sets up the create_cgitrepos.py script for
creating the /etc/cgitrepos configuration file

Change-Id: I06606ca73541dd328f413bfdbd2810fe66ca633b
2013-07-19 10:11:59 -07:00
Elizabeth Krumbach 52732dd550 Add cgit web service and git server
Define git.openstack.org server and deploy cgit web service with
Apache on CentOS.

Change-Id: Id3c7c870e25e4202915bc081454896895084f9af
2013-07-16 09:55:11 -07:00