[openstack-cinder] initial import (#856722)

Pádraig Brady pbrady at fedoraproject.org
Fri Sep 14 09:27:43 UTC 2012


commit 04c482ee8116248bbd70b40922fcc3333b4448dc
Author: Pádraig Brady <P at draigBrady.com>
Date:   Fri Sep 14 10:26:02 2012 +0100

    initial import (#856722)

 .gitignore                                         |    1 +
 ...e-don-t-access-the-net-when-building-docs.patch |   24 ++
 cinder-sudoers                                     |    3 +
 cinder.conf                                        |    8 +
 cinder.logrotate                                   |    9 +
 openstack-cinder-api.service                       |   12 +
 openstack-cinder-scheduler.service                 |   12 +
 openstack-cinder-volume.service                    |   12 +
 openstack-cinder.spec                              |  256 ++++++++++++++++++++
 sources                                            |    1 +
 10 files changed, 338 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..4ecc5ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cinder-2012.2~f3.tar.gz
diff --git a/0001-Ensure-we-don-t-access-the-net-when-building-docs.patch b/0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
new file mode 100644
index 0000000..424cd2e
--- /dev/null
+++ b/0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
@@ -0,0 +1,24 @@
+From 83de9eb2b8dd1b9eea559341f696b80251cc586b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
+Date: Fri, 6 Jan 2012 12:16:34 +0000
+Subject: [PATCH] Ensure we don't access the net when building docs
+
+(Note, this has not been sent upstream)
+
+Change-Id: I9d02fb4053a8106672aded1614a2850e21603eb2
+---
+ doc/source/conf.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff -Naur cinder-2012.2.orig/doc/source/conf.py cinder-2012.2/doc/source/conf.py
+--- cinder-2012.2.orig/doc/source/conf.py	2012-08-16 07:34:54.000000000 +0000
++++ cinder-2012.2/doc/source/conf.py	2012-09-03 01:14:15.661249090 +0000
+@@ -25,7 +25,7 @@
+ # Add any Sphinx extension module names here, as strings. They can be extensions
+ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+ 
+-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'ext.cinder_todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig','sphinx.ext.graphviz']
++extensions = ['sphinx.ext.autodoc', 'ext.cinder_todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig','sphinx.ext.graphviz']
+ 
+ # autodoc generation is a bit aggressive and a nuisance when doing heavy text edit cycles.
+ # execute "export SPHINX_DEBUG=1" in your terminal to disable
diff --git a/cinder-sudoers b/cinder-sudoers
new file mode 100644
index 0000000..ed5d479
--- /dev/null
+++ b/cinder-sudoers
@@ -0,0 +1,3 @@
+Defaults:cinder !requiretty
+
+cinder ALL = (root) NOPASSWD: /usr/bin/cinder-rootwrap /etc/cinder/rootwrap.conf *
diff --git a/cinder.conf b/cinder.conf
new file mode 100644
index 0000000..5b393c2
--- /dev/null
+++ b/cinder.conf
@@ -0,0 +1,8 @@
+[DEFAULT]
+logdir = /var/log/cinder
+state_path = /var/lib/cinder
+lock_path = /var/lib/cinder/tmp
+iscsi_helper = tgtadm
+sql_connection = mysql://cinder:cinder@localhost/cinder
+rpc_backend = cinder.openstack.common.rpc.impl_qpid
+rootwrap_config = /etc/cinder/rootwrap.conf
diff --git a/cinder.logrotate b/cinder.logrotate
new file mode 100644
index 0000000..dae9631
--- /dev/null
+++ b/cinder.logrotate
@@ -0,0 +1,9 @@
+compress
+
+/var/log/cinder/*.log {
+    weekly
+    rotate 4
+    missingok
+    compress
+    minsize 100k
+}
diff --git a/openstack-cinder-api.service b/openstack-cinder-api.service
new file mode 100644
index 0000000..0412bc2
--- /dev/null
+++ b/openstack-cinder-api.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenStack Cinder API Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-api --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/api.log
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/openstack-cinder-scheduler.service b/openstack-cinder-scheduler.service
new file mode 100644
index 0000000..32a69e7
--- /dev/null
+++ b/openstack-cinder-scheduler.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenStack Cinder Scheduler Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-scheduler --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/scheduler.log
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/openstack-cinder-volume.service b/openstack-cinder-volume.service
new file mode 100644
index 0000000..a1a9712
--- /dev/null
+++ b/openstack-cinder-volume.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenStack Cinder Volume Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-volume --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/openstack-cinder.spec b/openstack-cinder.spec
new file mode 100644
index 0000000..e1f00a5
--- /dev/null
+++ b/openstack-cinder.spec
@@ -0,0 +1,256 @@
+%global with_doc %{!?_without_doc:1}%{?_without_doc:0}
+
+Name:             openstack-cinder
+Version:          2012.2
+Release:          0.2.f3%{?dist}
+Summary:          OpenStack Volume service
+
+Group:            Applications/System
+License:          ASL 2.0
+URL:              http://www.openstack.org/software/openstack-storage/
+Source0:          https://launchpad.net/cinder/folsom/folsom-3/+download/cinder-2012.2~f3.tar.gz
+Source1:          cinder.conf
+Source2:          cinder.logrotate
+
+Source10:         openstack-cinder-api.service
+Source11:         openstack-cinder-scheduler.service
+Source12:         openstack-cinder-volume.service
+
+Source20:         cinder-sudoers
+
+Obsoletes:        openstack-nova-volume
+
+#
+# patches_base=folsom-3
+#
+Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
+
+BuildArch:        noarch
+BuildRequires:    intltool
+BuildRequires:    python-sphinx
+BuildRequires:    python-setuptools
+BuildRequires:    python-netaddr
+
+Requires:         openstack-utils
+Requires:         python-cinder = %{version}-%{release}
+
+Requires(post):   systemd-units
+Requires(preun):  systemd-units
+Requires(postun): systemd-units
+Requires(pre):    shadow-utils
+
+Requires:         lvm2
+Requires:         scsi-target-utils
+
+%description
+OpenStack Volume (codename Cinder) provides services to manage and
+access block storage volumes for use by Virtual Machine instances.
+
+
+%package -n       python-cinder
+Summary:          OpenStack Volume Python libraries
+Group:            Applications/System
+
+Requires:         sudo
+
+Requires:         MySQL-python
+
+Requires:         python-paramiko
+
+Requires:         python-qpid
+Requires:         python-kombu
+Requires:         python-amqplib
+
+Requires:         python-daemon
+Requires:         python-eventlet
+Requires:         python-greenlet
+Requires:         python-iso8601
+Requires:         python-netaddr
+Requires:         python-lxml
+Requires:         python-anyjson
+Requires:         python-cheetah
+
+Requires:         python-sqlalchemy
+Requires:         python-migrate
+
+Requires:         python-paste-deploy
+Requires:         python-routes
+Requires:         python-webob
+
+Requires:         python-glanceclient >= 1:0
+
+%description -n   python-cinder
+OpenStack Volume (codename Cinder) provides services to manage and
+access block storage volumes for use by Virtual Machine instances.
+
+This package contains the cinder Python library.
+
+%if 0%{?with_doc}
+%package doc
+Summary:          Documentation for OpenStack Volume
+Group:            Documentation
+
+Requires:         %{name} = %{version}-%{release}
+
+BuildRequires:    systemd-units
+BuildRequires:    graphviz
+
+# Required to build module documents
+BuildRequires:    python-eventlet
+BuildRequires:    python-routes
+BuildRequires:    python-sqlalchemy
+BuildRequires:    python-webob
+# while not strictly required, quiets the build down when building docs.
+BuildRequires:    python-migrate, python-iso8601
+
+%description      doc
+OpenStack Volume (codename Cinder) provides services to manage and
+access block storage volumes for use by Virtual Machine instances.
+
+This package contains documentation files for cinder.
+%endif
+
+%prep
+%setup -q -n cinder-%{version}
+
+%patch0001 -p1
+
+find . \( -name .gitignore -o -name .placeholder \) -delete
+
+find cinder -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
+
+sed -i '/setuptools_git/d' setup.py
+
+%build
+%{__python} setup.py build
+
+%install
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+
+# docs generation requires everything to be installed first
+export PYTHONPATH="$( pwd ):$PYTHONPATH"
+
+pushd doc
+
+%if 0%{?with_doc}
+SPHINX_DEBUG=1 sphinx-build -b html source build/html
+# Fix hidden-file-or-dir warnings
+rm -fr build/html/.doctrees build/html/.buildinfo
+%endif
+
+# Create dir link to avoid a sphinx-build exception
+mkdir -p build/man/.doctrees/
+ln -s .  build/man/.doctrees/man
+SPHINX_DEBUG=1 sphinx-build -b man -c source source/man build/man
+mkdir -p %{buildroot}%{_mandir}/man1
+install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
+
+popd
+
+# Setup directories
+install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
+install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
+install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
+
+# Install config files
+install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
+install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/cinder/cinder.conf
+install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
+install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
+install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
+
+# Install initscripts for services
+install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/openstack-cinder-api.service
+install -p -D -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/openstack-cinder-scheduler.service
+install -p -D -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/openstack-cinder-volume.service
+
+# Install sudoers
+install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
+
+# Install logrotate
+install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
+
+# Install pid directory
+install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
+
+# Install rootwrap files in /usr/share/cinder/rootwrap
+mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
+install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
+
+# Ensure all binaries have an appropriate prefix
+mv %{buildroot}%{_bindir}/clear_rabbit_queues %{buildroot}%{_bindir}/cinder-clear-rabbit-queues
+mv %{buildroot}%{_bindir}/volume-usage-audit %{buildroot}%{_bindir}/cinder-volume-usage-audit
+
+# Remove unneeded in production stuff
+rm -f %{buildroot}%{_bindir}/cinder-debug
+rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
+rm -fr %{buildroot}%{python_sitelib}/run_tests.*
+rm -f %{buildroot}/usr/share/doc/cinder/README*
+
+%pre
+#TODO:reserve 165 in the setup package
+getent group cinder >/dev/null || groupadd -r cinder --gid 165
+if ! getent passwd cinder >/dev/null; then
+  useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
+fi
+exit 0
+
+%post
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%preun
+if [ $1 -eq 0 ] ; then
+    for svc in volume api scheduler; do
+        /bin/systemctl --no-reload disable openstack-cinder-${svc}.service > /dev/null 2>&1 || :
+        /bin/systemctl stop openstack-cinder-${svc}.service > /dev/null 2>&1 || :
+    done
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    for svc in volume api scheduler; do
+        /bin/systemctl try-restart openstack-cinder-${svc}.service >/dev/null 2>&1 || :
+    done
+fi
+
+%files
+%doc LICENSE
+
+%dir %{_sysconfdir}/cinder
+%config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
+%config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
+%config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
+%config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
+%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
+%config(noreplace) %{_sysconfdir}/sudoers.d/cinder
+
+%dir %attr(0755, cinder, root) %{_localstatedir}/log/cinder
+%dir %attr(0755, cinder, root) %{_localstatedir}/run/cinder
+
+%{_bindir}/cinder-*
+%{_unitdir}/*.service
+%{_datarootdir}/cinder
+%{_mandir}/man1/cinder*.1.gz
+
+%defattr(-, cinder, cinder, -)
+%dir %{_sharedstatedir}/cinder
+%dir %{_sharedstatedir}/cinder/tmp
+
+%files -n python-cinder
+%doc LICENSE
+%{python_sitelib}/cinder
+%{python_sitelib}/cinder-%{version}-*.egg-info
+
+%if 0%{?with_doc}
+%files doc
+%doc doc/build/html
+%endif
+
+%changelog
+* Mon Sep  3 2012 Pádraig Brady <P at draigBrady.com> - 2012.2-0.2.f3
+- Initial release
diff --git a/sources b/sources
index e69de29..f1b7ae0 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ee9f493ba8f59e7919bffd23d7b21247  cinder-2012.2~f3.tar.gz


More information about the scm-commits mailing list