### Installing prerequisite packages on Ubuntu Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Installs necessary packages for skyline-apiserver development on Ubuntu 20.04, including SSL development libraries, Python package installer, MySQL client libraries, PostgreSQL client libraries, and foreign function interface libraries. ```bash sudo apt-get install libssl-dev python3-pip libmysqlclient-dev libpq-dev libffi-dev ``` -------------------------------- ### Enabling and Starting Skyline API Server via systemctl Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst These commands reload the systemd daemon, enable the Skyline API server service to start on boot, and then start the service immediately. ```console $ sudo systemctl daemon-reload $ sudo systemctl enable skyline-apiserver $ sudo systemctl start skyline-apiserver ``` -------------------------------- ### Enabling and Starting Skyline APIServer Service Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst These commands reload the systemd daemon, enable the Skyline APIServer service to start on boot, and start the service immediately. ```console $ sudo systemctl daemon-reload $ sudo systemctl enable skyline-apiserver $ sudo systemctl start skyline-apiserver ``` -------------------------------- ### Installing tox for unit testing Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Installs the tox package using pip, which is used for running unit tests in isolated environments. ```bash sudo pip install tox ``` -------------------------------- ### Skyline APIServer configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Example YAML configuration for Skyline APIServer, including database URL, debug settings, log directory, Keystone URL, and system user password. ```yaml 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 ``` -------------------------------- ### Installing full Python3 development environment Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Adds python3-dev and python3-pip to the list of packages to install, providing a complete Python 3 development environment. ```bash python3-dev python3-pip ``` -------------------------------- ### Install Skyline APIServer from source Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Installs python3-pip and then installs the skyline-apiserver package from the source directory. ```console $ sudo apt install -y python3-pip $ sudo pip3 install skyline-apiserver/ ``` -------------------------------- ### Creating a virtual environment with tox Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Creates a virtual environment using tox, installing dependencies specified in requirements.txt and test-requirements.txt. ```bash tox -e venv ``` -------------------------------- ### Install Python Dependencies with Tox Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This command uses Tox to create a virtual environment and install the necessary Python dependencies for developing the Skyline API server. ```bash tox -e venv ``` -------------------------------- ### Skyline APIServer configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Example configuration settings for Skyline APIServer, including database URL, debug mode, log directory, Keystone URL, and system user password. ```yaml 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 ``` -------------------------------- ### Skyline configuration settings Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Example YAML configuration for Skyline APIServer, including database URL, debug mode, log directory, Keystone URL, and system user password. Replace the placeholder values with the correct credentials. ```yaml 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 ``` -------------------------------- ### Systemd Service Configuration for Skyline API Server Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst This systemd service configuration defines how the Skyline API server is managed. It specifies the execution command using gunicorn, sets file limits, and configures the service to start on boot. ```systemd ExecStart=/usr/local/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app LimitNOFILE=32768 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Install Skyline APIServer from source Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Installs the Skyline APIServer from the cloned source code using pip. This installs the necessary Python packages and dependencies. ```console $ sudo dnf install python3-pip $ sudo python3 -m pip install skyline-apiserver/ ``` -------------------------------- ### Running skyline-apiserver with Uvicorn Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Activates the virtual environment and starts the skyline-apiserver using Uvicorn with hot reloading and debug logging. ```console $ source .tox/venv/bin/activate $ uvicorn --reload --reload-dir skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app ``` -------------------------------- ### Create Skyline APIServer directories Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Creates the necessary directories for Skyline APIServer configuration and logs. ```console $ sudo mkdir -p /etc/skyline /var/log/skyline ``` -------------------------------- ### Create Skyline APIServer directories Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Creates necessary directories for Skyline APIServer configuration and logs. ```console $ sudo mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline /var/log/nginx ``` -------------------------------- ### Installing Python Dependencies with Tox Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This command uses Tox to create a virtual environment and install the necessary Python dependencies for the Skyline API server. It ensures that all required packages are available for development and testing. ```bash tox -e venv ``` -------------------------------- ### Clone Skyline APIServer repository Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Updates the package list, installs git, changes to the home directory, and clones the Skyline APIServer repository from OpenDev. ```console $ sudo apt update $ sudo apt install -y git $ cd ${HOME} $ git clone https://opendev.org/openstack/skyline-apiserver.git ``` -------------------------------- ### Clone Skyline APIServer repository Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Clones the Skyline APIServer repository from OpenDev (GitHub) to the /root directory. This downloads the source code required for installation. ```console $ sudo dnf update $ sudo dnf install git $ cd /root $ git clone https://opendev.org/openstack/skyline-apiserver.git ``` -------------------------------- ### Install Kolla Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Clones the Kolla repository, navigates to the directory, and installs Kolla using pip3. This is necessary for building Docker images. ```shell cd /opt git clone https://github.com/openstack/kolla cd /opt/kolla sudo pip3 install /opt/kolla ``` -------------------------------- ### Skyline YAML Configuration Parameters Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Example YAML configuration parameters for Skyline, including database URL, Keystone URL, default region, interface type, system project domain, system project, system user domain, system user name, and system user password. ```yaml - database_url - keystone_url - default_region - interface_type - system_project_domain - system_project - system_user_domain - system_user_name - system_user_password ``` -------------------------------- ### Installing Kolla-Ansible Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Installs Kolla-Ansible using pip. This is necessary if Kolla-Ansible is not already installed in the deployment environment. It clones the Kolla-Ansible repository and installs it using pip3. ```shell cd /opt git clone https://github.com/openstack/kolla-ansible cd /opt/kolla-ansible sudo pip3 install /opt/kolla-ansible ``` -------------------------------- ### Create Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Creates a 'skyline' user in the default domain with a password prompt. ```console $ openstack user create --domain default --password-prompt skyline ``` -------------------------------- ### Create Skyline database Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Creates a database named 'skyline' with UTF-8 character set and collation. ```console MariaDB [(none)]> CREATE DATABASE skyline DEFAULT CHARACTER SET \ utf8 DEFAULT COLLATE utf8_general_ci; ``` -------------------------------- ### Create Skyline policy directory Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Creates the policy directory for Skyline APIServer. ```console $ sudo mkdir -p /etc/skyline/policy ``` -------------------------------- ### Copy Skyline configuration file Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Copies the sample Skyline configuration file to /etc/skyline. This provides a base configuration for the Skyline APIServer. ```console $ sudo cp /root/skyline-apiserver/etc/skyline.yaml.sample /etc/skyline/skyline.yaml ``` -------------------------------- ### Systemd Service Configuration for Skyline APIServer Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst This code block defines the systemd service configuration for Skyline APIServer. It specifies the service description, execution command using gunicorn, file limits, and installation target. ```text [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 ``` -------------------------------- ### Create Skyline policy directory Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Creates the policy directory for Skyline APIServer. ```console $ sudo mkdir -p /etc/skyline/policy ``` -------------------------------- ### Building Documentation with Tox Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/documentation.rst This command is used to build the Skyline APIServer documentation using Tox. It executes the 'docs' environment defined in the Tox configuration, which processes RST files and generates HTML output. ```console tox -e docs ``` -------------------------------- ### Start Local Docker Registry Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Starts a local Docker registry in a container. This allows pushing and pulling Docker images to and from the local registry. ```shell docker run -d --name registry --restart=always -p 4000:5000 -v registry:/var/lib/registry registry:2 ``` -------------------------------- ### Install Kolla Ansible Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Clones the kolla-ansible repository, navigates to the directory, and installs kolla-ansible using pip3. This is a prerequisite for deploying OpenStack services. ```shell cd /opt git clone https://github.com/openstack/kolla-ansible cd /opt/kolla-ansible sudo pip3 install /opt/kolla-ansible ``` -------------------------------- ### Copy and configure Skyline APIServer files Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Copies the gunicorn configuration file and skyline configuration sample file to the /etc/skyline directory, and modifies the gunicorn bind address. ```console $ 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 ``` -------------------------------- ### Skyline YAML Configuration Example Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This YAML snippet shows the configuration parameters that need to be set in the skyline.yaml file. These parameters include database connection details, Keystone endpoint, default region, and system user credentials. ```yaml - database_url - keystone_url - default_region ``` -------------------------------- ### Source admin credentials Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Sources the admin-openrc file to gain access to admin-only CLI commands. ```console $ . admin-openrc ``` -------------------------------- ### Connect to MySQL as root Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Connects to the MySQL database server as the root user using the mysql client. ```console # mysql ``` -------------------------------- ### Create Skyline database in MySQL Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Creates a new database named 'skyline' in MySQL with UTF-8 character set and collation. ```console MariaDB [(none)]> CREATE DATABASE skyline DEFAULT CHARACTER SET \ utf8 DEFAULT COLLATE utf8_general_ci; ``` -------------------------------- ### Run Skyline APIServer bootstrap server Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Runs the Skyline APIServer bootstrap server using Docker, mounting the configuration file and log directory. ```console $ sudo docker run -d --name skyline_bootstrap \ -e KOLLA_BOOTSTRAP="" \ -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml \ -v /var/log:/var/log \ --net=host 99cloud/skyline:latest ``` -------------------------------- ### Sync Skyline database Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Navigates to the Skyline APIServer directory and synchronizes the database schema. This creates the necessary tables in the Skyline database. ```console $ cd /root/skyline-apiserver/ $ make db_sync ``` -------------------------------- ### Connect to MySQL as root user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Connects to the MySQL database server as the root user using the mysql client. ```console # mysql ``` -------------------------------- ### Source admin credentials Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Sources the admin credentials file to gain access to admin-only OpenStack CLI commands. ```console $ . admin-openrc ``` -------------------------------- ### Pull Skyline APIServer Docker image Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Pulls the latest Skyline APIServer Docker image from Docker Hub. ```console $ sudo docker pull 99cloud/skyline:latest ``` -------------------------------- ### Create Skyline database in MySQL Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Creates the 'skyline' database in MySQL with UTF-8 character set and collation. This database will be used by the Skyline APIServer. ```console MariaDB [(none)]> CREATE DATABASE skyline DEFAULT CHARACTER SET \ utf8 DEFAULT COLLATE utf8_general_ci; ``` -------------------------------- ### Create Skyline APIServer directories Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Creates the necessary directories for Skyline APIServer configuration and logs. These directories are used to store configuration files and log data. ```console $ sudo mkdir -p /etc/skyline /var/log/skyline ``` -------------------------------- ### Create Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Creates a new OpenStack user named 'skyline' within the 'default' domain, prompting for a password. ```console $ openstack user create --domain default --password-prompt skyline ``` -------------------------------- ### Create Skyline user in OpenStack Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Creates a 'skyline' user in the 'default' domain with a password prompt. This user will be used by the Skyline APIServer service. ```console $ openstack user create --domain default --password-prompt skyline ``` -------------------------------- ### Add admin role to Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Adds the 'admin' role to the 'skyline' user on the 'service' project. ```console $ openstack role add --project service --user skyline admin ``` -------------------------------- ### Add admin role to Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Adds the 'admin' role to the 'skyline' user on the 'service' project. ```console $ openstack role add --project service --user skyline admin ``` -------------------------------- ### Connect to MySQL as root user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Connects to the MySQL database server as the root user using the mysql client. This is a prerequisite step for creating the Skyline database. ```console # mysql ``` -------------------------------- ### Copy and configure Gunicorn settings Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Copies the Gunicorn configuration file to /etc/skyline and modifies the bind address to listen on all interfaces (0.0.0.0) on port 28000. This configures Gunicorn to serve the Skyline APIServer. ```console $ sudo cp /root/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 ``` -------------------------------- ### Create Skyline policy directory Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Creates the policy directory for Skyline APIServer. This directory is used to store policy files. ```console $ sudo mkdir -p /etc/skyline/policy ``` -------------------------------- ### Skyline APIServer systemd service configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Defines the systemd service configuration for Skyline APIServer. This allows the service to be managed by systemd. ```text [Unit] Description=Skyline APIServer [Service] Type=simple ``` -------------------------------- ### Grant privileges to Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-ubuntu.rst Grants all privileges on the 'skyline' database to the 'skyline' user from localhost and any host, identified by a password. ```console 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'; ``` -------------------------------- ### Cleanup Bootstrap Server - Docker Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst This command removes the skyline_bootstrap Docker container. It ensures a clean environment before running the Skyline API server. ```console $ sudo docker rm -f skyline_bootstrap ``` -------------------------------- ### Run Skyline API Server - Docker Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst This command runs the Skyline API server using Docker. It mounts the skyline.yaml configuration file and the /var/log directory, sets the restart policy to always, and uses the host network. It is important to note that the skyline image includes both the skyline-apiserver and skyline-console. ```console $ sudo docker run -d --name skyline --restart=always \ -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml \ -v /var/log:/var/log \ --net=host 99cloud/skyline:latest ``` -------------------------------- ### Grant privileges to Skyline user on Skyline database Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/docker-install-ubuntu.rst Grants all privileges on the 'skyline' database to the 'skyline' user from both localhost and any host, identified by the specified password. ```console 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'; ``` -------------------------------- ### Source admin credentials Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Sources the admin credentials file to gain access to admin-only OpenStack CLI commands. This is necessary for creating the Skyline user and assigning roles. ```console $ . admin-openrc ``` -------------------------------- ### Building Skyline Docker Image Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Builds the Skyline Docker image using kolla-build. This command specifies the base distro, install type, Docker namespace, tag, registry, and push options. It builds the ubuntu-source-skyline image. ```shell kolla-build -b ubuntu -t source -n kolla --tag master --registry 127.0.0.1:4000 --push skyline ``` -------------------------------- ### Running Skyline API Server with Uvicorn Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This command starts the Skyline API server using Uvicorn, enabling automatic reloading on code changes and setting the log level to debug. It also specifies the port on which the server will listen. ```console $ source .tox/venv/bin/activate $ uvicorn --reload --reload-dir skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app ``` -------------------------------- ### Run Skyline Service with Docker (Sqlite) Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This script removes the bootstrap container and starts the main Skyline service container with persistent restart policy. It mounts volumes for logs, configuration, and temporary files, and exposes the service on the host network. ```bash docker rm -f skyline_bootstrap docker run -d --name skyline --restart=always -v /var/log/skyline:/var/log/skyline -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest ``` -------------------------------- ### Initializing the skyline database Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Activates the virtual environment, synchronizes the database, and then deactivates the virtual environment. ```bash source .tox/venv/bin/activate make db_sync deactivate ``` -------------------------------- ### Cloning the skyline-apiserver repository Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Clones the skyline-apiserver repository from OpenDev using git and navigates into the cloned directory. ```bash git clone https://opendev.org/openstack/skyline-apiserver.git cd skyline-apiserver ``` -------------------------------- ### Configure Kolla Globals Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Configures global settings for Kolla, including network interfaces, VIP address, enabling Skyline, Docker registry, namespace, base distro, and install type. These settings define the environment in which OpenStack and Skyline are deployed. ```bash network_interface: "eth0" neutron_external_interface: "eth1" kolla_internal_vip_address: "192.168.10.250" enable_skyline: "yes" docker_registry: "127.0.0.1:4000" docker_namespace: "kolla" kolla_base_distro: "ubuntu" kolla_install_type: "source" ``` -------------------------------- ### Build Skyline Docker Image Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Builds a Skyline Docker image using kolla-build with specified options for base image type, installation type, namespace, tag, registry, and push. The image is built using the ubuntu-source-skyline version. ```shell kolla-build -b ubuntu -t source -n kolla --tag master --registry 127.0.0.1:4000 --push skyline ``` -------------------------------- ### Grant privileges to Skyline user in MySQL Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Grants all privileges on the 'skyline' database to the 'skyline' user from both localhost and any host, identified by a password. Replace 'SKYLINE_DBPASS' with a strong password. ```console 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'; ``` -------------------------------- ### Add admin role to Skyline user Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/install/source-install-rhel.rst Adds the 'admin' role to the 'skyline' user on the 'service' project. This grants the Skyline user administrative privileges within the service project. ```console $ openstack role add --project service --user skyline admin ``` -------------------------------- ### Setting up skyline.yaml configuration file Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Copies the sample skyline.yaml configuration file and sets the OS_CONFIG_DIR environment variable. ```bash cp etc/skyline.yaml.sample etc/skyline.yaml export OS_CONFIG_DIR=$(pwd)/etc ``` -------------------------------- ### Configuring Kolla Globals Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Configures global settings in the globals.yml file. These settings define the network interface, external interface, internal VIP address, enable Skyline, Docker registry, Docker namespace, base distro, and install type. These settings are required for Kolla Ansible to deploy Skyline correctly. ```bash network_interface: "eth0" neutron_external_interface: "eth1" kolla_internal_vip_address: "192.168.10.250" enable_skyline: "yes" docker_registry: "127.0.0.1:4000" docker_namespace: "kolla" kolla_base_distro: "ubuntu" kolla_install_type: "source" ``` -------------------------------- ### Building Documentation with Tox Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/README.rst This snippet shows how to build the documentation using tox. It involves changing the directory to the parent directory and then running the tox command with the 'docs' environment specified. ```shell % cd .. % tox -e docs ``` -------------------------------- ### Initialize Skyline Database using make command Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This snippet initializes the Skyline database. It activates the virtual environment, runs the `make db_sync` command, and then deactivates the virtual environment. ```bash source .tox/venv/bin/activate make db_sync deactivate ``` -------------------------------- ### Running unit tests with tox Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/development.environment.rst Executes the unit tests using tox in a Python 3.8 environment. ```bash tox -e py38 ``` -------------------------------- ### Generating Release Notes with Reno (Bash) Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/releasenotes.rst These commands first commit the changes to the git repository, then use the `reno` tool to generate the release notes. The generated files can be found in the `releasenotes/build/html` directory. ```bash $ git commit # Commit the change because reno scans git log. $ tox -e releasenotes ``` -------------------------------- ### Bootstrap Skyline with Docker (Sqlite) Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This script prepares the environment and runs the skyline_bootstrap container to initialize the Skyline API server with a Sqlite database. It creates necessary directories, sets environment variables, and mounts volumes for configuration and logs. ```bash rm -rf /tmp/skyline && mkdir /tmp/skyline && mkdir /var/log/skyline docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /var/log/skyline:/var/log/skyline -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest # Check bootstrap is normal `exit 0` docker logs skyline_bootstrap ``` -------------------------------- ### Creating a New Release Note with Reno (Bash) Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/contributor/releasenotes.rst This command uses the `reno` tool to create a new release note file. The type of release note (bug, blueprint, etc.) should be specified in the command. ```bash $ tox -e venv -- reno new ``` -------------------------------- ### Initializing Skyline Database Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst These commands activate the virtual environment, synchronize the database schema, and then deactivate the virtual environment. This ensures that the database is properly set up before running the Skyline API server. ```bash source .tox/venv/bin/activate make db_sync deactivate ``` -------------------------------- ### Configure Skyline API Server Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst These commands copy the sample configuration file and set the OS_CONFIG_DIR environment variable, pointing to the directory containing the Skyline configuration file. This allows the application to locate and load its configuration. ```bash cp etc/skyline.yaml.sample etc/skyline.yaml export OS_CONFIG_DIR=$(pwd)/etc ``` -------------------------------- ### Build Image using make command Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This snippet builds the image using the `make build` command. ```bash make build ``` -------------------------------- ### Configuring Skyline YAML File Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst These commands copy the sample configuration file and set the OS_CONFIG_DIR environment variable. This prepares the environment for configuring the Skyline API server with the necessary settings. ```bash cp etc/skyline.yaml.sample etc/skyline.yaml export OS_CONFIG_DIR=$(pwd)/etc ``` -------------------------------- ### Initialize Skyline with MariaDB - Run Bootstrap Container Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script runs the skyline_bootstrap container to initialize the Skyline service. It mounts the skyline.yaml configuration file and uses the 99cloud/skyline:latest image. ```bash docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest ``` -------------------------------- ### Initialize Skyline with Sqlite - Run Bootstrap Container Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script runs the skyline_bootstrap container to initialize the Skyline service. It mounts the skyline.yaml configuration file and a temporary directory, and uses the 99cloud/skyline:latest image. ```bash docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest ``` -------------------------------- ### Building Skyline Docker Image Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This command builds a Docker image for the Skyline API server. This image can then be used to deploy the server in a containerized environment. ```bash make build ``` -------------------------------- ### Run Skyline API Server with Uvicorn Source: https://github.com/openstack/skyline-apiserver/blob/master/README.rst This snippet runs the Skyline API server using Uvicorn. It activates the virtual environment, then executes the Uvicorn command with reload, directory, port, and log level configurations. ```console $ source .tox/venv/bin/activate $ uvicorn --reload --reload-dir skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app ``` -------------------------------- ### Running Skyline with Docker Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This command runs the Skyline API server using Docker, mounting the skyline.yaml configuration file and exposing the necessary ports. It assumes that the skyline.yaml file is located in /etc/skyline/skyline.yaml. ```bash docker run -d --name skyline --restart=always -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest ``` -------------------------------- ### Create Skyline User - OpenStack CLI Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script uses the OpenStack CLI to create a 'skyline' user in the 'default' domain. It prompts for a password and displays the user details. ```bash # Source the admin credentials $ source admin-openrc # Create the skyline user $ openstack user create --domain default --password-prompt skyline ``` -------------------------------- ### Copy Kolla Configuration Files Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Creates the /etc/kolla directory, sets ownership, copies configuration files, copies inventory files, and generates passwords. This sets up the basic configuration for Kolla Ansible. ```shell sudo mkdir -p /etc/kolla sudo chown $USER:$USER /etc/kolla cp -r kolla-ansible/etc/kolla/* /etc/kolla cp kolla-ansible/ansible/inventory/* . kolla-genpwd ``` -------------------------------- ### Initialize Skyline with MariaDB - Check Bootstrap Logs Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script checks the logs of the skyline_bootstrap container to ensure that the bootstrap process completed successfully (exit code 0). ```bash # Check bootstrap is normal `exit 0` docker logs skyline_bootstrap ``` -------------------------------- ### Deploy Skyline with Kolla Ansible Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Deploys Skyline using Kolla Ansible with the specified inventory file and target. This command bootstraps the servers, performs prechecks, and deploys the Skyline service. ```shell kolla-ansible -i ./all-in-one bootstrap-servers -t skyline kolla-ansible -i ./all-in-one prechecks -t skyline kolla-ansible -i ./all-in-one deploy -t skyline ``` -------------------------------- ### Configuring Ansible Settings Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Configures Ansible settings in the ansible.cfg file. These settings disable host key checking, enable pipelining, and set the number of forks. These settings improve the performance and reliability of Ansible. ```bash [defaults] host_key_checking=False pipelining=True forks=100 ``` -------------------------------- ### Initialize Skyline with Sqlite - Check Bootstrap Logs Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script checks the logs of the skyline_bootstrap container to ensure that the bootstrap process completed successfully (exit code 0). ```bash # Check bootstrap is normal `exit 0` docker logs skyline_bootstrap ``` -------------------------------- ### Run Skyline Service with Sqlite - Run Skyline Container Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script runs the main Skyline service container. It mounts the skyline.yaml configuration file and a temporary directory, sets the restart policy to always, and uses the 99cloud/skyline:latest image. It also shows how to modify the listen address and policy rules. ```bash docker run -d --name skyline --restart=always -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest ``` -------------------------------- ### Initialize Skyline with Sqlite - Remove and Create Directory Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script removes the /tmp/skyline directory and recreates it. This is part of the initialization process when using Sqlite as the database for Skyline. ```bash rm -rf /tmp/skyline && mkdir /tmp/skyline ``` -------------------------------- ### Skyline APIServer Customizable Settings Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/configuration/settings.rst This YAML snippet defines customizable settings for the Skyline APIServer, including base settings, flavor families, GPU models, and USB models. It allows for defining different architectures and categories for flavor families, as well as specifying available GPU and USB models. ```yaml setting: base_settings: - flavor_families - gpu_models - usb_models flavor_families: - architecture: x86_architecture categories: - name: general_purpose properties: [] - name: compute_optimized properties: [] - name: memory_optimized properties: [] - name: high_clock_speed properties: [] - architecture: heterogeneous_computing categories: - name: compute_optimized_type_with_gpu properties: [] - name: visualization_compute_optimized_type_with_gpu properties: [] gpu_models: - nvidia_t4 usb_models: - usb_c ``` -------------------------------- ### Copying Kolla Configuration Files Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Copies the Kolla configuration files to the /etc/kolla directory and generates passwords. This is done if the configuration files do not already exist. It copies globals.yml, passwords.yml, all-in-one, and multinode configurations. ```shell cp -r kolla-ansible/etc/kolla/* /etc/kolla cp kolla-ansible/ansible/inventory/* /etc/kolla kolla-genpwd ``` -------------------------------- ### Cloning DevStack Repository Source: https://github.com/openstack/skyline-apiserver/blob/master/devstack/README.rst This command clones the DevStack repository from GitHub, providing the necessary files to set up an OpenStack development environment. It uses git to download the repository and then changes the current directory to the newly created devstack directory. ```shell git clone https://github.com/openstack-dev/devstack.git cd devstack ``` -------------------------------- ### Deploying Skyline with Kolla Ansible Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Deploys Skyline using Kolla Ansible. This involves bootstrapping the servers, running prechecks, and deploying the service. The `-t skyline` option specifies that only the Skyline service should be deployed. ```shell kolla-ansible -i ./all-in-one bootstrap-servers -t skyline kolla-ansible -i ./all-in-one prechecks -t skyline kolla-ansible -i ./all-in-one deploy -t skyline ``` -------------------------------- ### Skyline YAML Configuration Parameters Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst These parameters are essential for configuring the Skyline API server to connect to the database, Keystone, and other OpenStack services. They must be adjusted to match the specific environment in which Skyline is deployed. ```yaml - database_url - keystone_url - default_region - interface_type - system_project_domain - system_project - system_user_domain - system_user_name - system_user_password ``` -------------------------------- ### Running Local Registry Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Runs a local Docker registry. This is required for building and pushing the Skyline Docker image. It runs the registry on port 4000 and persists the registry data in the /var/lib/registry volume. ```shell docker run -d --name registry --restart=always -p 4000:5000 -v registry:/var/lib/registry registry:2 ``` -------------------------------- ### Configure Ansible Settings Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Configures Ansible settings such as disabling host key checking, enabling pipelining, and setting the number of forks. These settings optimize Ansible's performance and prevent SSH key verification issues. ```bash [defaults] host_key_checking=False pipelining=True forks=100 ``` -------------------------------- ### Skyline APIServer OpenStack Configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/configuration/settings.rst This YAML snippet configures the OpenStack integration for the Skyline APIServer. It defines base domains, default region, extension mappings, interface type, Keystone URL, nginx prefix, reclaim instance interval, service mappings, SSO settings, system admin roles, system project, and system user credentials. ```yaml openstack: base_domains: - heat_user_domain default_region: RegionOne enforce_new_defaults: true extension_mapping: floating-ip-port-forwarding: neutron_port_forwarding fwaas_v2: neutron_firewall qos: neutron_qos vpnaas: neutron_vpn interface_type: public keystone_url: http://127.0.0.1:5000/v3/ nginx_prefix: /api/openstack reclaim_instance_interval: 604800 service_mapping: baremetal: ironic block-storage: cinder compute: nova container: zun container-infra: magnum database: trove dns: designate identity: keystone image: glance instance-ha: masakari key-manager: barbican load-balancer: octavia network: neutron object-store: swift orchestration: heat placement: placement sharev2: manilav2 sso_enabled: false sso_protocols: - openid sso_region: RegionOne system_admin_roles: - admin - system_admin system_project: service system_project_domain: Default system_reader_roles: - system_reader system_user_domain: Default system_user_name: skyline system_user_password: '' ``` -------------------------------- ### Adding Skyline as DevStack Plugin Source: https://github.com/openstack/skyline-apiserver/blob/master/devstack/README.rst This configuration snippet adds the skyline-apiserver repository as an external plugin to DevStack. It modifies the local.conf file to include the necessary settings for enabling the plugin, specifying the repository URL. ```shell cat local.conf ``` ```shell [[local|localrc]] enable_plugin skyline-apiserver https://opendev.org/openstack/skyline-apiserver ``` -------------------------------- ### Create Skyline Database - MariaDB Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This SQL script creates the 'skyline' database in MariaDB if it does not already exist. It sets the default character set to utf8 and the collation to utf8_general_ci. ```SQL CREATE DATABASE IF NOT EXISTS skyline DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; ``` -------------------------------- ### Skyline APIServer Default Configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/doc/source/configuration/settings.rst This YAML snippet defines the default configuration settings for the Skyline APIServer. It includes settings for access token expiration, database URL, logging, policy file paths, Prometheus integration, secret key, session name, and SSL enablement. ```yaml default: access_token_expire: 3600 access_token_renew: 1800 cafile: '' cors_allow_origins: [] database_url: sqlite:////tmp/skyline.db debug: false log_dir: ./log log_file: skyline.log policy_file_path: /etc/skyline/policy policy_file_suffix: policy.yaml prometheus_basic_auth_password: '' prometheus_basic_auth_user: '' prometheus_enable_basic_auth: false prometheus_endpoint: http://localhost:9091 secret_key: aCtmgbcUqYUy_HNVg5BDXCaeJgJQzHJXwqbXr0Nmb2o session_name: session ssl_enabled: true ``` -------------------------------- ### Run Skyline Service with Sqlite - Remove Bootstrap Container Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script removes the skyline_bootstrap container after the initialization is complete. This is a cleanup step before running the main Skyline service. ```bash docker rm -f skyline_bootstrap ``` -------------------------------- ### Configure Skyline Passwords Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Defines the passwords for the Skyline database and Keystone user in the passwords.yml file. These passwords are required for Skyline to authenticate with the database and Keystone. ```shell skyline_database_password: skyline_keystone_password: ``` -------------------------------- ### Adding Skyline Passwords Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Adds the Skyline database and Keystone passwords to the passwords.yml file. These passwords are required for Skyline to authenticate with the database and Keystone. They can be generated manually or by running `kolla-genpwd`. ```shell skyline_database_password: skyline_keystone_password: ``` -------------------------------- ### Restarting Docker Service Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Restarts the Docker service after modifying the /etc/docker/daemon.json file. This ensures that the changes are applied. This is part of fixing the local repository error. ```shell sudo service docker restart ``` -------------------------------- ### Adding Skyline Stable Branch as DevStack Plugin Source: https://github.com/openstack/skyline-apiserver/blob/master/devstack/README.rst This configuration snippet adds a specific branch of the skyline-apiserver repository as an external plugin to DevStack. It modifies the local.conf file to include the necessary settings for enabling the plugin, specifying the repository URL and the branch name. ```shell enable_plugin skyline-apiserver https://opendev.org/openstack/skyline-apiserver master ``` -------------------------------- ### Add Admin Role to Skyline User - OpenStack CLI Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This bash script uses the OpenStack CLI to add the 'admin' role to the 'skyline' user on the 'service' project. ```bash $ openstack role add --project service --user skyline admin ``` -------------------------------- ### Restart Docker Service Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Restarts the Docker service after modifying the daemon configuration. This applies the changes made to the Docker daemon. ```shell sudo service docker restart ``` -------------------------------- ### Add Skyline to Ansible Inventory Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Adds the skyline group as a child of the control group in the Ansible inventory. This ensures that Skyline is deployed on the control nodes. ```bash [skyline:children] control ``` -------------------------------- ### Grant Privileges to Skyline User - MariaDB Source: https://github.com/openstack/skyline-apiserver/blob/master/README-zh_CN.rst This SQL script grants all privileges on the 'skyline' database to the 'skyline' user for both localhost and any host ('%'). Replace 'SKYLINE_DBPASS' with the actual password. ```SQL GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'localhost' IDENTIFIED BY 'SKYLINE_DBPASS'; ``` ```SQL GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'%' IDENTIFIED BY 'SKYLINE_DBPASS'; ``` -------------------------------- ### Remove Docker Bridge Configuration Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README-zh_CN.md Removes the bridge configuration from the Docker daemon configuration file. This resolves connection refused errors with the local registry. ```shell bridge: "none" ``` -------------------------------- ### Fixing Local Repository Error Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Fixes a local repository error that can occur during Skyline image build and deployment. This involves deleting the bridge option from the /etc/docker/daemon.json file and restarting the Docker service. ```shell bridge: "none" ``` -------------------------------- ### Adding Skyline to Ansible Inventory Source: https://github.com/openstack/skyline-apiserver/blob/master/kolla/README.md Adds the skyline group to the Ansible inventory file. This configuration is required for Kolla Ansible to recognize and manage the Skyline service. It defines the skyline group as a child of the control group. ```bash [skyline:children] control ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.