Commit Graph

35 Commits

Author SHA1 Message Date
Tristan Cacqueray b01227c9d4 Move the fakeprovider module to the fake driver
This change is a follow-up to the drivers spec and it makes the fake provider
a real driver. The fakeprovider module is merged into the fake provider and
the get_one_cloud config loader is simplified.

Change-Id: I3f8ae12ea888e7c2a13f246ea5f85d4a809e8c8d
2017-07-28 11:35:07 +00:00
Monty Taylor 642f14c076 Add ability to select flavor by name or id
It's possible that it's easier for a nodepool user to just specify a
name or id of a flavor in their config instead of the combo of min-ram
and name-filter.

In order to not have two name related items, and also to not have the
pure flavor-name case use a term called "name-filter" - change
name-filter to flavor-name, and introduce the semantics that if
flavor-name is given by itself, it will look for an exact match on
flavor name or id, and if it's given with min-ram it will behave as
name-filter did already.

Change-Id: I8b98314958d03818ceca5abf4e3b537c8998f248
2017-04-27 13:44:25 -07:00
David Shrewsbury 6da49fe732 Docs: Remove cron references
Cron support is gone. Remove the doc/config file references, and
config supporting code.

Change-Id: I6587c7c3122dc1eb16f2c58520e7d76de31624f3
2017-03-27 16:43:15 -04:00
James E. Blair dcc3b5e071 Update nodepool config syntax
This implements the changes described in:

http://lists.openstack.org/pipermail/openstack-infra/2017-January/005018.html

It also removes some, but not all, extraneous keys from test config files.

Change-Id: Iebc941b4505d6ad46c882799b6230eb23545e5c0
2017-03-27 09:34:02 -07:00
Paul Belanger c5c5be30f9 Remove keypair from provider section
This was an unused setting which was left over from when we supported
snapshots.

Change-Id: I940eaa57f5dad8761752d767c0dfa80f2a25c787
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-03-27 08:31:31 -07:00
Paul Belanger f7289a5aca Remove legacy openstack settings from nodepool.yaml
Before os-client-config and shade, we would include cloud credentials
in nodepool.yaml. But now comes the time where we can remove these
settings in favor of using a local clouds.yaml file.

Change-Id: Ie7af6dcd56dc48787f280816de939d07800e9d11
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-03-27 08:31:29 -07:00
Paul Belanger 89de79e730 Remove ready-script support
It no longer makes sense to have nodepool execute 'ready-scripts' on a
remote node. With zuulv3, we have ansible and are able to convert our
ready-scripts into ansible-playbooks.

Change-Id: I07b63a16a668bb9a37fb3f763ac29f307f6c3a65
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-03-14 12:34:56 -04:00
David Shrewsbury 8c6461ebe4 Remove Jenkins
Remove files and fakes related to Jenkins. Since the 'targets'
config section was for mapping to Jenkins, this isn't needed either.

Change-Id: Ib5c615a95fcdce5234b3c63957171d77b8fbc65d
2017-03-12 10:21:03 -04:00
Paul Belanger b27b4798a4 Remove subnodes from nodepool
As we move closer to zuulv3, the concept of sub-nodes no longer
applies.  As a result, we can start to remove the legacy code making
it easier to re-enable our unit tests in the future.

Change-Id: If964e082bb56b32c8fbc0f3539b83629976fe041
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-02-10 12:37:21 -05:00
David Shrewsbury 8ce719b626 Remove Gearman and ZMQ
Sets up a shim for the new nodepool.NodePool.run() method that does
not require any service except ZooKeeper and removes all references
to Gearman/ZMQ.

Change-Id: I452c24d631592f47eb3f4cbffb56f3252f36c298
2017-01-11 13:40:43 -05:00
James E. Blair 6e98071f98 Remove script-dir
Script-dir was only used for snapshot building.  Since that is no
longer supported, remove it.

It was also passed through to DIB as an evironment variable.
However, the OpenStack infra element that used it defaults to
a sensible value.  Users who still want to use that can add it
as an environment variable to appropriate diskimage entries.

Change-Id: Ie72bb9675fdad6364589a6e3823f4ef9a0228e86
2016-12-16 13:41:07 -08:00
James E. Blair 7ab5ea700e Remove snapshot support
We don't have plans to support building images from snapshots in the
future.  If we add it back, it will require a new builder implementation
(with zookeeper interface, etc) anyway.

In addition to removing essentially dead code, this also begins the
process of simplifying the configuration file.  It removes 'base-image'
and 'setup' from the provider image attributes since they are only used
for snapshot images.

Change-Id: I68e0d2c7017cfebe35341189b5aedb0556bcd78b
2016-11-15 12:09:20 -08:00
James E. Blair 1865e16e02 Add a DIB configuration to fake.yaml
This is pretty much required for any interesting nodepool use
now.

