Commit Graph

76 Commits

Author SHA1 Message Date
Ghanshyam Mann a43311b7ef Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: Ic209179b0be9c3746a702ccea2dd35e883e78bee
2024-02-24 11:43:49 -08:00
Zuul ada0d3aad1 Merge "Use python3 for map-services-tripleo" 2021-05-05 01:19:48 +00:00
Sorin Sbarnea c69ead8b45 Drop pbr version ceiling and add py39 testing
- Ceiling of pbr version can create installation conflicts with pip.
- Fixes tox default env list to be python version agnostic
- Updated template to use newer jobs (include testing with newer python)

Bug: #1921679
Change-Id: Ifd0d2f810799992faa1db41b80bf93bc97d5d19d
2021-03-30 10:57:41 +00:00
Steve Baker a038c08017 Use python3 for map-services-tripleo
RHEL-8 doesn't have a 'python' alias set up by default.

Change-Id: Ib17a8009f335d7ef9e72e35e3477e471b69e895e
2021-02-25 10:26:40 +13:00
Hervé Beraud 99281bd30f Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I6d02b20797cf1a0208a24e740d1f9dc921434b82
2020-06-02 21:04:27 +02:00
jacky06 c5984fc6d7 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: If299ebc5849502954e812947c5b80006573710ed
2019-05-28 14:40:51 +08:00
Yolanda Robla Mota b9fb5326fd Copy map-services script to tripleo elements
map-services will be removed on dib v2 branch, but
tripleo still relies heavily on it. To prevent breakage,
copy the script to the internal element using it.
In the future, all elements will need to be migrated
to new svc-map, but it is a massive change.

Change-Id: I9f450de66044123ab07fa498b68f744d1029089a
2016-12-05 12:37:17 +01:00
Ben Nemec 638a863db8 Remove mysql-dev dependency from os-svc-install
Looking through the image build logs, I noticed we were pulling in
the mysql-devel packages for some reason.  It turns out this is a
historical artifact of the old TripleO source installs using
os-svc-install.  It was universally installing mysql-python on
every image where it was used because that package wasn't in the
requirements.txt for the OpenStack projects.

This was wrong in the first place, and now that we aren't supporting
that installation method anymore it doesn't make sense to keep
installing nine development packages that we'll never use on our
images.

Note that the only thing we use from os-svc-install now appears to
be os-svc-enable, so this should have no effect on the current
TripleO flow, except slightly smaller/faster image builds.

Change-Id: Iae3e6ae3f57de57639c4259361e82c8150fe2f0e
2016-03-10 13:29:10 -06:00
Derek Higgins 85c68ffc75 Update pbr version to match global requirements
The version of pbr we were using was having trouble parsing a new version
identifier for python-qpid, We have the pbr version hardcoded in many
places so update it to match whats currently in global-requirements.

Fixes bug #1470871
Change-Id: Ia5aec472555ad1368684b224a55c29242ae40b58
2015-07-02 16:53:06 +01:00
Gregory Haynes 4c31859fbb Log from upstart console
We are no longer piping our service output to logger, so we should be
logging the stdout via upstart. This is useful for detecting tracebacks
and other info which does not go through python logging.

Change-Id: I5d4abb94ff15f74fd2478e70d0fa4d3bb9c09f2d
2015-01-14 19:50:42 -08:00
Jenkins ea88e1ad12 Merge "Remove setuptools <8.0 pinning" 2015-01-09 17:35:47 +00:00
Gregory Haynes d338bce587 Remove setuptools <8.0 pinning
This was added in If3300a6b1ef1c633fc339f884e9dab0d82bc0720 and should
be removed now that the new setuptools version fixes our issues.

Change-Id: I3ded4f83918d74ca91a8c7a4aede9ef4d1d7a489
2015-01-05 09:44:26 -08:00
Jenkins a39ec21014 Merge "Log directly to syslog from os services" 2015-01-05 17:29:44 +00:00
Gregory Haynes 5fc2040aa5 Log directly to syslog from os services
We currently have a horrible hack for upstart where we run our services
with stdout and stderr piped into logger. There are lots of issues with
this, such as upstart has a hard time knowing which PID to track.
Conveniently, python logging knows how to syslog, so why not just use
that!

