Install Openstack’s Skyline-apiserver

OpenStack Skyline APIServer is the back-end server of Skyline. It provides RESTful APIs to Skyline Console.

Skyline is an OpenStack dashboard optimized by UI and UE. It has a modern technology stack and ecology, is easier for developers to maintain and operate by users, and has higher concurrency performance.

Skyline’s mascot is the nine-color deer. The nine-color deer come from Dunhuang mural “the nine-color king deer”, whose moral is Buddhist cause-effect and gratefulness, which is consistent with 99cloud’s philosophy of embracing and feedback community since its inception. We also hope Skyline can keep light, elegant and powerful as the nine-color deer, to provide a better dashboard for the openstack community and users.

References: https://docs.openstack.org/skyline-apiserver/latest/install/index.html

Note: This guide will use Source install using Ubuntu

1. Create Database

  1. Use the database access client to connect to the database server as the root user:
# mysql -u root

2. Create Skyline database

MariaDB [(none)]> CREATE DATABASE skyline DEFAULT CHARACTER SET \\
  utf8 DEFAULT COLLATE utf8_general_ci;

3. Grant proper access to Skyline database

MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'localhost' \\
	IDENTIFIED BY 'SKYLINE_DBPASS';

MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'%' \\
	IDENTIFIED BY 'SKYLINE_DBPASS';

Replace ‘SKYLINE_DBPASS’ with a suitable password.

4. Exit database client

MariaDB [(none)]> exit;

2. Create user Skyline service credentials

  1. source to admin-openrc to access admin only CLI commands:
$ . admin-openrc

2. Create Skyline user

$ openstack user create --domain default --password-prompt skyline

User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 1qaz2wsx3edc4rfv5tgb6yhn7ujm8ikl |
| name                | skyline                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

3. Add the admin role to the new skyline user

$ openstack role add --project service --user skyline admin

3. Install and Configure Skyline Components

Install Skyline APIServer service from source:

  1. Git clone the repository from OpenDev (GitHub)
$ sudo apt update
$ sudo apt install -y git
$ cd ${HOME}
$ git clone <https://opendev.org/openstack/skyline-apiserver.git>

NOTE: if below error has occurred, run the following command: sudo apt install -y ca-certificates

fatal: unable to access ‘<https://opendev.org/openstack/skyline-apiserver.git/’:> server certificate verification failed. CAfile: none CRLfile: none

2. Install Skyline-apiserver from source

$ sudo apt install -y python3-pip
$ sudo pip3 install skyline-apiserver/

3. Ensure that some folders of skyline-apiserver have been created

$ sudo mkdir -p /etc/skyline /var/log/skyline

4. Copy configuration file into configuration folder /etc/skyline

$ sudo cp ${HOME}/skyline-apiserver/etc/gunicorn.py /etc/skyline/gunicorn.py
$ sudo sed -i "s/^bind = *.*/bind = ['0.0.0.0:28000']/g" /etc/skyline/gunicorn.py
$ sudo cp ${HOME}/skyline-apiserver/etc/skyline.yaml.sample /etc/skyline/skyline.yaml

NOTE: Change the bind value in /etc/skyline/gunicorn.py to 0.0.0.0:28000. Default value is unix:/var/lib/skyline/skyline.sock.

5. Change the configuration on /etc/skyline/skyline.yaml accordingly

Detailed configuration can be found at Skyline Reference

default:
  database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline
  debug: true
  log_dir: /var/log/skyline
openstack:
  keystone_url: http://KEYSTONE_SERVER:5000/v3/
  system_user_password: SKYLINE_SERVICE_PASSWORD

NOTE: Replace SKYLINE_DBPASS, DB_SERVER, KEYSTONE_SERVER, SKYLINE_SERVICE_PASSWORD accordingly.

6. Populate the Skyline APIServer database.

$ cd ${HOME}/skyline-apiserver/
$ make db_sync

4. Finalize Installation

  1. Set start service config for skyline-apiserver on /etc/systemd/system/skyline-apiserver.service
[Unit]
Description=Skyline APIServer

[Service]
Type=simple
ExecStart=/usr/local/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app
LimitNOFILE=32768

[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable skyline-apiserver
$ sudo systemctl start skyline-apiserver

Now you can access your Openstack Skyline API docs on: http://<IPADDRESS>:28000/docs/

Leave a Reply

Your email address will not be published. Required fields are marked *