Plugin for OpenStack's dashboard Horizon for accessing and managing policies
Instructions for running the plugin using DevStack, Python3.6, pip 20.0.2 and Django 2.2:
cd /opt/stack/
git clone https://github.com/nizos/horizon-policies-plugin
cd horizon-policies-plugin/
bash install.bash
Instructions for running the tests can be found here in TESTS.md
Inotify-tools allows us to automatically reinstall the plangin when any of changes are made to its file. If you do not have inotify-tools installed you can install it by running the following command:
sudo apt install inotify-tools
Once installed, simply run the following command to start the development mode:
# cd /opt/stack/horizon/horizon-policies-plugin/policies-plugin/
bash develop.bash
To view Horizon dashboard error logs run the following command:
tail -f /var/log/apache2/horizon_error.log
sudo apt update
sudo apt upgrade
The full guide for installing DevStack can be found here but bellow are the quick steps to get up and running.
git clone https://opendev.org/openstack/devstack
cd devstack
The devstack repo contains a script that installs OpenStack and templates for configuration files.
Create a local.conf file with four passwords preset at the root of the devstack git repo.
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
This is the minimum required config to get started with DevStack.
./stack.sh
This will take a 15 - 20 minutes, largely depending on the speed of your internet connection. Many git trees and packages will be installed during this process.
Your devstack will have installed keystone, glance, nova, placement, cinder, neutron, and horizon. Floating IPs will be available, guests have access to the external world.
sudo apt install python3
sudo apt install python3-pip
python3 -m pip install Django==2.2
python3 --version
# Python 3.6.9
python3 -m pip --version
# pip 20.0.2 from /home/<user>/.local/lib/python3.6/site-packages/pip (python 3.6)
python3 -m django --version
# 2.2
Now its time to install the plugin, we start by navigating to where you would like to store the repository on your machine.
# Clone the repository anywhere in your file structure.
# Make sure your PWD is where you want to store the repository.
git clone https://github.com/nizos/horizon-policies-plugin
If you want to be able to view .git/ directories in vscode do the following:
- Open the settings window by clicking on File -> Preferences -> Settings or by hitting
ctrl+,
on your keyboard. - type
files.exclude
in the search bar. - Highlight the row with .git by hovering over it with your mouse and clicking on the
x
button to remove it from the list files and folder patterns that vscode will automatically hide.
Make sure your PWD is /path/to/repository/horizon-policies-plugin/policies-plugin/
bash install.bash
Wait for the command to finish, make sure to follow any prompts that may occur.
If you run into the error "You have offline compression enabled but key is missing from offline manifest.":
cd /opt/stack/horizon/openstack_dashboard/local/
Open local_settings.py and change
COMPRESS_OFFLINE = True
to
COMPRESS_OFFLINE = False
sudo service memcached restart
sudo service apache2 restart
To remove a specific package
python3 -m pip uninstall <package-name>
For example, to remove policies-plugin:
python3 -m pip uninstall policies-plugin
WARNING: The uninstallation may fail if your PWD is /path/to/repository/horizon-policies-plugin/policies-plugin with the message
Found existing installation: policies-plugin 0.0...
# Extra text that you get with the --verbose trigger:
Not sure how to uninstall: policies-plugin 0.0... - Check: /path/to/repository/horizon-policies-plugin/policies-plugin
Can't uninstall 'policies-plugin'. No files were found to uninstall.
The solution is to change directory and try the same command again.
If you want to view a list of all package types:
python3 -m pip list
To view details about a specific package type:
python3 -m pip show policies-plugin
These commands can help you verify that the plugin has been uninstalled.
Andreas, Nizar, Rickard, Joel & Wissam.