This changes the default behaviour of os-svc-daemon to create a python
logging.conf so services log directly to syslog.

This also changes the default upstart respawn limiting to be 2 fails in
10 secs. This is becauce making upstart monitor the actual service
daemon was causing some services to respawn loop due to time it took
them to fail.

Closes-Bug: #1385346

Change-Id: Ibd491881d79160ad1457526d51512f5fc1cf9ea5
2015-01-05 09:28:57 -08:00
Gregory Haynes 01694b1547 Pin setuptools to <8.0
Setuptools 8.0 changed the way it parses version strings and many of our
openstack packages break when using it. Pinning this for now until our
packages are fixed.

Closes-Bug: #1402305

Change-Id: If3300a6b1ef1c633fc339f884e9dab0d82bc0720
2014-12-14 10:54:37 -08:00
Gregory Haynes 57dd108fd0 Deprecate positional args for os-svc-daemon
We advertise supporting passthrough arguments in os-svc-daemon by using
'--' followed by extra params. This does not work if using the
undocumented old-style positional arguments and fixing this is a
non-trivial parsing problem. Lets just deprecate this old behaviour so
we can remove it.

Change-Id: I0e75f7f975325b5f199daf697004628461a20075
2014-12-01 18:20:47 -08:00
Tom Howley cbff052e66 Install os clients from git
When installing openstack clients, which have been pulled in as
requirements for openstack services, allow for the installation
from source repos, if the source install type has been selected.

Change-Id: I72037c5679b17102de5df02d08194fdb56f856d4
Closes-Bug: 1390051
2014-11-18 13:28:20 +00:00
Derek Higgins 5b228d2064 Revert "We need to tell upstart to expect the logger fork"
This reverts commit 615c6bb95b.
Using "expect fork" results in hitting a bug causing some service
restarts to hang which in turn is preventing os-refresh-config
from completing.
https://bugs.launchpad.net/upstart/+bug/406397

Change-Id: Ib893b1428e3cac3084d07b4d98c9cb69d60bb3cf
2014-11-13 11:25:31 +00:00
Michael Kerrin 615c6bb95b We need to tell upstart to expect the logger fork
Otherwise upstart doesn't get the correct process id for the service
and in some causes can fail to kill the process during a servcie stop

Change-Id: I138dd2206ed1e511fbabaf43bd3cb1d163c76db4
Closes-bug: #1385346
2014-10-24 16:42:12 +01:00
Gonéri Le Bouder a59e7ea360 systemd: always use /lib/systemd
Debian and Ubuntu use /lib/systemd whereas Fedora usr /usr/lib/systemd as the
default system unit directory. This already leads to conflict when the
debian-systemd is used.

Fedora provides a symbolic link between /lib/systemd and /usr/lib/systemd
to also support /lib/systemd directory. With this patch, we use /lib/systemd
everywhere.

This patch supersedes I413a92284e6a79e7fcdde99c5138bc3ce8e85e80.

Change-Id: I459f7514ab35082d31607968252a9005fa25de2a
See: https://bugs.debian.org/719634
2014-10-17 10:27:28 +02:00
Ryan Brady 90b2f10302 Fix os-svc-install
The 'a' option was missing from the getops set of available options
in os-svc-restart.  This is causing CI failures in patces with an
"illegal operation -- a" error.[1]  This patch adds the 'a' option
to os-svc-restart.

[1] Ib3bc5c47de1b8bb6006530d56e9d47c3763af7b5

Change-Id: I527c5b0cda0cda7877d23422702517760c1bf340
2014-10-09 18:09:23 -04:00
Ryan Brady 49dbaae6df Add initial svc-map support
This patch incorporates the svc-map patch[1] into other
elements by integrating svc-map into the os-svc-install
element.  This patch adds the -a option to select svc-map
instead of the default of map-services.  The -a option
enables a phased transition from map-services to svc-map
usage throughout the rest of the elements.

[1] Id11433ea342aace71a358936a7ca3151ec11d506

