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
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
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
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
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
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>
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
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
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>
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
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>
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>
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
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
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
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
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>
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
This duplicates the logic in zuul, and makes us consistent with
current nodepool documentation that says we already support this.
Change-Id: Ib92272b302a5225726a830ee50571fb7ad96e457
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>
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
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
The artificial sleep() call was sometimes not long enough for the
test to succeed. Switch to using iterate_timeout().
Change-Id: I7ebdabe1a6e8ba3a01593c7b63aa784a23aca2d3
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