[ 
https://issues.apache.org/jira/browse/KNOX-3003?focusedWorklogId=902772&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-902772
 ]

ASF GitHub Bot logged work on KNOX-3003:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jan/24 10:01
            Start Date: 31/Jan/24 10:01
    Worklog Time Spent: 10m 
      Work Description: smolnar82 opened a new pull request, #838:
URL: https://github.com/apache/knox/pull/838

   ## What changes were proposed in this pull request?
   
   There are two important pieces of this PR:
   1. the `getTopologies` REST API endpoint in `KnoxMetadataResource` was 
modified in a way such that it includes only one item per service role 
(IMPALAUI, WEBHDFS, HUE, HBASEUI, etc...) with a list of service URLs from now 
on. In previous versions it was different: the response had `N` items per 
service role with a unique service URL.
   
   ```
   $ curl -H 'Accept: application/json' -iku admin:admin-password 
https://localhost:8443/gateway/sandbox/api/v1/metadata/topologies?name=sandbox
   HTTP/1.1 200 OK
   Date: Wed, 31 Jan 2024 09:32:09 GMT
   Set-Cookie: KNOXSESSIONID=node0pafwbogn50gjy2zjiaxuchwx0.node0; 
Path=/gateway/sandbox; Secure; HttpOnly
   Expires: Thu, 01 Jan 1970 00:00:00 GMT
   Set-Cookie: rememberMe=deleteMe; Path=/gateway/sandbox; Max-Age=0; 
Expires=Tue, 30-Jan-2024 09:32:09 GMT; SameSite=lax
   Content-Type: application/json
   Transfer-Encoding: chunked
   
   {
       "topologyInformations": {
           "topologyInformation": [
               {
                   "topology": "sandbox",
                   "pinned": false,
                   "apiServicesViewVersion": "v1",
                   "apiServices": {
                       "service": [
                           {
                               "context": "/webhdfs",
                               "description": "An HTTP REST API which supports 
the complete FileSystem interface for HDFS.",
                               "samples": {
                                   "sample": [
                                       {
                                           "description": "List all files under 
'testPath'",
                                           "value": "curl -iv -X GET 
\"https://localhost:8443/gateway/sandbox/webhdfs/v1/testPath?op=LISTSTATUS\"";
                                       },
                                       {
                                           "description": "Rename a 
File/Directory under ",
                                           "value": "curl -iv -X PUT 
\"https://localhost:8443/gateway/sandbox/webhdfs/v1/testPath/testFile?op=RENAME&destination=testPath/renamedFile\"";
                                       },
                                       {
                                           "description": "Get Home Directory",
                                           "value": "curl -iv -X GET 
\"https://localhost:8443/gateway/sandbox/webhdfs/v1/?op=GETHOMEDIRECTORY\"";
                                       },
                                       {
                                           "description": "You may check out 
Apache WebHDFS's REST API documentation here",
                                           "value": 
"https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html";
                                       }
                                   ]
                               },
                               "serviceName": "WEBHDFS",
                               "serviceUrls": [
                                   
"https://localhost:8443/gateway/sandbox/webhdfs";
                               ],
                               "shortDesc": "Web HDFS",
                               "type": "API",
                               "version": ""
                           }
                       ]
                   },
                   "uiServices": {
                       "service": [
                           {
                               "context": 
"/hbase/webui/master?&host={{HOST}}&port={{PORT}}",
                               "description": "The HBase Master web UI is a 
simple but useful tool, to get an overview of the current status of the 
cluster...",
                               "samples": {
                                   "sample": []
                               },
                               "serviceName": "HBASEUI",
                               "serviceUrls": [
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost1&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost10&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost11&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost12&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost13&port=8889";,
                                   ...
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost6&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost7&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost8&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/hbase/webui/master?&host=localhost9&port=8889";
                               ],
                               "shortDesc": "HBase UI",
                               "type": "UI",
                               "version": "2.1.0"
                           },
                           {
                               "context": "/hdfs/?host={{BACKEND_HOST}}",
                               "description": "The namenode UI or the namenode 
web interface is used to monitor the status of the namenode.",
                               "samples": {
                                   "sample": []
                               },
                               "serviceName": "HDFSUI",
                               "serviceUrls": [
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost10:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost11:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost12:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost13:8889";,
                                   ...
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost6:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost7:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost8:8889";,
                                   
"https://localhost:8443/gateway/sandbox/hdfs/?host=http://localhost9:8889";
                               ],
                               "shortDesc": "HDFS Namenode UI",
                               "type": "UI",
                               "version": ""
                           },
                           {
                               "context": "/hue/",
                               "description": "Hue UI is a Web interface for 
analyzing data with Apache Hadoop",
                               "samples": {
                                   "sample": []
                               },
                               "serviceName": "HUE",
                               "serviceUrls": [
                                   "https://localhost:8443/gateway/sandbox/hue/";
                               ],
                               "shortDesc": "Hue UI",
                               "type": "UI",
                               "version": ""
                           },
                           {
                               "context": 
"/impalaui?scheme={{SCHEME}}&host={{HOST}}&port={{PORT}}",
                               "description": "Each of the Impala daemons 
(impalad, statestored, and catalogd) includes a built-in web server that 
displays diagnostic and status information.",
                               "samples": {
                                   "sample": []
                               },
                               "serviceName": "IMPALAUI",
                               "serviceUrls": [
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost1&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost10&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost11&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost12&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost13&port=8889";,
                                   ...
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost6&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost7&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost8&port=8889";,
                                   
"https://localhost:8443/gateway/sandbox/impalaui?scheme=http&host=localhost9&port=8889";
                               ],
                               "shortDesc": "Impala UI",
                               "type": "UI",
                               "version": ""
                           }
                       ]
                   }
               }
           ]
       }
   }
   ```
   
   2. The Knox Home page is also modified: if a service role has more than one 