Change-Id: I382631746e458f2f8603a7dcf5221a21f4b53255
2014-10-02 10:35:54 -04:00
Jenkins 42ffac22e1 Merge "Revert "Pull in patched eventlet to fix Second Simultaneous errors"" 2014-09-12 14:09:45 +00:00
Steve Kowalik f1d096d95a Drop all direct usage of systemctl enable
Since we already have a wrapper script for enabling services called
os-svc-enable, drop all direct usage of systemctl enable, replacing
it with os-svc-enable.

Also drive-by replacements of == with =. == is a pattern match.

Change-Id: I707bf6f02207308e8f61caff17a27b0697096359
2014-09-05 15:11:08 +10:00
Jenkins 42f751106c Merge "Log tripleo services to syslog" 2014-08-22 15:48:00 +00:00
Michael Kerrin 872e508215 Revert "Pull in patched eventlet to fix Second Simultaneous errors"
This reverts commit 0011e19c15.

Eventlet version 0.15.1 has been released with the fix to the
"Second Simultaneous error"

Change-Id: I1e6e27f32f1b24e14a4ecb91f3433647fbb69a3e
2014-08-18 17:23:44 +01:00
Richard Su bd228e4b3a Fix /var/run SELinux file contexts
/var/run/<service> needs to be relabeled with the correct file
contexts. With systemd, these directories are created anew each
boot by /lib/systemd/system/<service>-create-dir.service.
os-svc-daemon was updated to correct the file contexts.

Change-Id: I6487d0726db08912eed3062dfee2552940eadcfb
Closes-Bug: 1346559
2014-08-01 17:12:31 -07:00
Michael Kerrin 0011e19c15 Pull in patched eventlet to fix Second Simultaneous errors
We have patched eventlet to resolve the issues around
Second simultanous read errors. Pulling in the eventlet
pull request here.

This is a temporary workaround until the changes get merged
into eventlet and released at which point this will be dropped.

Closes-bug: #1308079
Closed-bug: #1229475
Closed-bug: #1308045
Change-Id: I0495f8c443429d9bdbbd97d46fe9a8e180b867ee
2014-07-28 10:07:01 -04:00
Steve Kowalik 2171b584a2 Support init.d-using services in os-svc-enable
os-svc-enable-upstart currently only works for Upstart scripts,
and will print a warning that the job doesn't exist, and then
create an .enable file anyway. If the action is enable, and the
Upstart config file doesn't exist, but the initscript does, run
update-rc.d.

Change-Id: Ib1e3d4e2963dd2ce4d96078781a929205c25d886
2014-07-21 15:00:21 -04:00
Derek Higgins 1ad23b193f Log tripleo services to syslog
Logging to an upstart logfile results in log entries that are not
associated with a timestamp(e.g. os-collect-config). This isn't
consistent with the log files produced in other openstack CI tests
and means we can't index them in logstash (at least consistently
with how the other projects are indexed).

As a result of this we will need to remove the double time stamps that
get produced (by taking them out in each of the services configuration)
and extract the log at the end of CI into per-service files so that we
can selectively index the files we want.

In particular the service that doesn't contain timestamps in all of the
log entries is os-collect-config which is arguably one of the most
important service logs we want indexed. We could simply just divert this
service alone to syslog but doing them all is more consistent with other
distros and how this will presumably work when ubuntu moves to systemd.

Change-Id: Ib8c1fc39d56b2b9c6d8e9b64a868def619aa2f1f
2014-07-03 22:49:17 +01:00
Gonéri Le Bouder 0a71316726 indent using 4 spaces (3/3)
As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should
use 4 spaces for indentation.
This commit enforces the use of 4 spaces indentation.
In order to simplify the review process, this patch only cover the
following elements:
 - os-apply-config
 - os-collect-config
 - os-refresh-config
 - os-svc-install
 - pacemaker
 - pypi-mirror
 - qpidd
 - rabbitmq-server
 - snmpd
 - stackuser
 - tripleo-cd

Change-Id: I3f365f6a1cd6fd9e56402ad3bd6572192b85d798
2014-05-23 00:32:41 +02:00
Jenkins c6e922197a Merge "Allow os-svc-daemon to specify dir name with -d option" 2014-03-27 14:58:27 +00:00
Ben Nemec 97f9fbed77 Allow os-svc-daemon to specify dir name with -d option
In some circumstances we need to be able to create a /var/run
directory without actually installing a service.  This behavior
was supported before, but these changes allow the user to specify
the directory name and streamline the process by making -c an
optional parameter instead of requiring a dummy value.  It also
makes this functionality available on upstart-based systems.

