You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "yl09099 (via GitHub)" <gi...@apache.org> on 2023/09/04 02:23:22 UTC
[GitHub] [incubator-uniffle] yl09099 opened a new pull request, #1056: [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard.
yl09099 opened a new pull request, #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056
### What changes were proposed in this pull request?
Provides a start-stop script for the dashboard.
### Why are the changes needed?
(Please clarify why the changes are needed. For instance,
Fix: #960
### Does this PR introduce _any_ user-facing change?
Start and close the dashboar module using shell scripts.
### How was this patch tested?
UT.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1401438168
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.dashboard.web.proxy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.proxy.ProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WebProxyServlet extends ProxyServlet {
+
+ private String targetAddress;
+ /** Whether to enable the ssl mode */
+ private boolean sslEnable;
+
+ private static final Logger LOG = LoggerFactory.getLogger(WebProxyServlet.class);
+
+ public WebProxyServlet(String targetAddress, boolean sslEnable) {
+ this.targetAddress = targetAddress;
+ this.sslEnable = sslEnable;
+ }
+
+ @Override
+ protected String rewriteTarget(HttpServletRequest clientRequest) {
+ if (!validateDestination(clientRequest.getServerName(), clientRequest.getServerPort())) {
+ return null;
+ }
+ StringBuilder target = new StringBuilder();
+ String targetUri = "";
+ if (sslEnable) {
+ targetUri = "https://" + targetAddress + "/";
+ } else {
+ targetUri = "http://" + targetAddress + "/";
+ }
+ if (targetUri.endsWith("/")) {
Review Comment:
Is this always true?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng merged PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1401441315
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/JettyServerFront.java:
##########
@@ -83,14 +88,31 @@ private void initialization() {
}
private void setRootServletHandler() {
- final ContextHandler contextHandler = new ContextHandler("/");
+ HandlerList handlers = new HandlerList();
+ ResourceHandler resourceHandler = addResourceHandler();
+ String coordinatorWebAddress = conf.getString(DashboardConf.COORDINATOR_WEB_ADDRESS);
+ boolean sslEnable = conf.getBoolean(DashboardConf.JETTY_SSL_ENABLE, false);
Review Comment:
Reusing `JETTY_SSL_ENABLE` is weird. Could you add a new parameter? Such as `coodinator.ssl.enable`. Or change the format of `COORDINATOR_WEB_ADDRESS` to `http://host:port/`
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1401416738
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/config/DashboardConf.java:
##########
@@ -30,6 +30,12 @@ public class DashboardConf extends RssBaseConf {
.defaultValue(19988)
.withDescription("http server http port");
+ public static final ConfigOption<String> COORDINATOR_JETTY_ADDRESS =
+ ConfigOptions.key("coordinator.jetty.address")
Review Comment:
Is it possible that we will not use jetty in the future?Or we don’t use java to implement coordinator? How about coordinator.web.address or coordinator.address?
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/config/DashboardConf.java:
##########
@@ -30,6 +30,12 @@ public class DashboardConf extends RssBaseConf {
.defaultValue(19988)
.withDescription("http server http port");
+ public static final ConfigOption<String> COORDINATOR_JETTY_ADDRESS =
+ ConfigOptions.key("coordinator.jetty.address")
Review Comment:
Is it possible that we will not use jetty in the future?Or we don’t use java to implement coordinator? How about coordinator.web.address or coordinator.address?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400086733
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.dashboard.web.proxy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.proxy.ProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.uniffle.dashboard.web.JettyServerFront;
+
+public class WebProxyServlet extends ProxyServlet {
+
+ private String hostAndPort;
+ private static final Logger LOG = LoggerFactory.getLogger(JettyServerFront.class);
+
+ public WebProxyServlet(String hostAndPort) {
Review Comment:
```suggestion
public WebProxyServlet(String targetAddress) {
```
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "yl09099 (via GitHub)" <gi...@apache.org>.
yl09099 commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1401425463
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/config/DashboardConf.java:
##########
@@ -30,6 +30,12 @@ public class DashboardConf extends RssBaseConf {
.defaultValue(19988)
.withDescription("http server http port");
+ public static final ConfigOption<String> COORDINATOR_JETTY_ADDRESS =
+ ConfigOptions.key("coordinator.jetty.address")
Review Comment:
> Is it possible that we will not use jetty in the future?Or we don’t use java to implement coordinator? How about coordinator.web.address or coordinator.address?
OK.
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/config/DashboardConf.java:
##########
@@ -30,6 +30,12 @@ public class DashboardConf extends RssBaseConf {
.defaultValue(19988)
.withDescription("http server http port");
+ public static final ConfigOption<String> COORDINATOR_JETTY_ADDRESS =
+ ConfigOptions.key("coordinator.jetty.address")
Review Comment:
> Is it possible that we will not use jetty in the future?Or we don’t use java to implement coordinator? How about coordinator.web.address or coordinator.address?
OK.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400087107
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.dashboard.web.proxy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.proxy.ProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.uniffle.dashboard.web.JettyServerFront;
+
+public class WebProxyServlet extends ProxyServlet {
+
+ private String hostAndPort;
+ private static final Logger LOG = LoggerFactory.getLogger(JettyServerFront.class);
+
+ public WebProxyServlet(String hostAndPort) {
+ this.hostAndPort = hostAndPort;
+ }
+
+ @Override
+ protected String rewriteTarget(HttpServletRequest clientRequest) {
+ if (!validateDestination(clientRequest.getServerName(), clientRequest.getServerPort())) {
+ return null;
+ }
+ StringBuilder target = new StringBuilder();
+ String targetUri = "http://" + hostAndPort + "/";
Review Comment:
May use https
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng closed pull request #1056: [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard.
URL: https://github.com/apache/incubator-uniffle/pull/1056
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] yl09099 closed pull request #1056: [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard.
Posted by "yl09099 (via GitHub)" <gi...@apache.org>.
yl09099 closed pull request #1056: [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard.
URL: https://github.com/apache/incubator-uniffle/pull/1056
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1401413439
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.dashboard.web.proxy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.proxy.ProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.uniffle.dashboard.web.JettyServerFront;
+
+public class WebProxyServlet extends ProxyServlet {
+
+ private String hostAndPort;
+ private static final Logger LOG = LoggerFactory.getLogger(JettyServerFront.class);
+
+ public WebProxyServlet(String hostAndPort) {
+ this.hostAndPort = hostAndPort;
+ }
+
+ @Override
+ protected String rewriteTarget(HttpServletRequest clientRequest) {
+ if (!validateDestination(clientRequest.getServerName(), clientRequest.getServerPort())) {
+ return null;
+ }
+ StringBuilder target = new StringBuilder();
+ String targetUri = "http://" + hostAndPort + "/";
Review Comment:
https://github.com/apache/incubator-uniffle/blob/be106976474cc02a614ca842421670debf50f7aa/common/src/main/java/org/apache/uniffle/common/web/JettyServer.java#L83-L85
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#issuecomment-1823733321
### What changes were proposed in this pull request?
Provides a start-stop script for the dashboard.
### Why are the changes needed?
Fix: https://github.com/apache/incubator-uniffle/issues/960
### Does this PR introduce any user-facing change?
Start and close the dashboard module using shell scripts.
### How was this patch tested?
UT.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "yl09099 (via GitHub)" <gi...@apache.org>.
yl09099 commented on PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#issuecomment-1818869683
@jerqi @xianjingfeng @leixm Please look at it for me.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #1056: [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard.
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#issuecomment-1657215407
## [Codecov](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1056?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#1056](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1056?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (8db1273) into [master](https://app.codecov.io/gh/apache/incubator-uniffle/commit/d6b43f0ec36197169fd4637d55eeec5911bd90aa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (d6b43f0) will **increase** coverage by `1.73%`.
> Report is 14 commits behind head on master.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #1056 +/- ##
============================================
+ Coverage 53.66% 55.39% +1.73%
+ Complexity 2523 2092 -431
============================================
Files 382 314 -68
Lines 21672 14012 -7660
Branches 1795 1259 -536
============================================
- Hits 11630 7762 -3868
+ Misses 9338 5832 -3506
+ Partials 704 418 -286
```
[see 102 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1056/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "yl09099 (via GitHub)" <gi...@apache.org>.
yl09099 commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400189969
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.dashboard.web.proxy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.proxy.ProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.uniffle.dashboard.web.JettyServerFront;
+
+public class WebProxyServlet extends ProxyServlet {
+
+ private String hostAndPort;
+ private static final Logger LOG = LoggerFactory.getLogger(JettyServerFront.class);
+
+ public WebProxyServlet(String hostAndPort) {
+ this.hostAndPort = hostAndPort;
+ }
+
+ @Override
+ protected String rewriteTarget(HttpServletRequest clientRequest) {
+ if (!validateDestination(clientRequest.getServerName(), clientRequest.getServerPort())) {
+ return null;
+ }
+ StringBuilder target = new StringBuilder();
+ String targetUri = "http://" + hostAndPort + "/";
Review Comment:
> May use https
None of the servers support https, so that's not necessary.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "yl09099 (via GitHub)" <gi...@apache.org>.
yl09099 commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400186652
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/JettyServerFront.java:
##########
@@ -83,14 +88,32 @@ private void initialization() {
}
private void setRootServletHandler() {
- final ContextHandler contextHandler = new ContextHandler("/");
+ HandlerList handlers = new HandlerList();
+ ResourceHandler resourceHandler = addResourceHandler();
+ String backedAddress = conf.getString(DashboardConf.DASHBOARD_BACKEND_ADDRESS);
+ ServletContextHandler servletContextHandler = addProxyHandler(backedAddress);
+ handlers.setHandlers(new Handler[] {resourceHandler, servletContextHandler});
+ server.setHandler(handlers);
+ }
+
+ private static ResourceHandler addResourceHandler() {
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirectoriesListed(true);
resourceHandler.setBaseResource(
Resource.newResource(JettyServerFront.class.getClassLoader().getResource("static")));
resourceHandler.setWelcomeFiles(new String[] {"index.html"});
- contextHandler.setHandler(resourceHandler);
- server.setHandler(contextHandler);
+ return resourceHandler;
+ }
+
+ private static ServletContextHandler addProxyHandler(String dashboardBackAddress) {
+ ProxyServlet proxyServlet = new WebProxyServlet(dashboardBackAddress);
+ ServletHolder holder = new ServletHolder(proxyServlet);
+ holder.setInitParameter("idleTimeout", "120000");
Review Comment:
> Could we avoid hard code?
Here is redundant, the above on the basis of the Server has set the relevant properties, have been deleted.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400086388
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/JettyServerFront.java:
##########
@@ -83,14 +88,32 @@ private void initialization() {
}
private void setRootServletHandler() {
- final ContextHandler contextHandler = new ContextHandler("/");
+ HandlerList handlers = new HandlerList();
+ ResourceHandler resourceHandler = addResourceHandler();
+ String backedAddress = conf.getString(DashboardConf.DASHBOARD_BACKEND_ADDRESS);
+ ServletContextHandler servletContextHandler = addProxyHandler(backedAddress);
+ handlers.setHandlers(new Handler[] {resourceHandler, servletContextHandler});
+ server.setHandler(handlers);
+ }
+
+ private static ResourceHandler addResourceHandler() {
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirectoriesListed(true);
resourceHandler.setBaseResource(
Resource.newResource(JettyServerFront.class.getClassLoader().getResource("static")));
resourceHandler.setWelcomeFiles(new String[] {"index.html"});
- contextHandler.setHandler(resourceHandler);
- server.setHandler(contextHandler);
+ return resourceHandler;
+ }
+
+ private static ServletContextHandler addProxyHandler(String dashboardBackAddress) {
+ ProxyServlet proxyServlet = new WebProxyServlet(dashboardBackAddress);
+ ServletHolder holder = new ServletHolder(proxyServlet);
+ holder.setInitParameter("idleTimeout", "120000");
Review Comment:
Could we avoid hard code?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400085464
##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/config/DashboardConf.java:
##########
@@ -30,6 +30,12 @@ public class DashboardConf extends RssBaseConf {
.defaultValue(19988)
.withDescription("http server http port");
+ public static final ConfigOption<String> DASHBOARD_BACKEND_ADDRESS =
+ ConfigOptions.key("dashboard.backend.address")
Review Comment:
How about change to `coordinator.address`?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#discussion_r1400091841
##########
docs/dashboard_guide.md:
##########
@@ -0,0 +1,42 @@
+---
+layout: page
+displayTitle: Metrics Guide
+title: Metrics Guide
+description: Metrics Guide
Review Comment:
```suggestion
description: Dashboard Guide
```
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#960][part-3] feat(dashboard): Provides a start-stop script for the dashboard. [incubator-uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on PR #1056:
URL: https://github.com/apache/incubator-uniffle/pull/1056#issuecomment-1823733857
Merged. Thanks @yl09099
--
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.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org