Commit Graph

52 Commits

Author SHA1 Message Date
Ian Wienand efbb9b8961 nodepool elements: fix pip upgrade venv
Change I316e9587b6e290cd421b47f506c91dbebe0975c0 had a rather
embarrasing oversight in that it copied the /usr/bindep-env/bin/pip
invocation for upgrading pip to all the other venv's.

i.e. we were upgrading hte bindep-env pip over and over, and not
actually the pip in the working venv.  The os-testr install on older
platforms has now broken because it still tries to install with the
ancient inbuilt pip -- local testing has confirmed that it works with
the updated pip.

Change-Id: I22c549b5f9b9e3882fcd2340946d2850b0b2f86b
2022-07-06 13:27:58 +10:00
Neil Hanlon cc6b6de7a0
Add Rocky Linux to nodepool elements tooling
Change-Id: I2a94a34b1518c90ef5f0d91c9131482520c38c62
2022-02-15 17:31:34 -05:00
wangxiyuan c28cce5d75 Add openEuler disto support for elements
This patch add openEuler disto support for the diskimage-builder
elements in project-config

Change-Id: I7d7804376c4579b550c865a3ad5719fea1ec703b
2021-12-16 09:37:19 +08:00
Ian Wienand 00d29d829b infra-package-needs: install latest pip
The pip installed in the venv with "python3 -m venv" on Xenial is 8.X
-- this does not understand python_requires metadata on packages and
can thus pull in requirements that won't actually run inside the
virtualenv.

Avoid this by upgrading pip in the venv before installing.

While this is the immediate need; do the same on the other venv's we
create for general sanity.

Change-Id: I316e9587b6e290cd421b47f506c91dbebe0975c0
2021-10-20 09:56:06 +11:00
Clark Boylan c6660ecfcb Revert "Pin setuptools<50 in our image venvs"
This reverts commit 6f992efbc5.

Setuptools 50.1.0 has been released which reverts the breaking behavior.
https://review.opendev.org/#/c/749766/ tests that these fixes work in
other venvs that exhibited the same problems. That change looks happy so
I think this revert is ready to go.

Change-Id: I31b62be4f85f40f4d99e463cd961dec0a3542f47
2020-09-03 09:19:52 -07:00
Clark Boylan 6f992efbc5 Pin setuptools<50 in our image venvs
setuptools==50 doesn't work with python older than python3.8. There are
a number of issues [0][1][2] the first of which we are tripping over. Be
conservative here and install older setuptools until these issues on
python3.5, 3.6, and 3.7 are sorted out.

[0] https://github.com/pypa/setuptools/issues/2352
[1] https://github.com/pypa/setuptools/issues/2363
[2] https://github.com/pypa/setuptools/issues/2357

Change-Id: I1ae7251c8a4c214544524871fdfe51e947b638f8
2020-08-31 14:02:24 -07:00
Ian Wienand 7602343b6a nodepool-elements: Use venv for utilities
Since all platforms have Python 3, use the new ensure-venv element
from the dependent change to install bindep and os-testr.

Since we are no longer using pip to install anything during the
builder, this drops the dependency on pip-and-virtualenv from
nodepool-base.  Avoiding this element is our long-term goal, as it's
modification to system state are problematic in a number of ways.  To
maintain the status-quo, the pip-and-virtualenv element is added
explicitly to each build's element list, with a note on it's future.

The current plan for backwards compatability is to replicate the
environment pip-and-virtualenv provides in a base role/job that can be
optionally included.  To test this, provide a new node type
"ubuntu-bionic-plain" that will not include the pip-and-virtualenv
element.  This is put on just one provider (rax) to minimise impact.

The dependent-change (and a dib release) is required before merge so
the ensure-venv element is available.

