Giter Club home page Giter Club logo

Comments (15)

wenwang1989 avatar wenwang1989 commented on August 18, 2024

Hi pvital, with proper server info designed which the front-end can retrieve from an API, I think this can be done as a filtered display mode. This means if the front-end can get the runtime detection info from the server by an API, we can either choose whether to display "Admin" tab or filtering different functinos that won't be activate in non-ppc machines.

from ginger.

danielhb avatar danielhb commented on August 18, 2024

We can use the Host API from kimchi (/host). The "cpu" info can be used to check if we're running in a POWER system or not by checking if this info has the string "POWER". This might be a bit inelegant but it solves the issue fast.

Using this API running in this Intel notebook:

$ curl -u danielhb -H "Content-Type: application/json" -H "Accept: application/json" http://localhost:8010/host -X GET
Enter host password for user 'danielhb':
{
"os_distro":"Fedora",
"cpu_model":"Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz",
"cpus":4,
"os_version":"20",
"os_codename":"Heisenbug",
"memory":6045294592
}

And in a POWER system:

$ curl -u root -H "Content-Type: application/json" -H "Accept: application/json" http://localhost:8010/host -X GET
Enter host password for user 'root':
{
(......)
"cpu":"POWER7+ (2.1) @ 4.228 GHz "
}

from ginger.

mopsfelder avatar mopsfelder commented on August 18, 2024

Is this feature aimed only for OPAL firmware? Shouldn't we be checking for firmware type, i.e. OPAL, instead of just CPU type?

from ginger.

laggarcia avatar laggarcia commented on August 18, 2024

Kimchi manages only machines running KVM. So I don't think we need to check whether it is OPAL or PowerVM (the other hypervisor available on Power systems).

from ginger.

danielhb avatar danielhb commented on August 18, 2024

wenwang1989, are you able to work in this issue? We need Ginger's UI to read the info of /host API to see if the host arch is Power and, if it's not, hide the Power exclusive features (IBM SEP and Firmware Update) from the user.

Thanks!

from ginger.

wenwang1989 avatar wenwang1989 commented on August 18, 2024

Hi dannielhb, I think I can do that. But also, one thing I considered is this Administrator, Ginger plugin, is made only for power. The way I understand this when people enable Ginger Administrator in a non-ppc machine, we need to hide some parts.

If "Administrator" is a tab only for power I don't think we need to hide anything cause x_86 user won't need this tab.

from ginger.

danielhb avatar danielhb commented on August 18, 2024

I am working in a mechanism, a new backend API, to properly tell the frontend which features to hide. It's not just a matter of Intel vs Power. There are features that even in Power should be hid if a certain package isn't present.

This is a preview of what I have at this moment. All the frontend needs to do is to send a GET to /plugins/ginger/capabilities and see which features are enabled or not. That way we relieve the UI to know specifics of the backend. If the feature is marked as "true", show it. Otherwise hide it:

$ curl -u danielhb -H "Content-Type: application/json" -H "Accept: application/json" http://localhost:8010/plugins/ginger/capabilities -X GET
Enter host password for user 'danielhb':
{
"PowerProfiles":false,
"Network":true,
"Sep":true,
"SanAdapters":true,
"Firmware":false,
"Sensors":false,
"Backup":true,
"Users":true
}

I'll ask you to wait for this API to be sent and approved by the ML before working in this issue. That way you'll change the code only once and we can control in the backend the behavior of the frontend.

from ginger.

wenwang1989 avatar wenwang1989 commented on August 18, 2024

Agreed. I can do this. I just checked that the end of 4th sprint is Dec. 16th which means we probably have no time for this feature in this release. I think we could add this work item in work item of the next release.

from ginger.

danielhb avatar danielhb commented on August 18, 2024

Yeah, it won't be ready for Dec 16th

from ginger.

wenwang1989 avatar wenwang1989 commented on August 18, 2024

@danielhb Let me know when you've done and I will do the rest work.

from ginger.

danielhb avatar danielhb commented on August 18, 2024

@wenwang1989 the capabilities API was just pushed to the master branch.

My suggestion is to get the contents from /plugins/ginger/capabilities and see which tabs the UI should show/hide. This values aren't supposed to change very often so it is OK to get the results once and then store it in the cache, expirating it when the session ends or the service restarts.

from ginger.

wenwang1989 avatar wenwang1989 commented on August 18, 2024

@danielhb Patch from UI side has been sent to mail list

from ginger.

danielhb avatar danielhb commented on August 18, 2024

@wenwang1989 thanks! I'll wait for a couple of reviews before pushing it. It would be great to have it upstream for this release!

from ginger.

wenwang1989 avatar wenwang1989 commented on August 18, 2024

@danielhb My pleasure!

from ginger.

danielhb avatar danielhb commented on August 18, 2024

@wenwang1989 patch works fine. Thanks!

from ginger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.