Commit Graph

41 Commits

Author SHA1 Message Date
Clark Boylan 2e9cd0c803 Retire this repo
The opendev project has been moving away from puppet and this is one of
the puppet modules that is no longer used. To simplify things for us we
are taking the extra step of retiring this repo.

Change-Id: I83b9374c66f13d672800e76e8c10903f82479471
2022-02-17 12:42:55 -08:00
David Shrewsbury bb0f56209d Support aarch64 builders for jemalloc usage
Change-Id: I0af7a221c02615aa81eb5c90bbafdd36b37d25e2
2019-05-06 13:29:24 -04:00
David Shrewsbury d503ffbcdd Enable jemalloc on nodepoolv3 builders + launchers
Depends-On: https://review.opendev.org/656986
Change-Id: I721326d75771198cce0289b6ee21596f0b761467
2019-05-06 09:48:52 -04:00
Clark Boylan 71fe2002e5 Make builder ssl vhost futureparser safe
The builder ssl vhost template looks up vars as if they are local.
Problem is with futureparser and puppet4 these vars don't make it into
the global scope so they aren't valid here. Instead we do explicit
lookup of the values in the correct scope.

Change-Id: I92a6533d47075d8dac404999a6e3b5c4ccea84ed
2019-01-04 16:52:13 -08:00
David Shrewsbury fe2f7811f3 Add openstacksdk logging to nodepool builder
Nodepool now uses openstacksdk in place of shade. Add a logger
for that.

Also, this makes the builder logging config look like the one in
system-config which is, accidentally, the actual logging config
being used right now. I'm going to put up another change to use
the logging config in this repo, which is the correct thing to do
for v3 of nodepool.

Change-Id: I5e6ab0a34e9e5df0ee152b33b01e5266691e6fc6
2018-07-26 10:00:20 -04:00
David Shrewsbury 845ebb93e3 Update nodepool launcher logging
We've moved from shade to openstacksdk.

Change-Id: I13df848ac742a9c2a48b57ef128482bb24637767
2018-07-25 16:25:37 -04:00
Ian Wienand 0fb8056471 Fix ssl key lookup
It seems the scope.lookupvar() doesn't work with non-global variables;
use the @ syntax.  This is copied from puppet-cgit

Change-Id: I38eb50157d25c6c7900a8455eddedb4655c4637d
2018-05-21 14:47:55 +10:00
Ian Wienand c1ca2795c2 Add SSL support in builder
We wish to export the build logs and artifacts via https; not so much
for any security reasons but for transparent-proxy-busting effects.

Add SSL arguments and a template that redirects 80->443 for hosts if
they're passing in key contents.

Change-Id: I8a15333a7c662f3d32fa4045785498dafc87ad53
2018-05-17 13:46:58 +10:00
Clark Boylan 2d269e75a1 Serve qcow2 images from builder http servers
Let people download our qcow2 images to aid in local reproduction of
issues. We only serve the qcow2 files as they are smallest.

Note that this should probably be updated to use a negative match
against qcow2 so that we can ensure only qcow2 is served regardless of
what image formats we are using. Unfortuantely I can't get that to work
with autoindex. If you have ideas feel free to share them.

Change-Id: Ia23e68e87d2126eac2e22d9c3fed8406e2f447cb
2018-04-20 11:28:27 -07:00
Ian Wienand a8682baa18 Enable build logs on builder, web app on launchers
There is currently a confusing array of exporting options for
exporting build and upload logs.  The upload logs have never really
worked, and the info is better given from image-list end-points.  The
build logs since Ia7415d2fbbb320f8eddc4e46c3a055414df5f997 are logged
into separate files into /var/log/nodepool/builds.  With a separate
builder, it can not access the webapp ports provided by the launcher,
so the redirects there are wrong -- and we don't deploy apache on the
launcher to expose them.  If you're using single node anyway, it's
more than likely you have zuul which installs the main website so
can't enable this.

For these reasons deprecate and remove these old settings.

Instead, add a separate flag to each of the builder and launcher.

builder::enable_build_log_via_http will deploy apache and a config
file that exposes /var/log/nodepool/builds

launcher::enable_webapp will deploy apache and redirects to the
internal webapp

