Merge "Add magnum"
This commit is contained in:
commit
e73b411f29
317
openstack/magnum/magnum.spec.j2
Normal file
317
openstack/magnum/magnum.spec.j2
Normal file
@ -0,0 +1,317 @@
|
||||
{% set pypi_name = 'magnum' %}
|
||||
{% set source = fetch_source('https://tarballs.openstack.org/magnum/magnum-master.tar.gz') %}
|
||||
{% set upstream_version = upstream_version() %}
|
||||
{% set rpm_release = '1' %}
|
||||
%global with_doc 1
|
||||
%if 0%{?rhel} || 0%{?fedora}
|
||||
%global rdo 1
|
||||
%endif
|
||||
Name: {{ py2name() }}
|
||||
Version: {{ py2rpmversion() }}
|
||||
Release: {{ py2rpmrelease() }}
|
||||
Epoch: {{ epoch('magnum') }}
|
||||
Summary: OpenStack container orchestration engines (Magnum)
|
||||
License: {{ license('Apache-2.0') }}
|
||||
URL: https://launchpad.net/magnum
|
||||
Source0: {{ source|basename }}
|
||||
Source1: openstack-magnum.logrotate
|
||||
Source2: openstack-magnum.sudoers
|
||||
Source3: openstack-magnum.tmpfiles
|
||||
Source4: openstack-magnum.defaultconf
|
||||
# systemd
|
||||
Source20: openstack-magnum-api.service
|
||||
Source21: openstack-magnum-conductor.service
|
||||
Source50: openstack-magnum.README.config
|
||||
BuildRequires: openstack-macros
|
||||
BuildRequires: {{ py3('PyYAML') }}
|
||||
BuildRequires: {{ py3('SQLAlchemy') }}
|
||||
BuildRequires: {{ py3('WSME') }}
|
||||
BuildRequires: {{ py3('WebOb') }}
|
||||
BuildRequires: {{ py3('Werkzeug') }}
|
||||
BuildRequires: {{ py3('python-barbicanclient') }}
|
||||
BuildRequires: {{ py3('docker') }}
|
||||
BuildRequires: {{ py3('python-glanceclient') }}
|
||||
BuildRequires: {{ py3('python-heatclient') }}
|
||||
BuildRequires: {{ py3('keystoneauth1') }}
|
||||
BuildRequires: {{ py3('keystonemiddleware') }}
|
||||
BuildRequires: {{ py3('kubernetes') }}
|
||||
BuildRequires: {{ py3('marathon') }}
|
||||
BuildRequires: {{ py3('mock') }}
|
||||
BuildRequires: {{ py3('python-neutronclient') }}
|
||||
BuildRequires: {{ py3('python-novaclient') }}
|
||||
BuildRequires: {{ py3('python-octaviaclient') }}
|
||||
BuildRequires: {{ py3('oslo.concurrency') }}
|
||||
BuildRequires: {{ py3('oslo.config') }}
|
||||
BuildRequires: {{ py3('oslo.context') }}
|
||||
BuildRequires: {{ py3('oslo.db') }}
|
||||
BuildRequires: {{ py3('oslo.i18n') }}
|
||||
BuildRequires: {{ py3('oslo.log') }}
|
||||
BuildRequires: {{ py3('oslo.messaging') }}
|
||||
BuildRequires: {{ py3('oslo.middleware') }}
|
||||
BuildRequires: {{ py3('oslo.policy') }}
|
||||
BuildRequires: {{ py3('oslo.reports') }}
|
||||
BuildRequires: {{ py3('oslo.serialization') }}
|
||||
BuildRequires: {{ py3('oslo.service') }}
|
||||
BuildRequires: {{ py3('oslo.upgradecheck') }}
|
||||
BuildRequires: {{ py3('oslo.utils') }}
|
||||
BuildRequires: {{ py3('oslo.versionedobjects') }}
|
||||
BuildRequires: {{ py3('oslotest') }}
|
||||
BuildRequires: {{ py3('osprofiler') }}
|
||||
BuildRequires: {{ py3('pbr') }}
|
||||
BuildRequires: {{ py3('pecan') }}
|
||||
BuildRequires: {{ py3('stestr') }}
|
||||
BuildRequires: {{ py3('taskflow') }}
|
||||
BuildRequires: sudo
|
||||
Requires: logrotate
|
||||
Requires: python3-{{ pypi_name }} = %{epoch}:%{version}-%{release}
|
||||
BuildArch: noarch
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%{?systemd_requires}
|
||||
%else
|
||||
BuildRequires: systemd
|
||||
Requires(post): systemd
|
||||
Requires(postun): systemd
|
||||
Requires(preun): systemd
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
Requires(pre): pwdutils
|
||||
%endif
|
||||
%if 0%{?rdo}
|
||||
Requires(pre): shadow-utils
|
||||
%endif
|
||||
|
||||
%description
|
||||
Magnum is an OpenStack project which offers container orchestration engines for
|
||||
deploying and managing containers as first class resources in OpenStack.
|
||||
|
||||
%package -n python3-{{ pypi_name }}
|
||||
Summary: OpenStack container orchestration engines (Magnum) - python module
|
||||
Group: Development/Languages/Python
|
||||
Requires: {{ py3('Babel') }}
|
||||
Requires: {{ py3('PyYAML') }}
|
||||
Requires: {{ py3('SQLAlchemy') }}
|
||||
Requires: {{ py3('WSME') }}
|
||||
Requires: {{ py3('WebOb') }}
|
||||
Requires: {{ py3('Werkzeug') }}
|
||||
Requires: {{ py3('alembic') }}
|
||||
Requires: {{ py3('python-barbicanclient') }}
|
||||
Requires: {{ py3('cliff') }}
|
||||
Requires: {{ py3('cryptography') }}
|
||||
Requires: {{ py3('decorator') }}
|
||||
Requires: {{ py3('docker') }}
|
||||
Requires: {{ py3('eventlet') }}
|
||||
Requires: {{ py3('python-glanceclient') }}
|
||||
Requires: {{ py3('python-heatclient') }}
|
||||
Requires: {{ py3('iso8601') }}
|
||||
Requires: {{ py3('jsonpatch') }}
|
||||
Requires: {{ py3('keystoneauth1') }}
|
||||
Requires: {{ py3('keystonemiddleware') }}
|
||||
Requires: {{ py3('kubernetes') }}
|
||||
Requires: {{ py3('marathon') }}
|
||||
Requires: {{ py3('netaddr') }}
|
||||
Requires: {{ py3('python-neutronclient') }}
|
||||
Requires: {{ py3('python-novaclient') }}
|
||||
Requires: {{ py3('python-octaviaclient') }}
|
||||
Requires: {{ py3('oslo.concurrency') }}
|
||||
Requires: {{ py3('oslo.config') }}
|
||||
Requires: {{ py3('oslo.context') }}
|
||||
Requires: {{ py3('oslo.db') }}
|
||||
Requires: {{ py3('oslo.i18n') }}
|
||||
Requires: {{ py3('oslo.log') }}
|
||||
Requires: {{ py3('oslo.messaging') }}
|
||||
Requires: {{ py3('oslo.middleware') }}
|
||||
Requires: {{ py3('oslo.policy') }}
|
||||
Requires: {{ py3('oslo.reports') }}
|
||||
Requires: {{ py3('oslo.serialization') }}
|
||||
Requires: {{ py3('oslo.service') }}
|
||||
Requires: {{ py3('oslo.upgradecheck') }}
|
||||
Requires: {{ py3('oslo.utils') }}
|
||||
Requires: {{ py3('oslo.versionedobjects') }}
|
||||
Requires: {{ py3('osprofiler') }}
|
||||
Requires: {{ py3('pecan') }}
|
||||
Requires: {{ py3('pycadf') }}
|
||||
Requires: {{ py3('requests') }}
|
||||
Requires: {{ py3('setuptools') }}
|
||||
Requires: {{ py3('six') }}
|
||||
Requires: {{ py3('stevedore') }}
|
||||
Requires: {{ py3('taskflow') }}
|
||||
Requires: sudo
|
||||
|
||||
%description -n python3-{{ pypi_name }}
|
||||
Magnum is an OpenStack project which offers container orchestration engines for
|
||||
deploying and managing containers as first class resources in OpenStack.
|
||||
|
||||
This package contains the python module.
|
||||
|
||||
%if 0%{?with_doc}
|
||||
%package doc
|
||||
Summary: OpenStack container orchestration engines (Magnum) - documentation
|
||||
Group: Documentation/HTML
|
||||
BuildRequires: {{ py3('Sphinx') }}
|
||||
BuildRequires: {{ py3('openstackdocstheme') }}
|
||||
|
||||
%description doc
|
||||
Magnum is an OpenStack project which offers container orchestration engines for
|
||||
deploying and managing containers as first class resources in OpenStack.
|
||||
|
||||
This package contains the documentation.
|
||||
%endif
|
||||
|
||||
%package api
|
||||
Summary: OpenStack container orchestration engines (Magnum) - API
|
||||
Group: Development/Languages/Python
|
||||
Requires: python3-{{ pypi_name }} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description api
|
||||
Magnum is an OpenStack project which offers container orchestration engines for
|
||||
deploying and managing containers as first class resources in OpenStack.
|
||||
|
||||
This package contains the API server.
|
||||
|
||||
%package conductor
|
||||
Summary: OpenStack container orchestration engines (Magnum) - Conductor
|
||||
Group: Development/Languages/Python
|
||||
Requires: python3-{{ pypi_name }} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description conductor
|
||||
Magnum is an OpenStack project which offers container orchestration engines for
|
||||
deploying and managing containers as first class resources in OpenStack.
|
||||
|
||||
This package contains the conductor server.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
|
||||
%py_req_cleanup
|
||||
|
||||
%build
|
||||
%{py3_build}
|
||||
|
||||
# build documentation
|
||||
%if 0%{?with_doc}
|
||||
PYTHONPATH=. PBR_VERSION={{ upstream_version }} %sphinx_build --keep-going -b html doc/source doc/build/html
|
||||
rm -rf doc/build/html/.{doctrees,buildinfo}
|
||||
%endif
|
||||
|
||||
### sample config files
|
||||
PYTHONPATH=. oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf --output-file etc/magnum.conf.sample
|
||||
PYTHONPATH=. oslopolicy-sample-generator --config-file=etc/magnum/magnum-policy-generator.conf --output etc/magnum/policy.json.sample
|
||||
|
||||
%install
|
||||
%{py3_install}
|
||||
|
||||
# Setup directories
|
||||
install -d -m 750 %{buildroot}%{_localstatedir}/{lib,log,cache}/magnum
|
||||
install -d -m 750 %{buildroot}%{_localstatedir}/lib/magnum/certificates
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/magnum
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/magnum/magnum.conf.d
|
||||
|
||||
# install logrotate
|
||||
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
||||
|
||||
# Install sudoers
|
||||
install -p -D -m 440 %{SOURCE2} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}
|
||||
|
||||
# install tmpfiles
|
||||
install -D -m 644 %{SOURCE3} %{buildroot}/%_tmpfilesdir/%name.conf
|
||||
|
||||
# install config files
|
||||
mv %{buildroot}/%{_prefix}/%{_sysconfdir}/magnum/* %{buildroot}%{_sysconfdir}/magnum/
|
||||
install -p -D -m 640 %{SOURCE4} %{buildroot}%{_sysconfdir}/magnum/magnum.conf.d/010-magnum.conf
|
||||
install -p -D -m 640 %{SOURCE50} %{buildroot}%{_sysconfdir}/magnum/README.config
|
||||
install -p -D -m 644 etc/magnum.conf.sample %{buildroot}%{_sysconfdir}/magnum/magnum.conf
|
||||
install -p -D -m 644 etc/magnum/policy.json.sample %{buildroot}%{_sysconfdir}/magnum/policy.json
|
||||
install -p -D -m 644 etc/magnum/api-paste.ini %{buildroot}%{_sysconfdir}/magnum/
|
||||
|
||||
# install systemd service files
|
||||
install -p -D -m 644 %{SOURCE20} %{buildroot}%{_unitdir}/openstack-magnum-api.service
|
||||
install -p -D -m 644 %{SOURCE21} %{buildroot}%{_unitdir}/openstack-magnum-conductor.service
|
||||
|
||||
# install symlinks on SUSE
|
||||
%if 0%{?suse_version}
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-conductor
|
||||
%endif
|
||||
|
||||
%pre
|
||||
%openstack_pre_user_group_create magnum magnum /sbin/nologin
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
%check
|
||||
# we don't want to depend on hacking
|
||||
rm magnum/tests/unit/test_hacking.py
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
python3 -m stestr.cli run
|
||||
|
||||
%post api
|
||||
%systemd_post %{name}-api.service
|
||||
|
||||
%preun api
|
||||
%systemd_preun %{name}-api.service
|
||||
|
||||
%postun api
|
||||
%systemd_postun_with_restart %{name}-api.service
|
||||
|
||||
%post conductor
|
||||
%systemd_post %{name}-conductor.service
|
||||
|
||||
%preun conductor
|
||||
%systemd_preun %{name}-conductor.service
|
||||
|
||||
%postun conductor
|
||||
%systemd_postun_with_restart %{name}-conductor.service
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%dir %attr(0750, magnum, magnum) %{_localstatedir}/log/magnum
|
||||
%dir %attr(0750, magnum, magnum) %{_localstatedir}/lib/magnum
|
||||
%dir %attr(0750, magnum, magnum) %{_localstatedir}/lib/magnum/certificates
|
||||
%dir %attr(0750, magnum, magnum) %{_localstatedir}/cache/magnum
|
||||
%dir %attr(0750, root, magnum) %{_sysconfdir}/magnum
|
||||
%dir %attr(0750, root, magnum) %{_sysconfdir}/magnum/magnum.conf.d/
|
||||
%{_sysconfdir}/magnum/README.config
|
||||
%config(noreplace) %attr(0640, root, magnum) %{_sysconfdir}/magnum/magnum.conf
|
||||
%config(noreplace) %attr(0640, root, magnum) %{_sysconfdir}/magnum/magnum.conf.d/010-magnum.conf
|
||||
%config(noreplace) %attr(0640, root, magnum) %{_sysconfdir}/magnum/api-paste.ini
|
||||
%config(noreplace) %{_sysconfdir}/magnum/policy.json
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-magnum
|
||||
%config(noreplace) %{_sysconfdir}/sudoers.d/openstack-magnum
|
||||
%_tmpfilesdir/%name.conf
|
||||
%{_bindir}/magnum-db-manage
|
||||
%{_bindir}/magnum-driver-manage
|
||||
%{_bindir}/magnum-status
|
||||
|
||||
%files -n python3-magnum
|
||||
%license LICENSE
|
||||
%{python3_sitelib}/magnum*
|
||||
%{python3_sitelib}/magnum-*.egg-info
|
||||
|
||||
%if 0%{?with_doc}
|
||||
%files doc
|
||||
%license LICENSE
|
||||
%doc doc/build/html
|
||||
%endif
|
||||
|
||||
%files api
|
||||
%license LICENSE
|
||||
%{_bindir}/magnum-api
|
||||
%{_unitdir}/openstack-magnum-api.service
|
||||
%if 0%{?suse_version}
|
||||
%{_sbindir}/rc%{name}-api
|
||||
%endif
|
||||
|
||||
%files conductor
|
||||
%license LICENSE
|
||||
%{_bindir}/magnum-conductor
|
||||
%{_unitdir}/openstack-magnum-conductor.service
|
||||
%if 0%{?suse_version}
|
||||
%{_sbindir}/rc%{name}-conductor
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
17
openstack/magnum/openstack-magnum-api.service
Normal file
17
openstack/magnum/openstack-magnum-api.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=OpenStack container orchestration engines (Magnum) - API
|
||||
After=syslog.target network.target
|
||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=magnum
|
||||
Group=magnum
|
||||
WorkingDirectory=/var/lib/magnum
|
||||
PrivateTmp=yes
|
||||
ExecStartPre=-/usr/bin/magnum-db-manage upgrade
|
||||
ExecStart=/usr/bin/magnum-api
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
openstack/magnum/openstack-magnum-conductor.service
Normal file
16
openstack/magnum/openstack-magnum-conductor.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=OpenStack container orchestration engines (Magnum) - Conductor
|
||||
After=syslog.target network.target
|
||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=magnum
|
||||
Group=magnum
|
||||
WorkingDirectory=/var/lib/magnum
|
||||
PrivateTmp=yes
|
||||
ExecStart=/usr/bin/magnum-conductor
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
30
openstack/magnum/openstack-magnum.README.config
Normal file
30
openstack/magnum/openstack-magnum.README.config
Normal file
@ -0,0 +1,30 @@
|
||||
The main service configuration (/etc/$project/$project.conf) can still be used
|
||||
for configuration but the preferred way is to add config file snippets into
|
||||
/etc/$project/$project.conf.d/ instead.
|
||||
|
||||
As part of the packaging, the package itself installs a config snippet at
|
||||
/etc/$project/$project.conf.d/010-$project.conf with basic configuration. This
|
||||
file should not be modified. In case there is a need to overwrite or add
|
||||
settings, a XXX-$project.conf (XXX being a 3 digit number) should be created
|
||||
instead.
|
||||
|
||||
Config directory file snippet naming should follow these conventions:
|
||||
- snippets should start with "XXX-" where "X" is a number
|
||||
- snippets must end with ".conf"
|
||||
- config management systems (Crowbar, Salt, ...) should use numbers
|
||||
between 100 and 499
|
||||
- users should use numbers starting from 500
|
||||
|
||||
Configuring just a single $program (eg for Nova, $project is "nova" and
|
||||
$program is "nova-api", "nova-compute", "nova-scheduler", ...) can be done
|
||||
in a similar way. The config snippets should be placed in
|
||||
/etc/$project/$program.conf.d/ . The same snippets rules apply here, too.
|
||||
|
||||
$program reads the configuration files in the following order:
|
||||
- /etc/$project/$project.conf
|
||||
- /etc/$project/$project.conf.d/*.conf (lexically sorted)
|
||||
- /etc/$project/$program.conf.d/*.conf (lexically sorted)
|
||||
|
||||
The last configured key overwrites all previous ones. In particular, settings
|
||||
in /etc/$project/$project.conf are overwritten by config values from any file
|
||||
in /etc/$project/$project.conf.d/XXX-$project.conf .
|
12
openstack/magnum/openstack-magnum.defaultconf
Normal file
12
openstack/magnum/openstack-magnum.defaultconf
Normal file
@ -0,0 +1,12 @@
|
||||
[DEFAULT]
|
||||
log_dir=/var/log/magnum
|
||||
state_path=/var/lib/magnum
|
||||
|
||||
[oslo_concurrency]
|
||||
lock_path=/run/magnum
|
||||
|
||||
[oslo_policy]
|
||||
policy_file=/et/magnum/policy.json
|
||||
|
||||
[certificates]
|
||||
cert_manager_type=local
|
11
openstack/magnum/openstack-magnum.logrotate
Normal file
11
openstack/magnum/openstack-magnum.logrotate
Normal file
@ -0,0 +1,11 @@
|
||||
/var/log/magnum/*.log {
|
||||
compress
|
||||
dateext
|
||||
minsize 100k
|
||||
missingok
|
||||
notifempty
|
||||
rotate 10
|
||||
size 1M
|
||||
su magnum magnum
|
||||
weekly
|
||||
}
|
3
openstack/magnum/openstack-magnum.sudoers
Normal file
3
openstack/magnum/openstack-magnum.sudoers
Normal file
@ -0,0 +1,3 @@
|
||||
Defaults:magnum syslog_goodpri=none, !pam_session
|
||||
|
||||
magnum ALL = (root) NOPASSWD: /usr/bin/magnum-rootwrap /etc/magnum/rootwrap.conf *
|
1
openstack/magnum/openstack-magnum.tmpfiles
Normal file
1
openstack/magnum/openstack-magnum.tmpfiles
Normal file
@ -0,0 +1 @@
|
||||
d /run/magnum 0700 magnum magnum -
|
Loading…
x
Reference in New Issue
Block a user