Depends-On: https://review.opendev.org/707513
Change-Id: I85438baf5bb31790a56fe5b38327361f0a2398e9
2020-03-11 10:12:00 +11:00
Alfredo Moralejo e17d562000 Revert "Use virtualenv --seeder=pip so that libs are accessible"
--seeder=pip is breaking images where pip is not installed from source.

New virtualenv upstream release 20.0.2 has fixed the issue seen when
using sudo [1] by copying instead of symlinking and does not need this
fix anymore.

[1] f4fd6a0991

This reverts commit be9530ae16.

Change-Id: I799982d9c023141cf612901084d4ecbd4447e969
2020-02-12 09:42:54 +00:00
Clark Boylan be9530ae16 Use virtualenv --seeder=pip so that libs are accessible
New virtualenv will by default use a common location for seed libs like
setuptools, wheel, and pip. Unfortunately this breaks if root installs
the virtualenv and other users are expected to use it because these
other users cannot access /root/.local (where the files are stashed).

We fix this by using --seeder=pip which will install all of those libs
into the virtualenv itself.

Change-Id: I4922ea50e31dceda96f545a0d409c0d7dc022e19
2020-02-11 08:41:49 -08:00
Ian Wienand c5f807e699 nodepool/elements : use abstracted commands
On platforms such as CentOS 8 which are python3 first, "virtualenv"
and "pip" may not exist (removed to avoid any confusion over them
being v2 or v3 commands).

The referenced dib change exports new variables that should be correct
on all platforms for creating virtualenv's and pip installs.

(note will require DIB release to be active on builders)

Depends-On: https://review.opendev.org/684462
Change-Id: I3414fb9e503f94ff744b560eff9ec0f4afdbb50e
2019-10-09 03:07:08 +00:00
Colleen Murphy 587b85ba36 Use iptables for openSUSE
In openSUSE Tumbleweed, the SuSEfirewall2 package was removed in favor
of firewalld[1]. This commit updates the openSUSE nodeset to use plain
iptables rather than injecting iptables rules into the SuSEfirewall2
service. This will work on both Tumbleweed and Leap nodesets.

openSUSE provides no iptables-service package the way the RHEL family
does, so we can't fall back to that. Rather than try to convert iptables
rules to firewalld syntax, this change leverages init.d to ensure
iptables rules are loaded at boot. The 89-unbound script has been
coopted for this purpose since it already creates
/etc/init.d/boot.local. Switched from `dd` to `cat` which makes
conditionally composing the file more natural.

[1] https://lists.opensuse.org/opensuse-factory/2019-01/msg00490.html

Change-Id: Ia2b72e25078efa68019f1bf7c7a0b77e6ff702fd
2019-09-20 12:05:09 -07:00
Matthew Thode 997486eff6
remove sudo from pip and virtualenv calls
Change-Id: I2f8ea4260c82d8623c74b8ac6355d9eb5f6698e9
2018-09-10 18:11:19 -05:00
Nicolas Hicher e0f471889c Ensure rhel7 image could be build
Add rhel7 distrib in unbound and iptables script for nodepool-base, and
add haveged installation for infra-package-needs to ensure users could
use these elements to build rhel based image.

Change-Id: Ib0ad877369bafab64a1fd25cc331363d771d5753
2018-05-22 14:14:50 -04:00
Ian Wienand 74fe242f26 Remove apply of iptables rules for gentoo
This is applying the iptables rules during the build on the builder.
This will need to be converted into a script to run on boot or
similar.

Change-Id: Icc753013f218c3e4f04031c2fdbc7b32a534d887
2018-04-16 07:22:34 +10:00
Dirk Mueller b0b73ea971 Stop using connection tracking for ssh connections
There is an issue with newer kernels (it seems to happen with 4.15.x)
that when conntrack is reloaded while a connection has packets in
flight, this connection going forward is neither considered INVALID
nor RELATED nor ESTABLISHED by the stateful tracking. While this is
certainly a bug somewhere in the kernel, we can be easily avoiding
this by just not using stateful filtering for ssh connections, as
we accept any connection from anywhere anyway.

