You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/03/03 08:05:54 UTC

[GitHub] [knox] abhi2196 opened a new pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

abhi2196 opened a new pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276
 
 
   ## What changes were proposed in this pull request?
   
   Added a new rewrite rule in Livy service for handling redirects to /ui endpoint
   
   ## How was this patch tested?
   
   Manually tested in a Cluster with Knox and Livy Services.
   1. Edited the rewrite/service.xml for Livy service with the changes.
   2. Verified that `https://<KNOX_HOST:KNOX_PORT>/gateway/default/livy` gets redirected to `https://<KNOX_HOST:KNOX_PORT>/gateway/default/livy/ui`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387083657
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
 ##########
 @@ -45,4 +45,8 @@
     <rewrite template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
   </rule>
 
+  <rule dir="OUT" name="LIVYSERVER/livy/outbound/headers/ui" pattern="{scheme}://{host}:{port}/ui/">
 
 Review comment:
   Yes I verified with these changes that looking for `/ui/` as the pattern is correctly redirecting to livy ui page.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387048935
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
 ##########
 @@ -24,7 +24,9 @@
     </metadata>
   <routes>
     <route path="/livy/**?**"/>
-    <route path="/livy"/>
+    <route path="/livy">
+        <rewrite apply="LIVYSERVER/livy/outbound/headers/ui" to="response.headers"/>
 
 Review comment:
   Added change to apply to `/livy/` path.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387011789
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
 ##########
 @@ -24,7 +24,9 @@
     </metadata>
   <routes>
     <route path="/livy/**?**"/>
-    <route path="/livy"/>
+    <route path="/livy">
+        <rewrite apply="LIVYSERVER/livy/outbound/headers/ui" to="response.headers"/>
 
 Review comment:
   I think you want this to apply to the route after this as well. `/livy/`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk merged pull request #276: KNOX-2258 - Add new rewrite rule in Livy service for handling redirect requests to /ui

Posted by GitBox <gi...@apache.org>.
risdenk merged pull request #276: KNOX-2258 - Add new rewrite rule in Livy service for handling redirect requests to /ui
URL: https://github.com/apache/knox/pull/276
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
abhi2196 commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387049123
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
 ##########
 @@ -45,4 +45,8 @@
     <rewrite template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
   </rule>
 
+  <rule dir="OUT" name="LIVYSERVER/livy/outbound/headers/ui" pattern="{scheme}://{host}:{port}/ui">
+    <rewrite template="{$frontend[url]}/livy/ui"/>
 
 Review comment:
   Added required changes.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] abhi2196 commented on issue #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
abhi2196 commented on issue #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#issuecomment-593820685
 
 
   cc @risdenk @wypoon 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387012160
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
 ##########
 @@ -45,4 +45,8 @@
     <rewrite template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
   </rule>
 
+  <rule dir="OUT" name="LIVYSERVER/livy/outbound/headers/ui" pattern="{scheme}://{host}:{port}/ui">
+    <rewrite template="{$frontend[url]}/livy/ui"/>
 
 Review comment:
   Probably best to have trailing slash on this path.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #276: KNOX-2258: Add rewrite rule to fix livy redirect issue
URL: https://github.com/apache/knox/pull/276#discussion_r387073888
 
 

 ##########
 File path: gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
 ##########
 @@ -45,4 +45,8 @@
     <rewrite template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
   </rule>
 
+  <rule dir="OUT" name="LIVYSERVER/livy/outbound/headers/ui" pattern="{scheme}://{host}:{port}/ui/">
 
 Review comment:
   Hmm I guess I wasn't completely clear and was talking about only the `rewrite template` not the pattern here. Can you double check that looking for `/ui/` as the pattern is correct still? I want to make sure the header we are looking for matches in all the cases.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services