snap-gnocchi/snapcraft.yaml
Pete Vander Giessen 78d9683011 Snap is installable.
This commit takes the cookie cutter output and fixes it up into a snap
that builds and installs.

- Added required names and such in openstack-snap.yaml and nginx and
  wsgi config templates.

- Python packages that are declared in setup.cfg and not in
  requirements.txt are now called out explicitly in the
  snapcraft.yaml. (Note: a better fix might be to update snapcraft to
  be able to parse dependencies from setup.cfg.)

- Removed upper constraints files on Python packages (and removed oslo
  patch). Gnocchi does not appear to respect the upper constraints.

- Added gnocchi-config-generator command to apps.

- Used the above to generate a default config.

- Added snapstack tests (though they don't work yet).

There's still plenty to do: snapstack tests need to be fixed up (see
the TODO in tests/gnocchi.sh), and the snap as a whole needs to be
thoroughly tested.
2017-08-17 21:31:53 +00:00

112 lines
3.5 KiB
YAML

name: gnocchi
version: ocata
summary: Time Series Database as a Service
description: |
Gnocchi is an open-source, multi-tenant timeseries, metrics and
resources database. It provides an HTTP REST interface to create and
manipulate the data. It is designed to store metrics at a very large
scale while providing access to metrics and resources information
and history.
confinement: strict
grade: devel
apps:
api:
command: snap-openstack gnocchi-api
daemon: simple
plugs:
- network-bind
metricd:
command: snap-openstack gnocchi-metricd
daemon: simple
plugs:
- network
uwsgi:
command: snap-openstack gnocchi-uwsgi
daemon: simple
plugs:
- network-bind
nginx:
command: snap-openstack gnocchi-nginx
daemon: forking
plugs:
- network-bind
gnocchi-config-generator:
command: bin/gnocchi-config-generator
gnocchi-upgrade:
command: bin/gnocchi-upgrade
parts:
gnocchi:
plugin: python
python-version: python2
source: http://tarballs.openstack.org/gnocchi/gnocchi-stable-3.1.tar.gz
python-packages:
- tooz
- oslo.db
- lz4
- python-memcached
- pymysql
- uwsgi
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
# constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
build-packages:
- gcc
- libffi-dev
- libssl-dev
- libxml2-dev
- libxslt1-dev
install: |
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/paste/__init__.py
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/repoze/__init__.py
export SNAP_ROOT="../../.."
export SNAP_SITE_PACKAGES="$SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages"
# patch -d $SNAP_SITE_PACKAGES -p1 < $SNAP_ROOT/patches/oslo-config-dirs.patch
templates:
after: [gnocchi]
plugin: dump
source: snap
# Following is an example of including the OpenStack project's config
config:
after: [gnocchi]
plugin: dump
source: http://tarballs.openstack.org/gnocchi/gnocchi-stable-3.1.tar.gz
organize:
etc/*.conf: etc/gnocchi/
etc/*.ini: etc/gnocchi/
etc/*.json: etc/gnocchi/
etc/*.templates: etc/gnocchi/
filesets:
etc:
- etc/gnocchi/*.conf
- etc/gnocchi/*.ini
- etc/gnocchi/*.json
- etc/gnocchi/*.templates
stage: [$etc]
prime: [$etc]
nginx:
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
plugin: autotools
configflags:
- --prefix=/usr
- --http-log-path=/var/snap/gnocchi/common/log/nginx-access.log
- --error-log-path=/var/snap/gnocchi/common/log/nginx-error.log
- --lock-path=/var/snap/gnocchi/common/lock/nginx.lock
- --pid-path=/var/snap/gnocchi/common/run/nginx.pid
- --http-client-body-temp-path=/var/snap/gnocchi/common/lib/nginx_client_body
- --http-proxy-temp-path=/var/snap/gnocchi/common/lib/nginx_proxy
- --http-fastcgi-temp-path=/var/snap/gnocchi/common/lib/nginx_fastcgi
- --http-uwsgi-temp-path=/var/snap/gnocchi/common/lib/nginx_uwsgi
- --http-scgi-temp-path=/var/snap/gnocchi/common/lib/nginx_scgi
- --with-http_ssl_module
build-packages:
- libpcre3-dev
- libssl-dev
prepare: |
export SNAP_ROOT="../../.."
export SNAP_SOURCE="$SNAP_ROOT/parts/nginx/build"
patch -d $SNAP_SOURCE -p1 < $SNAP_ROOT/patches/drop-nginx-setgroups.patch
libxml2:
source: http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
plugin: autotools