Change-Id: I1b20644ce888930cd28d6eaf2c23787315e8199c
2018-03-01 20:09:50 +01:00
Andreas Jaeger 209b27a89b Remove jenkins-sudo
We do not use the jenkins user anymore, so can remove the sudo settings
that allows jenkins to become root.

Change-Id: I69d58c2d10a2f48406cf2991fe83ce0e64851c8c
2018-02-05 21:17:49 +01:00
Andreas Jaeger 684bb2682e Use zuul-sudo-grep
Remove jenkins-sudo-grep and use zuul-sudo-grep instead in the only user
which is run-tox.sh.

This allows to cleanup the legacy pre.yaml file in openstack-zuul-jobs.
that file replaces already jenkins-sudo-grep with zuul-sudo-grep.

Remove also now unneeded jenkins-sudo-grep settings.

Change-Id: I73e57eef72b1e5a0ec7be9e57160b24c6076e710
Needed-By: https://review.openstack.org/538344
2018-01-26 22:39:10 +01:00
Paul Belanger 153aeae4f0
Revert "Revert "Remove zuul-env from DIB images""
We've updated the fetch-zuul-cloner role to properly create the
virtualenv and pyyaml dependency now.

This reverts commit 132cdf30d5.

Change-Id: I3fee0144eef4adeeb2b1f905c1f58c5bb4a6e554
Depends-On: I3e55a3a1582aa7dea21c7de67260c2c906c2192b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-11-22 13:43:47 -05:00
Clark Boylan 132cdf30d5 Revert "Remove zuul-env from DIB images"
This reverts commit b770db0c21.

Turns out the zuul cloner shim in v3 does run out of the virtualenv's
python afterall. It appears to do this because it needs pyyaml
installed.

Change-Id: Idfa7a54e7c54b9068dc3d8ca9ff820c7aa47e8b4
2017-11-21 19:20:29 -08:00
Zuul 2be0930a34 Merge "Remove zuul-env from DIB images" 2017-11-21 19:45:33 +00:00
Paul Belanger b770db0c21
Remove zuul-env from DIB images
Now that we have decided not to rollback to zuulv2, we can start
removing legacy code from our images. In this case, there is no more
need to be using zuul-cloner.

Change-Id: I6138482cb9a787792c09c44bb6235797cc046262
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-10-23 18:31:21 -04:00
Matthew Thode 56929e4639
make a gentoo nodepool image
Depends-On: I17202de3016616ce34c8cbead7d0fb047a64e96b

Change-Id: Icf5e7e8bc4f005111cd2492d3c1a2c492b8a7a96
2017-10-18 15:20:11 -05:00
rabi d0b3c9076c Allow nova servers to reach heat services on port 80
When we run heat api services with apache+uwsgi(mod_proxy_uwsgi),
we would need the services to be reachable from the neutron public
net on port 80.

Change-Id: I7c227b3fe580b2a60aa50a043200f4e4f270a5a3
2017-05-24 23:44:55 +05:30
Paul Belanger 28a084b3e4
Clone zuul from git.openstack.org for zuul-env
Break the dependency on openstack-repos as we are considering removing
this element for zuulv3.  Also, this is a requirement if for us maybe
building our project-config nodepool images in the gate.

Change-Id: I3bddca68385dc6c765fefb01e3042a48c4df5b3d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-03 10:24:19 -04:00
Colleen Murphy 0d55fc765d Stop installing and running puppet in node builds
Move non-puppet-related parts of the puppet element into other elements,
remove the puppet element, and stop running the prepare-node script.

\o/

