CCI-MOC / esi

Elastic Secure Infrastructure project
6 stars 12 forks source link

Establish requirements for extending Horizon for ESI #546

Closed tzumainn closed 1 week ago

tzumainn commented 1 month ago

Our own horizon plugin? Extend/fork the Ironic plugin?

Here's what the MOC did, for reference: https://github.com/CCI-MOC/horizon-onboarding

joachimweyl commented 1 month ago

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

tzumainn commented 1 month ago

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

tzumainn commented 1 month ago

Just to reiterate - this issue is about figuring out the steps and broad implementation details necessary for our solution. For example, I think it's likely that we'll want to just start our own ESI plugin from scratch (given that the Ironic plugin is admin-focused). If so, at the minimum the steps needed are:

Once you have that list, put it here and I'll create new implementation issues.

ajamias commented 1 month ago

Here is documentation on creating the plugin panel: https://docs.openstack.org/horizon/latest/contributor/tutorials/plugin.html. I would need to read up on some Django and Angular syntax, but my first steps in this direction would be creating a "hello world" plugin panel.

Next, I see the Ironic-ui using the ironicclient module here: https://github.com/openstack/ironic-ui/blob/master/ironic_ui/api/ironic.py. More details about the api files here: https://docs.openstack.org/horizon/latest/contributor/tutorials/plugin.html#my-rest-api-py.

The first few goals for this plugin is to see a working implementation for node_list and node_set_power_state as a table of nodes and buttons to control the power state.

tzumainn commented 1 month ago

Okay! That sounds reasonable, except you probably want to use both the Ironic client and the ESI client. The reason is the list of nodes should probably include the lease information, and that's what openstack esi node list does. So it's probably worth checking how the ironic plugin leverages ironicclient, and making sure that esileapclient (and eventually esiclient) can do the same.

Make sure you include other requirements as well, such as the new git repository. I'll update the details of this issue to make it clear that we're looking for requirements in this issue.

ajamias commented 1 month ago

Currently, I have a basic "hello world" panel. The direction I'm moving in is creating an AngularJS esi module, and a service that sends requests to the /v1/nodes endpoint for the esi nodes. The problem I am having now is authentication. Since this host is different than esi.massopen.cloud, I don't think the authentication transfers over? Basically, I need to create a GET request to that endpoint with the same authentication, and I don't know how to do that with the Keystone service.

All the useful information I get with the response headers is Www-Authenticate Keystone uri="<esi node list endpoint>"

After that is all figured out, the next step is to make this "pretty", putting this data into tables and buttons with actions.

UPDATE: I see a solution here https://docs.openstack.org/api-ref/identity/v3/

tzumainn commented 1 month ago

Currently, I have a basic "hello world" panel. The direction I'm moving in is creating an AngularJS esi module, and a service that sends requests to the /v1/nodes endpoint for the esi nodes. The problem I am having now is authentication. Since this host is different than esi.massopen.cloud, I don't think the authentication transfers over? Basically, I need to create a GET request to that endpoint with the same authentication, and I don't know how to do that with the Keystone service.

All the useful information I get with the response headers is Www-Authenticate Keystone uri="<esi node list endpoint>"

After that is all figured out, the next step is to make this "pretty", putting this data into tables and buttons with actions.

UPDATE: I see a solution here https://docs.openstack.org/api-ref/identity/v3/

How does the ironic-ui plugin do it?

ajamias commented 1 month ago

From top down, ironic nodes are listed in html, which uses the AngularJS node-list controller, which uses the AngularJS ironic service, which sends api get requests to the Ironic REST api, which uses ironicclient.

I'm now thinking that, instead of trying to authenticate to that endpoint, I can create a REST api that uses the esisdk.

tzumainn commented 1 month ago

Ah, interesting. The nomenclature is a bit confusing, because when you said "Ironic REST API" I thought at first you meant the Ironic service REST API; but no, the ironic-ui plugin creates its own REST API. In that case, yeah, I think your plan is correct - you want to create an ESI UI REST API, which talks to the esisdk (which talks to the ESI-Leap service REST API).

So in terms of planning, I think you have the right direction. Can you create a quick document that explains your plan for creating this initial ESI UI - how it's a plugin builds off of the openstack-dashboard - and the various high-level implementation details that you've figured out? I know it sounds like a re-iteration of what we've talked about here, but it's good to practice this sort of documentation and description, since it's often what you need when you bring plans in front of managers and other engineers.

joachimweyl commented 3 weeks ago

@ajamias do we have a PR we can link to this issue? @tzumainn are we still targeting end of sprint for this?

tzumainn commented 3 weeks ago

that's the plan!

ajamias commented 2 weeks ago

So in terms of planning, I think you have the right direction. Can you create a quick document that explains your plan for creating this initial ESI UI - how it's a plugin builds off of the openstack-dashboard - and the various high-level implementation details that you've figured out? I know it sounds like a re-iteration of what we've talked about here, but it's good to practice this sort of documentation and description, since it's often what you need when you bring plans in front of managers and other engineers.

https://docs.google.com/document/d/1sqIdsyMomnnRxkquBglFKmRdI5n1Vzwbi5LWXqVt4ak/edit?usp=sharing

@ajamias do we have a PR we can link to this issue?

https://github.com/CCI-MOC/esi-ui/pull/1

tzumainn commented 2 weeks ago

@ajamias can you open the document to comments/edits?

ajamias commented 2 weeks ago

@ajamias can you open the document to comments/edits?

yep just did