The existing uses of -d had to be updated as well to reflect this
new behavior.

Change-Id: I34f33f2290eeefb5be82c0cf5198ae53d34332ce
2014-03-25 13:53:59 -05:00
Jon-Paul Sullivan 1c998eb93f Create pip manifest files of installed packages
Create the pip-manifest element to encapsulate the saving and use
of pip manifest files.

Ensure that it installs prior to any elements that should be able
to use it.

Write pip manifest files for installs in:
    * os-svc-install
    * os-apply-config
    * os-collect-config
    * os-refresh-config
    * openstack-clients

Enable using a manifest file to reinstall exact versions of
packages in a subsequent run through the DIB_PIP_MANIFEST_*
environment variables.

Change-Id: I4d4ab5921c534727b48cb9969ec8ecfd2c26e6ed
2014-03-25 12:22:59 +00:00
Jenkins 3815353d6d Merge "Explicitly install pbr via pip" 2014-03-24 23:24:33 +00:00
Gregory Haynes aa62d27972 Explicitly install pbr via pip
When a pypi mirror is used with certain conditions installing pbr as a
dependency fails.  This is a temporary fix until the underlying cause
is resolved.

This is also required for a wheels based pip mirror to work.

Change-Id: Ia08eb16b96d9897fa2f86239ea264b145ef0b9b5
Closes-Bug: #1293812
2014-03-24 12:43:01 -07:00
Dan Prince 848f2b881b Add -i options to os-svc-install/os-svc-daemon...
Update os-svc-install with a new -i option which can be used
to specify the virtualenv directory.