Change-Id: Ib241ea976ca0a3d661599f36e3f5a2d4eb023c08
2017-04-27 23:23:32 +02:00
Jenkins f515d7b9a9 Merge "Add firewall support for opensuse" 2017-04-26 17:46:43 +00:00
Paul Belanger 1ae69b1f8c Don't create /etc/iptables/rules
puppet-iptables was creating /etc/iptables/rules and linking it to
rules.v4.  We have removed this with
I03db58441674a3f3eea86165c949a7d14425a0b7 so this can simply make
rules.v4 and rules.v6 files, as required by
[netfilter|iptables]-persistent

Change-Id: I7e65793ba7513ac54ae701cc29c7c5ff6e33410d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-04-26 14:30:18 +10:00
Colleen Murphy ffafa8f773 Add firewall support for opensuse
openSUSE Leap uses its own firewall manager called SuSEfirewall2, which
is capable of loading custom iptables rules. This patch adds the
necessary configuration to tell SuSEfirewall2 where to look for custom
firewall rules so that we can manage openSUSE firewall rules in the same
way we manage firewall rules for other images.

Change-Id: Ifaebda6c7775244668710340831e12aabf9e86bc
2017-04-24 23:24:43 +02:00
Colleen Murphy 97e65e6924 Add iptables rules to nodepool-base element
Instead of managing firewall rules with puppet we can statically copy
them into the image at build time.

Change-Id: I3ee306e46747b77499ff8975cd3d842b09ec2937
2017-04-24 21:57:51 +02:00
Paul Belanger 8669380c2b
Stop using install-static for jenkins sudoers file
Switch to how we setup sudoers files, like we did in the zuul-worker
element. This stops us from possibility affecting the permissions on
/etc/sudoers.d with the install-static element.

Change-Id: Idaf2f4c582f333fd9acf4e4a08e5ade6fba61947
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-04-19 11:50:05 -04:00
Paul Belanger 87d1187bd1
More sudoers permission check to install.d
Because we also check sudoers files in our zuul-worker element, we
need to make sure our permissions are set in install.d not
postinstall.d.

This was also not an issue locally, since our puppet master seems to
chmod 0755 our elements directory on nodepool-builders.

Change-Id: Ibcfd2741263889ef2dce8e04237537a6d83de301
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-04-17 21:56:25 -04:00
Paul Belanger 5578254916
Create /usr/zuul-env in nodepool-base
Part of our effort to migrate from puppet to dib elements.

Change-Id: Ie1b4a29a7496c862c14417344b8d51aef779e104
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-04-17 14:44:29 -04:00
Andreas Jaeger 183aabbeaf Remove zuul_swift_upload
Remove the unused builders and publishers for zuul-swift, remove unused
script to upload, and remove unused swift-logs nodepool element.

Change-Id: Idfa83d435a951dcfe6f6545a2515aec281ed43cc
2017-04-10 22:46:44 +02:00
Ian Wienand 236821a4fd Remove 99-install-zuul from nodepool-base element
This seems to have been here since the beginning of time (with time
being the project-config split).

However, since then, Openstack_project::Slave_common as acquired the
ability to install this same environment
(I290a695c697fb456bee6f8212ba50b6c1b4533fc).

The difference was that this file installed zuul from git, while
puppet was installing from pip.  However, that changed in
If07b31f3a735cf7bcf6bfb8591ed37577f5ae201 and puppet is now installing
zuul from git.  Thus since this now duplicates what's happening in
puppet, I do not believe want or need this.

This element is now breaking the Fedora 24 build when it tries to
overwrite the existing virtualenv already created by puppet.
python::virtualenv creates the virtualenv with a "-p python" argument,
while the second call doesn't, which creates issues with the symlink
layout (see [1] for details).

[1] https://github.com/pypa/virtualenv/issues/976

Change-Id: I7963630c699eaa4984adc6a155bea8f74280cd80
2016-11-09 10:48:14 +11:00
Ian Wienand e6db1891b3 Remove Fedora 24 work-around kernel
The workaround in my custom kernel (from
Iafe6d88e3ac7a2ea23553a5011df920a2ee3317d and
I0769f005da1931658a5fb9e627983ed30c11d212) are incorporated in the
latest upstream release.

