2226 Commits

Author SHA1 Message Date
James E. Blair
007f7e0b08 Switch functional testing to a devstack consumer job
Rather than implement functional OpenStack testing as a devstack
plugin, use devstack as a black-box OpenStack.  This allows us
to move nodepool to a new Zuul tenant without depending on the
devstack job and all its associated projects.  It will also let
us replace devstack with something potentially lighter weight in
the future.

The job permits customized settings for what images to build, so
that the DIB project can inherit from it and make child jobs for
each of the operating systems it cares about.

Change-Id: Ie6bc891cebd32b3d1bb646109f13ac2fd383bba5
2019-06-27 08:58:17 -07:00
James E. Blair
75adc01f0a Increase port cleanup interval
If we set the interval too short (currently 3m), we may delete
a port which simply hasn't been attached to an instance yet if
instance creation is proceeding slowly.

Change-Id: I372e45f2442003369ab9057e1e5d468249e23dad
2019-06-21 07:40:21 -07:00
Paul Belanger
1c97e4f690 Add release note about pinning openshift client
Change-Id: Icd35d8fe0df8cc96f2d7e6de074b41fea46f014b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
3.7.1
2019-06-20 10:59:01 -04:00
Ian Wienand
37042fe03e Pin to openshift <= 0.8.9
It looks like 0.9.0 has released, and it seems like it requires
creating a dynamic client now.  We're seeing jobs using nodepool fail
with

 File "... /nodepool/driver/openshift/provider.py", line 21, in <module>
   from openshift import client as os_client
 ImportError: cannot import name 'client' from 'openshift'

This does break things like the project-config gate.  Pin to 0.8.9 for
now until it is fixed.

Change-Id: Ie9ccb56f987b4d05c6fe9d4938ca74a110f55653
2019-06-20 19:28:45 +10:00
Zuul
a7dc2770b7 Merge "static: enable using a single host with different user or port" 2019-06-17 15:45:13 +00:00
Tristan Cacqueray
552140037f static: enable using a single host with different user or port
This change modifies the static driver registering logic to take
into account the username and connection-port when identifying
unique node so that a single hostname can be registered multiple
times with different user or port.

Change-Id: I8f770e13c0d00d65094abccee30e54ec0e6371b6
2019-06-13 00:01:47 +00:00
Zuul
3412764a98 Merge "Add Debian Buster boot tests" 3.7.0 2019-06-12 20:40:31 +00:00
Clark Boylan
989afdc470 Exclude SDK with broken image upload tasks
Glance uploads images in two major ways. There is the direct way and the
task based async way. openstacksdk 0.28.0-0.31.0 do not have functional
task based image uploads so we exclude them.

Change-Id: I1ed56fa199a6ace6c1292f9edc14ea6b497d4c89
Related-Story: https://storyboard.openstack.org/#!/story/2005851
2019-06-10 11:17:14 -07:00
Zuul
210570cd49 Merge "openstack: document the key-name parameter" 2019-06-10 15:44:26 +00:00
Zuul
ced0e0e05d Merge "Explicitly set use_direct_get to False" 2019-06-10 07:43:19 +00:00
Paul Belanger
3a5cabedcb Toggle host-key-checking for openstack provider.labels
This adds the ability for a pool.label to override the
pool.host-key-checking value, while having a label exist in the same
pool.  This is helpful because it is possible for 1 pool to mix network
configuration, and some nodes maybe missing a default gateway (making
them unroutable by default).

Change-Id: I934d42b8e48aedb0ebc03137b7305eb2af390fc7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-06-06 14:15:53 -04:00
Monty Taylor
816921e4e2 Explicitly set use_direct_get to False
It is essential for nodepool that we use list and local filtering
for openstack servers for scale reasons. For users who are using
openstacksdk at scales that are not nodepool, it's less efficient
to do lists all the time. There is a flag to control the behavior
of get_server. Set it explicitly to request the behavior nodepool
is looking for so that openstacksdk can change the default to
better serve non-nodepool consumers.