Change-Id: I23ebfbe8dc3f12283bdebb4cffbcc19aa3210e94
2016-10-06 14:58:08 -07:00
James E. Blair f707d1ffdf Remove image-update cron
Instead, move this feature to be an attribute of the diskimages.
A "rebuild-age" is set for each diskimage (defaults to 24 hours),
and when a given diskimage becomes older than this age, the builder
will attempt to rebuild it (regardless of the time of day).

This makes more sense for a system that will retry failed builds
as well as being generally more idempotent, but also means that
when builds and uploads occur will be slightly less predictable.

Change-Id: I4725383158d5baf8fb67e86cb014d2db122e71a0
2016-08-31 10:41:03 -07:00
James E. Blair 76a691e5f4 Add zookeeper-servers to fake config
Change-Id: I5a4f9c2c561d9c9ec045637e5454a664aa3c8cf7
2016-08-18 09:08:27 -07:00
James E. Blair 6a32227008 Add assign-via-gearman to config validator
Also fix fake.yaml to correctly validate.

Change-Id: I32d1980d0bd8d511d47114f45f550b43f6f58676
2016-05-26 10:07:27 -07:00
James E. Blair e0f65825b0 Add option to assign nodes via Gearman
As port af the Zuulv2.5 effort, this interface is not designed
to be long-lived.

Change-Id: I6392a08a232cf99c48b0adbc91000d8b16053ae3
2016-04-26 11:00:16 -05:00
James E. Blair 2e05f1850f Restore ability to run nodepoold with fakes
With OSC and shade patches, we lost the ability to run nodepoold
in the foreground with fakes.  This restores that ability.

The shade integration unit tests are updated to use the string
'real' rather than 'fake' in config files, as they are trying to
avoid actually using the nodepool fakes, and the use of the string
'fake' is what triggers their use in many cases.

Change-Id: Ia5d3c3d5462bc03edafcc1567d1bab299ea5d40f
2016-04-18 08:47:46 -07:00
Yolanda Robla db7c48c301 Update nodepool to use secure.conf file
Depends on a new secure.conf file to grab mysql
connection and jenkins credentials. By this way,
nodepool.yaml is just a flat file without credentials,
that can be passed externally.

Co-Authored-By: Ramy Asselin <ramy.asselin@hpe.com>
Depends-On: Ie9381740e3644feaee1f1b201499e3a253677f39
Change-Id: Ifa4d500c52974b9fd3a0b7fd9c28cf8f52899ca9
2015-10-06 01:04:27 +00:00
Jeremy Stanley 63e5297f7e Switch from MySQL-python to PyMySQL
PyMySQL, unlike MySQL-python, is a pure-python implementation with
support for Py3K.

Change-Id: I110c85fa7d57a6ab121437f93238cf931a8f2d74
2015-04-02 21:18:21 +00:00
James E. Blair d22232bffe Record provider/region/az in /etc/nodepool
Write the provider, region, and az names into /etc/nodepool/provider
in a form that can be sourced by a shell script.  Potentially used
by a ready script.

Change-Id: I48933ddb89a4a89cb22e1cb005469833f91c1f66
2014-09-04 20:27:55 +00:00
Dan Prince e471cea178 Add support for network labels
This patch adds the ability to specify a net-label
instead of using a net-id (network UUID).

Rather than use network UUID's in our nodepool.yaml
config files it would be nice to use the more meaningful
network labels instead. This should make the config file
more readable across the various cloud providers and
matches how we use image names (instead of image
UUIDs) as well.

The current implementation relies on the os-tenant-networks
extension in Nova to provide the network label lookup.
Given that nodepool is currently focused around using
novaclient this made the most sense. We may at some point
in the future want to use the Neutron API directly for
this information or perhaps use a combination of both
approaches to accommodate a variety of provider API
deployment choices.

Tested locally on my TripleO overcloud using two
Neutron networks.

Change-Id: I9bdd35adf2d85659cf1b992ccd2fcf98fb124528
2014-07-03 15:32:57 -04:00
Jeremy Stanley 7f05bbd0fd Correct update-image to image-update in samples
Change-Id: Ie68346e092a8d94852d51e02425df43befa5df08
2014-04-04 18:08:43 +00:00
James E. Blair db5602a91e Add ready-script and multi-node support
Write information about the node group to /etc/nodepool, along
with an ssh key generated specifically for the node group.

Add an optional script that is run on each node (and sub-node) for
a label right before a node is placed in the ready state.  This
script can use the data in /etc/nodepool to setup access between
the nodes in the group.

Change-Id: Id0771c62095cccf383229780d1c4ddcf0ab42c1b
2014-03-31 09:20:15 -07:00
James E. Blair 9d4e56ff57 Add 'labels' as a configuration primitive
Labels replace images as the basic identity for nodes.  Rather than
having nodes of a particular image, we now have nodes of a particular
label.  A label describes how a node is created from an image, which
providers can supply such nodes, and how many should be kept ready.