Change-Id: Ibb2e2045ce813b4e69447fb5c896a2e0dfd4b1ec
2016-08-25 16:02:16 +10:00
Kevin Carter 95821ab951
Disabled IPv6 privacy extensions
IPv6 privacy extensions can cause issues by preferring a temporary
network over a public one. This preference may limit connectivity
in certain situations. An example of a connectivity issue can be
seen where the command ``traceroute6`` fails or misses all hops
while other traffic to a given domain with a "AAAA" record may
succeed. To resolve this issue the IPv6 privacy extensions have
been disabled.

Related-Bug: #1068756
Change-Id: If3bb0fd690673a6d93114e6aebddb5985344b437
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-16 23:18:23 -05:00
Ian Wienand 1b187f9b80 Further F24 kernel update
As described, I missed that we only keep *one* kernel during dib
build, so as soon as the upstream package updates, it suddenly becomes
the latest kernel and kicks our custom version out.

Guess what happened in the hours between me committing
I0769f005da1931658a5fb9e627983ed30c11d212 and the next dib build.

This will install the current latest kernel with the required patch.
As described in the comment, I have the fix committed upstream so we
can remove this whole thing when fedora rebuilds for the next stable
release (even if the patch isn't in the official stable tree yet).

Change-Id: Iafe6d88e3ac7a2ea23553a5011df920a2ee3317d
2016-08-16 10:02:40 +10:00
Ian Wienand efac0c8b6b Add Fedora 24 work-around kernel
The current F24 kernel can't run tempest without oops-ing.  This
installs a custom build with a fix until we get a fixed release.

See also

 https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=5ef9f289c4e698054e5687edb54f0da3cdc9173a
 https://bugzilla.redhat.com/show_bug.cgi?id=1361414

Change-Id: I0769f005da1931658a5fb9e627983ed30c11d212
2016-08-08 21:52:28 +00:00
Andreas Jaeger 84e76e3f72 Silence zuul_swift_upload
At the end of gate jobs, we get warnings from zuul_swift_upload that
are not actionable for us.

Use requestsexceptions to silence these warnings. Add requestsexceptions
to the venv that is created for zuul_swift_upload to run in.

Example file
http://logs.openstack.org/48/298048/1/check/gate-ha-guide-tox-checkniceness/62e2d16/console.html

The example shows 6 warnings starting with:
/usr/zuul-swift-logs-env/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:315:
SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject
Name Indication) extension to TLS is not available on this platform.
This may cause the server to present an incorrect TLS certificate, which
can cause validation failures. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/zuul-swift-logs-env/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120:
InsecurePlatformWarning: A true SSLContext object is not available. This
prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
...

Change-Id: I02b4b6c7b426f3e9aa498941e4d75f67066d4d27
2016-03-27 21:23:31 +02:00
Ian Wienand 2badcc1893 Add a dib-builddate file
Add a build-date timestamp file to the nodepool-base element and
output that as part of the "network-info" macro that we run at the
start of most tests.

This will allow non-priviledged users to quickly see the date the node
running their test was built on, which can be correlated to the logs
on nodepool.openstack.org to help debug issues that might have to do
with the underlying image build.

Change-Id: Id0c9f6203ed487350285031d3965bc6290370a27
2016-03-01 15:16:15 +11:00
Ian Wienand 90c53a8ded diskimage-builder element cleanups for dib-lint
Since I6c5a962260741dcf6f89da9a33b96372a719b7b0 dib has had a
standardised method for ensuring consistency of tracing and error
detection.  Bring the tracing for these elements up to that standard,
but maintain the status-quo of flags such as "-e" and "pipefail" by
adding ignore flags where appropriate (we can update these separately
to avoid breakage)

Other minor changes are alphabetical-ordering in the element-deps
files and permissions on prepare-node script