Change-Id: I7cf03285f9a04f3eef403c67d75e149605207eb1
2019-06-05 10:48:33 -05:00
Jeremy Stanley
74f960848c Update os-client-config references to openstacksdk
Nodepool's OpenStack driver relies on openstacksdk directly for
configuration handling now, no longer os-client-config. Update the
references in documentation and code comments accordingly.

Change-Id: I8850bce4a226aa550038f02cdb027b9613ce0ae2
2019-06-04 20:05:13 +00:00
Paul Belanger
e02b9d6097 Add error handling when cleaning up resources
It is possible for a single provider to have problems (eg: auth) which
blocks all other providers behind it. This causes a problem as leaked
instances could never be cleaned up in providers that are working.

Change-Id: I97d05815ae4812ba9e2881e1207ee901d269e655
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-28 21:02:35 -04:00
Tristan Cacqueray
3fa7a45905 openstack: document the key-name parameter
Change-Id: I1b469dd8897033384dc3c59dbc6f058a9dd9b1bf
2019-05-28 06:07:17 +00:00
David Shrewsbury
d0bb3d004d Use py3 pathlib in DibImageFile
The pathlib library was introduced in python 3.4 and is a more
concise way to deal with paths versus the overburdened os lib.

Change-Id: I468c4aa0a41f07c0b0009c2c387712b001a03e5d
2019-05-21 12:21:31 -04:00
Zuul
6182f7bc3a Merge "Implement an OpenShift Pod provider" 2019-05-13 15:30:25 +00:00
Zuul
50c1d0eafa Merge "Cleanup kube_config temp files between test runs" 2019-05-13 14:40:04 +00:00
Tristan Cacqueray
720dcec886 static: fix missing python-path update
This change fixes a missing python-path node attribute update for
the static node provider.

Change-Id: I4a0b8dfd7e134c635acbf52d63e565638565cdbb
2019-05-13 09:54:08 +00:00
Zuul
e87a1e0ed8 Merge "Fix version number when installing dev release" 2019-05-10 17:13:07 +00:00
Zuul
58fcaa94d5 Merge "Dockerfile: add support for arbritary uid" 2019-05-10 16:25:43 +00:00
Zuul
e0359d1c99 Merge "Add python-path option to node" 2019-05-10 16:10:56 +00:00
Paul Belanger
a748468adb Fix version number when installing dev release
Now that we publish dev releases to pypi, we should also allow those
versions to be displayed with --version flag.

Change-Id: I045c9d5382a1035cd7678f9882e32d371f108555
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-08 14:18:37 -04:00
Paul Belanger
1714b6aae3 Add release-zuul-python to post pipeline
By adding release-zuul-python to the post pipeline, we can start
publishing per-commit tarballs / wheels to pypi. This is helpful for
zuul operators that don't want to deploy nodepool via git, but want to
use the latest commits of nodepool.

Change-Id: I8098a4e750d4931b7c12a5ce2a84885ef87db734
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-07 14:20:35 -04:00
Tristan Cacqueray
159038503a Implement an OpenShift Pod provider
This change implements a single project OpenShift pod provider usable by a
regular user service account, without the need for a self-provisioner role.

Change-Id: I84e4bdda64716f9dd803eaa89e576c26a1667809
2019-05-07 02:25:15 +00:00
Tristan Cacqueray
76aa62230c Add python-path option to node
This change adds a new python_path Node attribute so that zuul executor
can remove the default hard-coded ansible_python_interpreter.

Change-Id: Iddf2cc6b2df579636ec39b091edcfe85a4a4ed10
2019-05-07 02:22:45 +00:00
Tobias Henkel
4131d7da59
Cleanup kube_config temp files between test runs
In my local tests running tox the tmp files of each test case get
deleted after the run. However kube_config maintains a static list of
temporary files it knows about and tries to re-use them in subsequent
test runs which causes the test to fail [1]. Fix this by telling
kube_config to cleanup its temporary files in the cleanup phase.