Note this does not handle a launcher and builder on the same host;
since the webapp, and indeed refactoring this module in general for
multiple daemons, is under some development, we leave this as a future
task.

Depends-On: https://review.openstack.org/543667
Change-Id: I447886dd32f7f3bc6758ffd7a1b725689d04ee68
2018-02-13 14:15:03 +11:00
Paul Belanger dae2c5809f
Add kazoo logging to nodepool
Both launcher and builder now use kazoo, we should at least log INFO
logging. This will help see what is going on when we loose connection
to zookeeper.

Also remove gear logger from launcher, it is no longer needed.

Change-Id: I7024e6f5994d8f79bae853a642ada3b4b52bf6e6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-01-28 11:36:47 -05:00
Paul Belanger 078f336a01
Don't assume pidfile location
When configuring the dir for the pidfiles in our init scripts don't
assume the path is /var/run/$NAME. The defaults are now /var/run/nodepool
now and could be set to other values as well. Instead of assuming
/var/run/$NAME we instead take the dirname of $PIDFILE and configure
whatever that dir is instead.

Also expose zuulv3 flag to user to toggle the location of pidfile,
this changes in nodepool > 0.5.0.

Change-Id: I7fff2565f9e77d737c247f204925f66a0e4aabe8
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-01-17 14:33:32 -05:00
Paul Belanger 8d91d91108 Add statsd_prefix to launcher.pp
Expose the ability to override our statsd_prefix, which defaults to
none.

Change-Id: I8bef6aae5a566ff3a34e816ece14f9cfc1ef289d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-03-10 10:49:57 -05:00
Jenkins d62777026c Merge "Add redirects to json status output" 2017-02-16 21:08:33 +00:00
Paul Belanger c68c8fcede Create nodepool::launcher
Move nodepool-launcher into its own class. This allows us to scale out
nodepool-launcher for our feature/zuulv3 effort.

Change-Id: I393fa1d8ff080260af772a2f020cca9b9e49b173
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-02-14 13:27:10 -05:00
Ian Wienand ef52d4952a Add redirects to json status output
These were added to nodepool with
I3410a4e4efd649732747b0502d66d212f50fa1bb

Change-Id: I5828a3eb94232596c1ad9f081d53e412e944bff3
2017-02-03 11:05:19 +11:00
Paul Belanger 90929f8848 Remove --no-images from nodepool
Now that the feature/zuulv3 branch of nodepool has been merged into
master, remove deleted args from our default files.

Change-Id: Icd595ae3311fa8428b812292c8f40c290bde5e3b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-12-01 12:44:44 -05:00
Ian Wienand cd086492a4 Add image upload log arguments
Add image upload log directory and arguments.  This is where provider
upload logs configured in Ic80e532891f039e0f835847ddfbae38f1ce3cd8aIf
can be stored.

Note http export (which we do not enable in infra at this time) would
put logs under /upload ; it might be more logical to move the build
logs to be a sibling at /build but that would be backwards
incompatbile.

Change-Id: I0cc9b59063fb14920f0da581b8036c2664d5d5f1
2016-11-08 13:36:05 +11:00
Paul Belanger 65d3344f81
Add nodepool-(builder|deleter) services
We've been running 3 nodepool services for a week now, lets properly
template them. nodepool uploads images, nodepool-launcher creates
nodes, nodepool-deleter deletes them.

This is mean to be a short term solution for zuulv25, and shouldn't
affect existing nodepool installations.

Change-Id: Iaee3148d6710f796e9f1ea7cba2962cfbb530fa2
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-10-05 17:27:35 -04:00
James E. Blair ad87982b13 Proxy nodepool webapp status commands
Change-Id: I5fb1e353046abe37b8479d9dfbe4db860a979b28
2016-07-25 09:59:14 -07:00
Mateusz Matuszkowiak 780df18752 Added nodepool::mysql class
- Created nodepool::mysql class, which includes mysql stuff from
  init.pp. This allows to host database on separated host than
  the one running nodepool.
- Discarded creation of 'max_connections.cnf' file. Instead,  use
  'max_connections' from '::mysql::server' config_hash/override_options.

Change-Id: Ic745875b69563ed3834e99533227ca3d1150156b
2016-05-17 23:22:42 +02:00
Paul Belanger b72fc61717
Expose nodepool-builder worker settings
This allows a user to tweak nodepool-builder image workers over using
static settings.

Change-Id: I54c879e1607d960629a2ed64efddff99491b6440
Depends-On: I5268e0ca34ab91ffae7a203ca710eecf571585e5
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-05-11 15:25:52 -04:00
Spencer Krum bb12dbb646 Colocate a builder-worker with the service
This is an intermediate step before builders are completely broken out
into their own hosts and nodes.

As part of this work we split up the logging configs for the two daemons
which allows them to be colocated and write to different log files on
the same host.

Co-Authored-By: Clark Boylan <clark.boylan@gmail.com>
Change-Id: I990e96dde352fb7d01cc4b89d0f4f02de166b943
2016-01-29 10:12:13 -08:00
Jenkins e9856ffd47 Merge "Fix nodepool class parameter defaults" 2015-08-18 06:19:30 +00:00
Jenkins 2bc4e962b3 Merge "Fix variables in nodepool.default.erb template" 2015-08-18 06:14:46 +00:00
Jenkins f2168cd978 Merge "Add creation of secure.conf file" 2015-08-14 02:24:57 +00:00
Colleen Murphy d4f9247be1 Fix nodepool class parameter defaults
This patch makes the following changes to make the parameter defaults
more sensible:

- Makes $nodepool_ssh_private_key required. It is not sensible to
  create a private key file that is empty, so we opt to fail fast in
  puppet rather than confuse nodepool. The system-config repository
  passes this value so this change will not affect Infra.
- Make $statsd_host default to undef. The nodepool.default template
  where this value is used now needs to check for both nil and ""
  because system-config passes "" directly to it and we want to
  continue the same behavior.
- Make $scripts_dir and $elements_dir default to undef and update the
  logic in the manifest to handle this.

Change-Id: Ic5e9af720c334d2cf2f7a9abe7c12fb81873086c
2015-08-10 17:54:01 -07:00
Colleen Murphy 9e37efea4c Fix variables in nodepool.default.erb template
Since all the variables accessed in this template are within the
current scope, there is no need to use scope.lookupvar here. Using it
adds complications, especially when passing undefined values. This
patch removes unnecessary uses of scope.lookupvar and replaces them
with instance variables.

This patch leaves the vhost template alone since the template is not
evaluated in the same scope. The nodepool.logging.conf template was
already properly using scoped instance variables.

Change-Id: Ie7d0a45905103c81d0c1822d89e2731e7395a3e3
2015-08-10 17:53:57 -07:00
Yolanda Robla 9d943b6882 Add creation of secure.conf file
This will be a new file that will store all the secrets needed
by nodepool at this stage: mysql password, and jenkins masters
credentials.
Following there will be a patch in nodepool, to use that file
to retrieve mysql and jenkins settings. By this way,
nodepool.yaml can be a plain file, and not a template, and can
be created into project-config.

Change-Id: Ie9381740e3644feaee1f1b201499e3a253677f39
2015-07-30 16:28:28 +02:00
Paul Belanger 43ff7f00bb Migrate to puppet-httpd module
puppet-httpd is the openstack-infra version of puppetlabs-apache
(0.0.4) release.

This patchset will remove the puppetlabs-apache namespace from -infra
allowing for possible future patchsets to use newer puppetlabs-apache
modules.

Change-Id: Iedd42f9fb628f1fbf6c4916a5811fd02860f389f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-07-16 15:49:14 -04:00
Jenkins 03c8f733a0 Merge "Fix vhost configuration sections" 2015-01-24 21:26:37 +00:00
Ian Wienand ac1c0f8b1f Update nodepool log vhost for apache 2.4
Update nodepool log vhost for apache 2.4 permissions as provided by
trusty

Change-Id: Ibd0a2d10c47ea8cee0059c320b55a3e40d23b31a
2015-01-08 10:32:57 +11:00
Dmitry Teselkin e202855942 Fix vhost configuration sections
According to https://wiki.apache.org/httpd/CommonMisconfigurations
is is wrong to specify server name in opening tag. ServerName
should be used instead.

Indentations also fixed in some files.

Change-Id: Id9d20a672103221efa01be61a174b62706036e57
2014-12-18 19:33:01 +03:00
Jeremy Stanley 33359d8efe Correct nodepool log vhost directory path
Change-Id: Id577ee397edda0af4b5d72ca4c5742e67c63c92c
2014-10-24 00:45:48 +00:00
Jeremy Stanley 34344a2fd0 Correct nodepool log document root reference
Change-Id: I19713d464ef62f6a9fc556475fb707311f5c023c
2014-10-23 23:01:31 +00:00
Jenkins dddb1aa17b Merge "Rotate out nodepool logs every 8-hours" 2014-10-23 21:19:08 +00:00
Ian Wienand 8cafe4dffd Rotate out nodepool logs every 8-hours
Individual nodepool .log files have now grown to being > 250mb.  This
is a bit much to download and go through when you're trying to debug
an issue with a particular image.

8-hour rotations seems a bit more useful than 24-hour ... and perhaps
even that is a bit long.  I don't think we need to extended the number
of rotations, I'm not sure really old logs are that helpful.

Change-Id: Ia788db809afe470bb9241f17411e4fa97d09ea11
2014-10-22 10:32:52 +11:00
Ian Wienand 2faf92404e Deploy vhost template for nodepool.o.o logs
In Ie0b269835ebb8effbac0285b782d8add7b47db32 I didn't consider how
difficult it is to get puppet to put in AllowOverride directives to
allow .htaccess to work.  The puppetlabs-apache version we use does
not support "override" as an argument, so you can't easily add this to
allow apache to read htaccess.  Upgrading is a big task because we are
so far behind (see I6fa5f3275a84ec4480169de562d1d4a656111814).

So deploy a full template for nodepool vhost that includes the config
options we need.

Additionally, the existing mimetype isn't set for the log-files

---
 $ curl -I http://nodepool.openstack.org/image.log.2014-10-14
 HTTP/1.1 200 OK
 Date: Fri, 17 Oct 2014 00:02:39 GMT
 Server: Apache/2.2.22 (Ubuntu)
 Last-Modified: Tue, 14 Oct 2014 23:59:56 GMT
 ETag: "f89bb-d458315-5056acfe33700"
 Accept-Ranges: bytes
 Content-Length: 222659349
---

I'm pretty sure this means it defaults to text/plain, but this makes
it explicit.  This should also matches on the timestampped log files
per the rules of multiple extensions [1]

[1] http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext

Change-Id: I7fa2603f4160b06af71a515e655d4a705fa0c768
2014-10-17 15:54:24 +11:00
James E. Blair c54b4f952e Fixes to nodepool installation on jenkins-dev.o.o
The patch to add nodepool to jenkins-dev (https://review.openstack.org/#/c/57333)
did not work.

There were a few issues with it:
  1. jenkins-dev.pp was passing literal strings to the nodepool module, instead it
     should be passing in the variables.
  2. jenkins-dev.pp was calling ::nodepool but puppet seems to think that it wants
     ::openstack_project::nodepool due to puppet's scoping weirdness :(
  3. The script to build nodepool machines needed the jenkins_dev_ssh_key.

Fixes to above issues:
  1. This is trivial, just passed the variables thru instead of literal strings.
  2. The nodepool.pp module is renamed to nodepool_prod.pp to prevent the scoping problem.
  3. We use the dev jenkins ssh key with dev nodepool by allowing the nodepool module
     to pass arbitrary env settings through the defaults file.

Change-Id: Id91053212f088079ff1b0f06ebdce5c381f5cd19
2014-04-25 11:52:08 -07:00
Matthew Oliver f016e06bcb Nodepool image logs accessible via HTTP
Nodepool logs the creation of nodepool images to an image.log which
are only accessible to root users. This change updates the nodepool
puppet configuration to install apache and allows users to access
these image logs.

Change-Id: I867030c258d00ce017c69812c133f3419215d045
2014-02-13 12:26:18 +11:00
James E. Blair 94fbdbab00 Add nodepool host
Change-Id: Ib216bd400aa269ccdb17848b3870ab65400cf3d2
2013-08-16 13:15:42 -07:00