Adding debian packaging with dh-virtualenv.

* Only installs code+virtualenv, not uwsgi etc
 * Build with: dpkg-buildpackage -us -uc

Change-Id: I18be6107592c065085c6a2cf49cf9bc061a8313f
This commit is contained in:
Dale Smith 2015-12-14 17:15:42 +00:00 committed by Xav Paice
parent f25ceeb5d2
commit 6c8a4da2df
9 changed files with 56 additions and 9 deletions

View File

@ -1,7 +1,7 @@
include requirements.txt
include test-requirements.txt
include README.md
graft stacktask/api/v*/templates
graft stacktask/notifications/templates
graft stacktask/notifications/*/templates

View File

@ -89,7 +89,7 @@ https://docs.djangoproject.com/en/1.8/ref/models/querysets/#id4
#### Default TaskView Endpoints:
Basic default endpoints for the TaskViews.
Basic default endpoints for the TaskViews.
* ../v1/actions/CreateProject - GET
* return a json describing the actions and required fields for the endpoint.
@ -131,7 +131,7 @@ For ease of integration with OpenStack, these endpoints are setup to work and pa
* Returns a list of users on your project, and their roles.
* Also returns a list of pending user invites.
* ../v1/openstack/users - POST
* See above, same as ../v1/actions/InviteUser - POST
* See above, same as ../v1/actions/InviteUser - POST
* ../v1/openstack/users/<user_id> - GET
* Get details on the given user, including their roles on your project.
* ../v1/openstack/users/<user_id> - DELETE
@ -214,6 +214,7 @@ See **api.v1.tasks** and look at the TaskView class to get a better idea.
For a more complex variant, look at **api.v1.openstack** to see some more unique TaskViews specific to certain endpoints we needed to mimic OpenStack functionality.
## Development:
### Packaging and Installing:
@ -264,18 +265,30 @@ Ideally this will be made pluggable in future, but for now requires updating and
For examples see the classes CreateProject, InviteUser, and ResetPassword in the **api.v1.tasks** module, and **api.v1.openstack**.
## Setup/Deployment:
This section is still a work in progress.
### Debian packaging
Debian packaging is done with dh-virtualenv (https://github.com/spotify/dh-virtualenv).
When a package is built, a new virtualenv is created and populated using the contents of requirements.txt.
Work is being done on packaging which will install the service into a virtualenv with all it's requirements coming from pip, then wrap that into a deb.
Package building setup:
apt-get install build-essential devscripts dh-virtualenv
Build the package:
dpkg-buildpackage -us -uc
Now a debian package has been built that will unpack a virtualenv containing stacktask and all dependencies in a self-contained package, so they do not conflict with other python packages on the system.
Upload the package to repo-private: https://wiki.wgtn.cat-it.co.nz/wiki/Repo-private#APT
### Puppet module
Then a puppet module will be able to install the debian package, setup a database, and run the service via nginx and uwsgi in the virtualenv.
## Current Work:
*
* Basic admin panel in horizon, and example public forms for task and token submission.
## Current Work:
* Basic admin panel in horizon to manage user roles and invite new users.
* Horizon forms for token submission and password reset.
## Future Plans:

6
debian/changelog vendored Normal file
View File

@ -0,0 +1,6 @@
python-stacktask (0.1.1a3) unstable; urgency=medium
* Initial release.
-- Dale Smith <dale@catalyst-eu.net> Mon, 14 Dec 2015 15:43:59 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

12
debian/control vendored Normal file
View File

@ -0,0 +1,12 @@
Source: python-stacktask
Section: python
Priority: extra
Maintainer: Adrian Turjak <adriant@catalyst.net.nz>
Build-Depends: debhelper (>=9), python, dh-virtualenv (>= 0.8)
Standards-Version: 3.9.5
Package: python-stacktask
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python2.7 | python2.6, ${misc:Pre-Depends}
Depends: uwsgi, uwsgi-plugin-python, ${python:Depends}, ${misc:Depends}
Description: Openstack task REST API for performing administration tasks securely.

5
debian/rules vendored Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/make -f
%:
dh $@ --with python-virtualenv

8
debian/stacktask.triggers vendored Normal file
View File

@ -0,0 +1,8 @@
# Register interest in Python interpreter changes (Python 2 for now); and
# don't make the Python package dependent on the virtualenv package
# processing (noawait)
interest-noawait /usr/bin/python2.6
interest-noawait /usr/bin/python2.7
# Also provide a symbolic trigger for all dh-virtualenv packages
interest dh-virtualenv-interpreter-update

View File

@ -8,3 +8,5 @@ jsonfield>=1.0.2
django-rest-swagger>=0.3.3
pyyaml>=3.11
python-rtkit>=0.7.0
mysqlclient>=1.3.7

View File

@ -11,7 +11,7 @@ setup(
long_description=(
'A task service to sit alongside keystone and ' +
'add some missing functionality.'),
url='https://github.com/catalyst/stack-task',
url='https://github.com/catalyst/stacktask',
author='Adrian Turjak',
author_email='adriant@catalyst.net.nz',
license='Apache 2.0',