[1] Trace
Traceback (most recent call last):
  File "/home/tobias/src/nodepool/nodepool/tests/unit/test_builder.py", line 239, in test_image_rotation_invalid_external_name
    build001, image001 = self._test_image_rebuild_age(expire=172800)
  File "/home/tobias/src/nodepool/nodepool/tests/unit/test_builder.py", line 186, in _test_image_rebuild_age
    self.useBuilder(configfile)
  File "/home/tobias/src/nodepool/nodepool/tests/__init__.py", line 539, in useBuilder
    BuilderFixture(configfile, cleanup_interval, securefile)
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/testtools/testcase.py", line 756, in useFixture
    reraise(*exc_info)
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/testtools/_compat3x.py", line 16, in reraise
    raise exc_obj.with_traceback(exc_tb)
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/testtools/testcase.py", line 731, in useFixture
    fixture.setUp()
  File "/home/tobias/src/nodepool/nodepool/tests/__init__.py", line 318, in setUp
    self.builder.start()
  File "/home/tobias/src/nodepool/nodepool/builder.py", line 1304, in start
    self._config = self._getAndValidateConfig()
  File "/home/tobias/src/nodepool/nodepool/builder.py", line 1279, in _getAndValidateConfig
    config = nodepool_config.loadConfig(self._config_path)
  File "/home/tobias/src/nodepool/nodepool/config.py", line 246, in loadConfig
    driver.reset()
  File "/home/tobias/src/nodepool/nodepool/driver/openshift/__init__.py", line 29, in reset
    config.load_kube_config(persist_config=True)
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/kubernetes/config/kube_config.py", line 540, in load_kube_config
    loader.load_and_set(config)
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/kubernetes/config/kube_config.py", line 422, in load_and_set
    self._load_cluster_info()
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/kubernetes/config/kube_config.py", line 385, in _load_cluster_info
    file_base_path=self._config_base_path).as_file()
  File "/home/tobias/src/nodepool/.tox/py37/lib/python3.7/site-packages/kubernetes/config/kube_config.py", line 112, in as_file
    raise ConfigException("File does not exists: %s" % self._file)
kubernetes.config.config_exception.ConfigException: File does not exists: /tmp/tmplafutg0j/tmpmiti10bn
Ran 2 tests in 4.524s (+0.175s)
FAILED (id=20, failures=1)

Change-Id: Idce8ca9bed49162874af24b224e573121e250385
2019-05-04 11:08:40 +02:00
Zuul
2e8f286c4f Merge "Allow openstack provider labels to configure networks" 2019-05-04 06:52:51 +00:00
Tobias Henkel
f58a2a2b68
Fix leaked loggers
In the NodeLauncher we currently create a specific logger per node we
create. However loggers cannot be destroyed and will live for the
whole lifetime of the application. This means that we essentially leak
one Logger object per node we create.

The reason for introducing per node loggers was that we can easily
filter the log by node id and get every message related to that node
creation. This also can be accomplished by using a LoggerAdapter which
is also already in use by zuul for the same purpose.

Change-Id: Ieff99c242c1ec1ca89e2c16929cfc3237d6f1a78
3.6.0
2019-04-30 21:08:28 +02:00
Paul Belanger
aaf36db8c6 Allow openstack provider labels to configure networks
We have a use case where we have a single pool, due to quota reasons,
but need the ability to selectively choose which network a label will
use. Now a nodepool operator will be able to define which networks are
attached to labels (in our case network appliances).

Change-Id: I3bfa32473c76b9fd59deee7d05b492e7cf67f69d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-04-29 17:31:50 -04:00
Monty Taylor
d85fb24734 Update devstack settings and docs for opendev
The most important thing is that the URL for glean is actually
wrong, which causes jobs to fail.

Also, change documentation while we're changing things.