This makes configuration simpler (by not specifying which images
are associated with which targets and simply assuming an even
distribution, the target section is _much_ smaller and _much_ less
repetitive).  It also facilitates describing how a nodes of
potentially different configurations (e.g., number of subnodes) can
be created from the same image.

Change-Id: I35b80d6420676d405439cbeca49f4b0a6f8d3822
2014-03-28 09:12:27 -07:00
James E. Blair e206893f27 Add the ability to create subnodes
An image can specify that it should be created with a number of
subnodes.  That number of nodes of the same image type will also
be created and associated with each primary node of that image
type.

Adjust the allocator to accomodate the expected loss of capacity
associated with subnodes.

If a node has subnodes, wait until they are all in the ready state
before declaring a node ready.

Change-Id: Ia4b315b1ed2999da96aab60c5c02ea2ce7667494
2014-03-27 12:57:40 -07:00
Robert Collins 2f052a01e3 Include check in fake.yaml.
Anyone starting from fake.yaml should have this.

Change-Id: Ieaa8a075cfff5259fabdcdada71c04cddb53cf9f
2014-02-03 20:22:07 +00:00
Robert Collins a0eac8a4f9 Permit using a known keypair when bootstrapping.
For debugging it is really inconvenient to have to wait for puppet to
*work* to log into a box and analyse what went wrong. This small patch
makes making one-time keypairs optional. Setting provider.keypair to
the name of a nova keypair will use that keypair in provisioning - but
you'll need to have the real key available via an agent for nodepool
to login itself.

Change-Id: I768ba656368ff00f9f7374ec0a46e57cd563ee61
2014-01-19 08:33:02 +13:00
Sergey Lukjanov 82a21be6b2 Permit specifying instance networks to use.
Provider.networks can now be specified as a list of dicts containing
the same parameters that 'nova boot --nic ....' would take - e.g.
net-id: 'someuuid'.

Change-Id: Ie34c3636f8a2fce6aae0ceb249294eaba6a92d35
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
2014-01-17 08:21:08 +13:00
Jenkins 6020f1db45 Merge "Fix the issue which raise FloatingIpPoolNotFound" 2013-12-09 18:45:18 +00:00
James E. Blair 0b0a954014 Add job runtime stats
Use state change times to determine job start and end times for a
run, and log runtime stats for the job, job+branch, job+branch+image,
job+branch+image+provider, as well as build counts for each of those.

Update the fake yaml file to align the ZMQ port with the fake servers.

Add statsd to the fake servers.

Add instructions on how to run a fake nodepool that emits statsd info.

Change-Id: I5296cafd191f363698a088fd50d5da24902fd104
2013-12-06 09:06:19 -08:00
qianlin a8406b2518 Fix the issue which raise FloatingIpPoolNotFound
This patch adds the necessary explanations on how to
use floating-ip, and add a parameter "pool" to fix the issue
which raises FloatingIpPoolNotFound when using nodepool.

Change-Id: I2344acd8b49f990eeb02c1b6016d1869f9d665f5
Closes-Bug: #1245829
2013-12-05 15:23:15 +08:00
Monty Taylor 28a1c41400 Add ability to filter on flavor name
Rackspace have recently added 'Performance' flavors. These flavors
distinguish themselves from other flavors only by a difference in
their name. The current config can only filter by RAM. Add a config
option for indicating a string that should be found in the flavor name.

Change-Id: I42448dde02f405182e887bf928b152cf97d2a0cb
2013-11-25 13:55:15 -05:00
James E. Blair 1d4c1483aa Inspect the Gearman queue for immediate demand
Use information from Gearman to determine the immediate load
requirements of the system and spin up as many nodes as required
to meet the demand.  Use the existing information about the
min and max servers to determine the ratio of servers to spin
up from each provider.

Replaces the several fake server scripts with one script that
implements statsd, zmq, and gearman to ease testing.

Change-Id: Ic0dedc7ef2760ff664912f771377e02967ad5633
2013-10-03 07:38:53 -07:00
James E. Blair a5a78ef441 Use a sensible SQLAlchemy session model
The existing db session strategy was inherited from a bunch of
shell scripts that ran once in a single thread and exited.

The surprising thing is that even worked at all.  This change
replaces that "strategy" with one where each thread clearly
begins a new session as a context manager and passes that around
to functions that need the DB.  A thread-local session is used
for convenience and extra safety.

This also adds a fake provider that will produce fake images and
servers quickly without needing a real nova or jenkins.  This was
used to develop the database change.

Also some minor logging changes and very brief developer docs.

Change-Id: I45e6564cb061f81d79c47a31e17f5d85cd1d9306
2013-08-16 20:21:33 -07:00