service URL, the number of instances is visible next to the service role name 
within the `Topologies` section. Clicking the service icon or the service name 
will result in a modal window that lists all instances of the given service 
role.
   I also added a filter box where end-users can search by hostname and/or port 
to make it easier for them to narrow down those instances precisely for what 
they are looking for.
   <img width="1775" alt="Screenshot 2024-01-31 at 10 56 22" 
src="https://github.com/apache/knox/assets/34065904/3dda9ddf-7314-41f3-8198-e0729cf7d5d1";>
   <img width="1777" alt="Screenshot 2024-01-31 at 10 59 15" 
src="https://github.com/apache/knox/assets/34065904/8bfb95dc-4b18-4feb-9945-f7974dbc766c";>
   
   ## How was this patch tested?
   
   Updated existing unit tests to cover the changes in `ServiceModel` and 
tested the new feature E2E locally (see sample JSON response and the new Home 
page layout above).




Issue Time Tracking
-------------------

            Worklog Id:     (was: 902772)
    Remaining Estimate: 0h
            Time Spent: 10m

> Group UI services of the same type
> ----------------------------------
>
>                 Key: KNOX-3003
>                 URL: https://issues.apache.org/jira/browse/KNOX-3003
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Homepage
>    Affects Versions: 2.0.0, 1.6.0, 1.6.1
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Critical
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, if a UI service has multiple instances with different URLs in a 
> given topology, that UI service will be listed on the Knox Home page as many 
> times as the number of URLs it has. This makes the user experience a lot 
> worse if we are talking about hundreds of occurrences of this case.
> We learned from some real-life use cases that IMPALA is one of these 
> services, and there are 1000+ node clusters out there with more than 100 
> Impala Daemon roles. In that particular case, the Knox Home page was a mess.
> To address this issue, the following UI improvement should be implemented:
>  * if a UI service has more than one URL in the given topology, individual 
> tiles should not be displayed. Instead, one "group" tile must be added with a 
> clear indication this is a group of URLs of the same service.
>  * clicking the group tile should open a modal window with separate tiles for 
> each service URL
>  * in this modal window, a search field will be added to give our end-users 
> the chance to narrow down results (by hostname for instance)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to