Depends-On: https://review.opendev.org/655133
Change-Id: I127a33bfc4a3e33249120dcc7ef6142ce4e52a97
2019-04-23 13:03:21 +00:00
OpenDev Sysadmins
f8ac79661a OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:25:31 +00:00
David Shrewsbury
0a4d00fd82 Add support for yappi and objgraph output
This duplicates the logic in zuul, and makes us consistent with
current nodepool documentation that says we already support this.

Change-Id: Ib92272b302a5225726a830ee50571fb7ad96e457
2019-04-17 16:15:33 -04:00
Zuul
dd8ddec140 Merge "Gather host keys for connection-type network_cli" 2019-04-16 12:58:41 +00:00
Zuul
4a81cae533 Merge "Fix for orphaned DELETED nodes" 2019-04-16 04:35:46 +00:00
Zuul
36d03ab488 Merge "Implement max-servers for AWS driver" 2019-04-15 21:17:33 +00:00
Paul Belanger
3b893e3c28 Gather host keys for connection-type network_cli
The network_cli conneciton in ansible, is built a top of paramiko,
which then uses SSH at the transport. This means hosts using this
connection should also have their host keys collected.

Change-Id: I0383227374bdc1a9b0cecc255eabcb8a8d097b09
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-04-15 16:40:39 -04:00
David Shrewsbury
cc70ecf6b4 Fix for orphaned DELETED nodes
Include DELETED in the list of node states to cleanup. If we lose the
ZooKeeper connection while deleting a node (after setting its state
to DELETED and before actually deleting the znode), we can leave the
node orphaned in the DELETED state and it never gets removed.

Change-Id: Ie6c00e1adcbdf5b6f2122fc638ee5e91aaca9f61
2019-04-15 16:00:07 -04:00
Zuul
77d31dc126 Merge "k8s: Fix delete_namespace to use kwargs properly" 2019-04-13 08:13:13 +00:00
Clint Byrum
da21971e9b Implement max-servers for AWS driver
Max-servers has been ignored up until now. This implements the basic
checks so that AWS users can limit the number of instances they launch.

Change-Id: I73296bde1cdde80c52b6b5b725f268a17562060d
2019-04-11 18:12:12 -07:00
Tristan Cacqueray
da2701e0b1 Dockerfile: add support for arbritary uid
This change adds the uid_entrypoint script to support arbitrary uid
as documented in:
https://github.com/RHsyseng/container-rhel-examples/tree/master/starter-arbitrary-uid

Change-Id: I857308fa1f2363d2b4bc257e86963c36ce1d49e2
2019-04-10 12:20:21 +00:00
David Shrewsbury
df466435fe Fix race with test_provider_removal unit test
The artificial sleep() call was sometimes not long enough for the
test to succeed. Switch to using iterate_timeout().

Change-Id: I7ebdabe1a6e8ba3a01593c7b63aa784a23aca2d3
2019-04-09 13:40:50 -04:00
Zuul
330218b80e Merge "Fix race in test_handler_poll_session_expired" 2019-04-08 17:21:37 +00:00
Zuul
a795264fcf Merge "Remove reference to TaskManagerStopped exception" 2019-04-05 20:02:49 +00:00
Zuul
2b4fdb03d9 Merge "Remove unused use_taskmanager flag" 2019-04-05 19:58:37 +00:00
David Shrewsbury
133da674fe Fix race in test_handler_poll_session_expired
It's possible that we could test the internal request_handlers
data structure after the exception, but BEFORE it has been modified.
Just wait for it to go to zero length.

Change-Id: I364b1f347553a3f6710a516461c4f097d0276794
2019-04-05 13:15:48 -04:00
Zuul
1fe6743823 Merge "Use the buildset registry in zuul-quick-start" 2019-04-05 15:40:53 +00:00
Zuul
bc0155e4ed Merge "Fix debug log message" 2019-04-04 19:29:40 +00:00
Zuul
2f66863db4 Merge "doc: add provider driver development instructions" 2019-04-04 18:47:10 +00:00
Zuul
ba8dd4a354 Merge "Update dib stats" 2019-04-04 18:14:55 +00:00