Closed tzumainn closed 1 month ago
@tzumainn when do you foresee this work being done and what do you estimate the effort would be?
Ah, this is targeted towards the forthcoming intern; I'll work with him on establishing an estimate.
We got a Horizon development environment set up and managed to get the Ironic_ui plugin installed and working too. However, we won't be using the plugin because some of the features that we want to give to esi lessee users aren't in there. Instead, we will be creating out own plugin from scratch with some inspiration from the Ironic-UI plugin.
This is a Centos 9 Stream guide
Python 3.11
sudo dnf install python3.11 python3.11-pip
Other packages
sudo dnf install gcc git-core python3.11-devel gettext
Read more here: https://docs.openstack.org/horizon/latest/install/system-requirements.html
Clone the repository
git clone https://opendev.org/openstack/horizon && cd horizon
(Optional) Set up your virtual environment
python3.11 -m venv .venv && source .venv/bin/activate
Install pip package for development
pip3.11 install tox
Copy settings example file to local_settings.py
cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
Read more here: https://docs.openstack.org/horizon/latest/contributor/quickstart.html#quickstart
Search for the config variable OPENSTACK_HOST and set that to the IPv4 address of the host serving the keystone service. Change the config variable OPENSTACK_KEYSTONE_URL as well if a non-default port is used Ex:
#OPENSTACK_HOST = "127.0.0.1"
#OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST
OPENSTACK_HOST = "esi.massopen.cloud"
OPENSTACK_KEYSTONE_URL = "https://esi.massopen.cloud:13000/v3"
Search for the config variable CACHES. This cache relies on no dependencies and is stored locally so no additional server setup is required. Set it to this:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
}
}
Uncomment the SESSION_ENGINE variable
If you would like to access this dashboard from a remote client, change the DEBUG and ALLOWED_HOSTS VARIABLES
DEBUG = False
ALLOWED_HOSTS = ['*']
To run the http development server run this:
tox -e runserver -- <ip>:<port> --insecure
In
In openstack_dashboard/local/local_settings.py, set these variables:
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True
If you don’t already have an ssl key or certificate, you can create your own with openssl:
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout <path to key> -out <path to certificate> -batch
In
[testenv:runserver_plus]
envdir = {toxworkdir}/venv
commands =
{envpython} {toxinidir}/manage.py collectstatic -v 0 -c --no-input
{envpython} {toxinidir}/manage.py runserver_plus --insecure --key-file <path to ssl key> --cert-file <path to ssl cert> -v 0 {posargs}
In openstack_dashboard/settings.py, add ‘django_extensions’ to INSTALLED_APPS.
INSTALLED_APPS= [
...
'django_extensions'
]
To run the https server, run this command:
tox -e runserver_plus -- <host>:<port>
This assumes that you have already gone through setting up a node.
Run this command on your local computer to see both the Fixed IP and the Floating IP.
openstack esi node network list
ssh into your node and run the Django server
ssh <default user>@<Floating IP>
# next run the server with one of the above tox commands
On your local computer, use a browser to access the dashboard at http://<Floating IP>:<port>
Follow instructions here https://docs.openstack.org/ironic-ui/latest/install/installation.html. In order to run Horizon with the Ironic-UI plugin, simply rerun the server just as you have been doing with the tox command above.
NOTE: This basic installation of Ironic-UI will only be shown to admin users. Extra steps will be needed for other users to see the panel.
Nicely thorough - thanks for doing this!
Horizon documentation can be found at https://docs.openstack.org/horizon/latest/
In theoooory I think you should be able to install Horizon locally, and point it at the MOC ESI endpoint.
The documentation for the Ironic plugin is: https://docs.openstack.org/ironic-ui/latest/