With this, "tox -edib" passes

Change-Id: Ibba1dadb9e819f94294c9d583b83ff698252f93f
2015-10-08 11:33:03 +11:00
Matthew Treinish 76d164b1ba
Create an os-testr venv for running subunit2html
This commit creates a venv for installing os-testr which will enable
all test jobs to have access to the subunit2html utility which has
been moved to live inside the os-testr package instead of as a slave
script.

Change-Id: I2050b54eb2def10438764f3eeb55ecf9caa874dc
2015-08-14 12:37:22 -04:00
Monty Taylor 449d432feb Don't disable cloud-init if it is not installed
When we're building nodepool images on top of minimal elements, there
will be no cloud-init, and therefore no need to disable cloud-init
datasources. In fact, trying to do so will be an error.

Change-Id: I98887c43566e07f2be9d2dc5fae6538078c7348e
2015-05-10 12:58:08 -04:00
Monty Taylor fc554ab821 Disable metadata in cloud-init config
Rather than deleting cloud-init, which is going to take longer, just
disable ec2 metadata service. This will be a no-op on rackspace, which
already does this.

Change-Id: I5e8baee50800f7aae474288a914333c21466855a
2015-03-20 14:13:16 -04:00
Joshua Hesketh 3691476925 zuul-swift-upload support recursive globs
Allow supplying filename and paths with '**' recursive glob matches
to zuul-swift-upload. Since bash (or shell etc) will expand on any
filenames provided to the program this needs to be used in quotes.

Usage example:
./zuul_swift_upload.py my_results.txt '**/sdist/*.zip' output.log

The hierarchy is always flattened meaning the supplied list is
placed in the topmost generated index.html. Sub-folders still keep
their hierarchy.

Change-Id: I9ba04f7e46b579dcf3f8ad0bd188f41fa5dbcad9
2015-03-04 09:33:17 +11:00
Jeremy Stanley a2551dfef6 Run restrict-memory element later in image build
Since grub isn't installed by DIB until finalise.d/51 we need to
make sure the restrict-memory element happens after that, so it can
find and alter the grub configs accordingly.

Also make it apply the updated configuration, similar to how
nodepool/scripts/restrict_memory.sh does it.

Change-Id: I854f3bd1850594811cc8957f7a9263c33dfe6826
2015-02-24 18:52:06 +00:00
Jeremy Stanley 90e3c200bd Stop using py3k-precise nodes
These are no longer being used to run jobs, so clean up references
to them.

Change-Id: Iac7ffde66a2d5d1a1361ed9bcadb9144e034f10f
Depends-On: I40d5d09f28ef53583d239d2e852e9c50b5962cf8
2015-01-30 23:47:30 +00:00
Clark Boylan f89b832398 Install argparse and requests to swift venv
The zuul swift log uploader script needs argparse on python2.6 and
requests on all python versions to work properly. Install these two
packages to the virtualenv configured for this script at image build
time.

Note that `pip install argparse` on python >= 2.7 is not an error
it just reports that argparse is installed as part of the python
installation and moves on.

Change-Id: Ie79b59e1c687cce2b435c9704959b02911f94778
2015-01-15 10:31:15 -08:00
Clark Boylan 3d6303f3fc Set the executable bit on all dib element scripts
DIB needs its scripts to be executable or they are not run. Update
permissions on two files that were missing the executable bit.

Change-Id: Ie172e50de57b5168264964644cd28530f023542a
2015-01-12 16:15:27 -08:00
Joshua Hesketh 8bc108140e Set up venv for zuul-swift-logs
Set up a venv for zuul-swift-logs and install its dependencies
(python-magic) there instead of as system packages.

For DIB use 90 as uploading logs may be considered more important
than installing zuul.

Change-Id: Id0fc01729853e65c81cdd50e4ffa4d0d6de00ae9
2015-01-07 10:38:59 +11:00