Update os-svc-install with a new -s option which can be used
to enable system-site-packages within the virtualenv. By
default this is disabled (matches virtualenv's default...)
In doing this we remove a hard coded check for the 'nova' service
by making nova use the -s option instead.

Update os-svc-daemon with a new -i option which can be used
to specify the virtualenv directory.

NOTE:
 I used -i for both os-svc-daemon and os-svc-install since it wasn't
 already used and I wanted to make the option the same in both places.

Change-Id: Ief53567711b0153de890d50a28c471b1e5acd56c
2014-03-24 09:55:53 -04:00
Dan Prince 35bebaeb68 Drop the os-svc-install -n -c options.
Updates os-svc-install so that we disallow the -n and -c options.

Also, corrects the optargs for -h so that it doesn't take a parameter.
And fix some variable bound issues that could occur if the script
was executed with invalid args.

Change-Id: I4eb26fe6793aa1ad19b1dddc63a5f399e17a8325
Closes-bug: #1285283
2014-03-12 09:49:10 -04:00
Michael Kerrin 09e1abdfdc Install latest version of pip and virtualenv
We install pip with get-pip.py and use this to install virtualenv. This
is done as part of the new pip-and-virtualenv element. All elements that
need pip or virtualenv should use this element to install them.

Our motivation is that we need to talk to a pypi mirror generated with
a recent http://github.com/openstack-infra/pypi-mirror This mirror
caches some 'wheels' that the previous version of pip & virtualenv
can't install.

virtualenv contains its own version of pip that is used for all
virtualenv environments.

Change-Id: I282fd8fffc8d5707a078f78f2b4571138d7266f3
2014-03-10 10:06:59 +00:00
James Slagle 8475d117d7 Ability to add *-create-dir service separately
For systemd services, we create 2 services: one for the daemon and one
that creates the run directory under /var/run for the daemon.

For the packaged installs, the daemon service is already provided by the
package, so we need the ability to add just the *-create-dir service.

Some might say that the package should create it's run directory...and
it in fact does. However, we are reconfiguring the services to use
/var/run and the package uses /var/lib. Since /var/run is tmpfs mounted,
we need the *-create-dir services for the packages as well.

Change-Id: If26d9d7da04d3d1d97809db0e21e54dd9f8042ca
2014-02-18 07:49:19 -05:00
Ralf Haferkamp 4175a75c18 Install systemd service files into /usr/lib/
Install systemd service files into a location that will work on Fedora as well
as on openSUSE. Note, that on Fedora /lib is just a symlink to /usr/lib anyway.

Change-Id: If1dcd0d428d36d587fab501d42b0c8689a972e31
2014-02-07 14:30:31 +01:00
Robert Collins 0c38854ef9 Fix os-svc-restart to exit correctly without -n.
Similar to os-svc-enable, it was trying to run when invoked
incorrectly.

Change-Id: Ice285d3796149f0c82521da7c5112375cf15c1fe
2014-02-07 12:24:14 +13:00
Robert Collins 51e2d265d2 os-svc-enable should error when no svcname given.
The usage call when checking for SERVICENAME did not exit. Ooops.

Change-Id: Ie0cbc0f8abf8801f71f2b846af11e73dfed9af8e
2014-02-07 12:24:14 +13:00
Clint Byrum 2a49ab0c84 Do not drop databases without a good reason
We don't always use os-db-create on an empty database server. This script
should just create, as its name implies. Dropping whole databases is an
extremely important operation and should not be done "just in case".

Change-Id: I1dbdab0fd81ba6abbd87b5bd6fcf213f0fe51455
2014-01-24 12:06:35 -08:00
James Slagle 5015d43116 Add os-svc-restart
Add os-svc-restart, a helper script to restart a service. It uses
map-services to figure out the actual service name, as the service name
can differ based on the distro being used and also if installing from
source or packages.  Currently, only if the init system is systemd will
a call out to map-services be done. This matches the pattern from
install-packages where map-packages is not used on dpkg systems since
those package names are used as the default in the source install
scripts.

Having a helper script will avoid the proliferation of the following
pattern everywhere:

service foo restart || service foo-by-another-name restart

This also significantly reduces errors in the log due to the above,
which can be misleading.

Depends on Change-Id: Ie7b2dcfa7cabd887d5c212df110d90f9d00a7f65

Change-Id: I15eb2a5db4b0a08e1fb40bda640cd8f224939a92
2014-01-23 07:05:02 -05:00
Clint Byrum c04d472064 Export OS_SVC_ENABLE_CONTROl in upstart jobs
Without this export os-svc-enable.conf never sees the starting event and
thus never does anything to prevent starting the job.

Change-Id: Ib94c817ce3f2e6c3aada1515beea6e7fb41605af
2013-12-16 07:45:32 -08:00
Clint Byrum a6f86e6ef9 Fix os-svc-daemon missing env in upstart jobs
Recent changes landed to set the environment variable
OS_SVC_ENABLE_CONTROL=1 but the env statement was left out, rendering
the upstart job completely broken as the syntax is now invalid.

Change-Id: I88a7a63304d1fe759067e47e2fab88ee27f91914
2013-12-16 07:43:13 -08:00
Dan Prince bac203b672 Don't enable services in os-svc-install
Now that we call os-svc-enable in the individual elements we
can drop the call here.

With this commit *most* services will no longer autostart on first boot
and will rely on post-configuration scripts in os-refresh-config
to enable services. This should clean up our first boot logs
quite a bit...

Change-Id: Ied3622a5e7fce4c3ac2fbd9a0e513ae877cafc5d
2013-12-12 21:04:47 -05:00
Dan Prince 4e482c192a Enable services with os-svc-enable
Split out the code which enables services to start on boot into
a new os-svc-enable script. This script is currently called by
os-svc-deamon so that services automatically start on first boot
(as is the case with os-svc-install)

The motivation here is to decouple service installation and enabling
so that we can eventually avoid starting services on first boot
until after they are configured. Auto starting services on boot like
we currently do is causing lots of log ERROR messages, etc.

Change-Id: I66d4660c169f5918e924eab1876134891c3a24a1
2013-12-12 10:26:42 -05:00
Clint Byrum d359aed182 Add a service enable/disable mechanism for upstart
Upstart doesn't have its own service enable/disable mechanism. We are in
need of a facility to enable/disable services without writing to /etc at
runtime to enable a readonly root for image based updates. This command
will be used by later changes to have a generic service enable/disable
mechanism for all init systems.

Change-Id: I931281988aa746f93de190794f68f4c9e628db19
2013-12-10 20:55:31 -08:00