Browse Source

Added horizon bits. (#7)

configure-hook
Pete Vander Giessen 3 years ago
committed by GitHub
parent
commit
8e93bca5ae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 96 additions and 3 deletions
  1. +4
    -0
      snap/etc/horizon/horizon.conf
  2. +19
    -1
      snap/snap-openstack.yaml
  3. +16
    -0
      snap/templates/horizon-api.ini.j2
  4. +13
    -0
      snap/templates/horizon-nginx.conf.j2
  5. +7
    -0
      snap/templates/horizon-snap.conf.j2
  6. +37
    -2
      snapcraft.yaml

+ 4
- 0
snap/etc/horizon/horizon.conf View File

@ -0,0 +1,4 @@
# The horizon snap may need to override default config files.
# For example if the default horizon.conf file located in
# $SNAP/etc/horizon/horizon.conf needs to be overridden,
# it can be done with this file.

+ 19
- 1
snap/snap-openstack.yaml View File

@ -9,7 +9,8 @@ setup:
- "{snap_common}/etc/neutron/rootwrap.d"
- "{snap_common}/etc/nginx/sites-enabled"
- "{snap_common}/etc/nginx/snap/sites-enabled"
- "{snap_common}/etc/glance/glance.conf.d"
- "{snap_common}/etc/glance/glance.conf.d"
- "{snap_common}/etc/horizon/horizon.conf.d"
- "{snap_common}/etc/uwsgi/snap"
- "{snap_common}/fernet-keys"
- "{snap_common}/lib"
@ -27,6 +28,9 @@ setup:
glance-snap.conf.j2: "{snap_common}/etc/glance/glance.conf.d/glance-snap.conf"
cinder-nginx.conf.j2: "{snap_common}/etc/nginx/snap/sites-enabled/cinder.conf"
cinder-snap.conf.j2: "{snap_common}/etc/cinder/cinder.conf.d/cinder-snap.conf"
# TODO add local_settings.py
horizon-snap.conf.j2: "{snap_common}/etc/horizon/horizon.conf.d/horizon-snap.conf"
horizon-nginx.conf.j2: "{snap_common}/etc/nginx/snap/sites-enabled/horizon.conf"
entry_points:
keystone-manage:
binary: "{snap}/bin/keystone-manage"
@ -210,3 +214,17 @@ entry_points:
log-file: "{snap_common}/log/cinder-api.log"
templates:
cinder-api.ini.j2: "{snap_common}/etc/uwsgi/snap/cinder-api.ini"
horizon-uwsgi:
type: uwsgi
uwsgi-dir: "{snap_common}/etc/uwsgi/snap"
uwsgi-dir-override: "{snap_common}/etc/uwsgi"
uwsgi-log: "{snap_common}/log/uwsgi.log"
config-files:
- "{snap}/etc/horizon/horizon.conf"
config-files-override:
- "{snap_common}/etc/horizon/horizon.conf"
config-dirs:
- "{snap_common}/etc/horizon/horizon.conf.d"
log-file: "{snap_common}/log/horizon-api.log"
templates:
horizon-api.ini.j2: "{snap_common}/etc/uwsgi/snap/horizon-api.ini"

+ 16
- 0
snap/templates/horizon-api.ini.j2 View File

@ -0,0 +1,16 @@
# If the OpenStack service has an API that runs behind uwsgi+nginx, you'll need
# to define this template. Be sure to update the path for the wsgi-file and
# "api-name" for the socket. You may also want to rename this file according to
# the service it provides, and you may even need to provide multiple uwsgi files
# if there is more than one wsgi application.
[uwsgi]
wsgi-file = {{ snap }}/bin/horizon-wsgi-file-name
uwsgi-socket = {{ snap_common }}/run/api-name.sock
buffer-size = 65535
master = true
enable-threads = true
processes = 4
thunder-lock = true
lazy-apps = true
home = {{ snap }}/usr
pyargv = {{ pyargv }}

+ 13
- 0
snap/templates/horizon-nginx.conf.j2 View File

@ -0,0 +1,13 @@
# If the OpenStack service has an API that runs behind uwsgi+nginx, you'll need
# to define this template. Be sure to update "listen" with the port number and
# also update "api-name" for the socket.
server {
listen 1234;
access_log {{ snap_common }}/log/nginx-access.log;
error_log {{ snap_common }}/log/nginx-error.log;
location / {
include {{ snap }}/usr/conf/uwsgi_params;
uwsgi_param SCRIPT_NAME '';
uwsgi_pass unix://{{ snap_common }}/run/api-name.sock;
}
}

+ 7
- 0
snap/templates/horizon-snap.conf.j2 View File

@ -0,0 +1,7 @@
[DEFAULT]
# Set state path to writable directory
state_path = {{ snap_common }}/lib
[oslo_concurrency]
# Oslo Concurrency lock path
lock_path = {{ snap_common }}/lock

+ 37
- 2
snapcraft.yaml View File

@ -217,6 +217,13 @@ apps:
plugs:
- network
# Horizon
uwsgi:
command: snap-openstack horizon-uwsgi
daemon: simple
plugs:
- network-bind
parts:
# Keystone
keystone:
@ -406,7 +413,7 @@ parts:
# Openstack Shared Parts
templates:
after: [keystone, nova, neutron, openvswitch, cinder]
after: [keystone, nova, neutron, openvswitch, cinder, horizon]
plugin: dump
source: snap
@ -680,4 +687,32 @@ parts:
stage: [$etc]
prime: [$etc]
# Horizon
horizon:
after: [keystone]
plugin: python
python-version: python2
source: http://tarballs.openstack.org/horizon/horizon-stable-rocky.tar.gz
python-packages:
- uwsgi
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/rocky/upper-constraints.txt
build-packages:
- gcc
- libffi-dev
- libssl-dev
- libxml2-dev
- libxslt1-dev
horizon-config:
after: [horizon]
plugin: dump
source: http://tarballs.openstack.org/horizon/horizon-stable-rocky.tar.gz
organize:
etc/*.conf: etc/horizon/
filesets:
etc:
- etc/horizon/*.conf
stage: [$etc]
prime: [$etc]

Loading…
Cancel
Save