Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate use of Ironic Horizon plugin #545

Closed
tzumainn opened this issue May 14, 2024 · 4 comments
Closed

Investigate use of Ironic Horizon plugin #545

tzumainn opened this issue May 14, 2024 · 4 comments
Assignees

Comments

@tzumainn
Copy link
Contributor

tzumainn commented May 14, 2024

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/

@joachimweyl
Copy link

@tzumainn when do you foresee this work being done and what do you estimate the effort would be?

@tzumainn
Copy link
Contributor Author

Ah, this is targeted towards the forthcoming intern; I'll work with him on establishing an estimate.

@ajamias
Copy link
Collaborator

ajamias commented May 31, 2024

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.

Horizon Install Instructions

This is a Centos 9 Stream guide

Requirements

  • 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

Setup

  • 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

Editing local_settings.py

  • 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

Enabling SSL

  • In <horizon_path>/requirements.txt, add django_extensions and Werkzeug. These libraries will enable Django to use https.
  • 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 <horizon_path>/tox.ini, look for the [testenv:runserver] section and change it to this:
[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>

Deploying on ESI Node

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>

Ironic-UI Install Instructions

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.

@tzumainn tzumainn closed this as completed Jun 3, 2024
@tzumainn
Copy link
Contributor Author

tzumainn commented Jun 3, 2024

Nicely thorough - thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants