[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r353061041 ## File path: bin/submarine-daemon.sh ## @@ -36,9 +36,9 @@ cd ${BIN}/>/dev/null SUBMARINE_SERVER_NAME="Submarine Server" SUBMARINE_SERVER_LOGFILE="${SUBMARINE_LOG_DIR}/submarine.log" SUBMARINE_SERVER_MAIN=org.apache.submarine.server.SubmarineServer -JAVA_OPTS+=" -Dsubmarine.log.file=${SUBMARINE_SERVER_LOGFILE}" +JAVA_OPTS+="${SUBMARINE_SERVER_JAVA_OPTS} ${SUBMARINE_SERVER_MEM} -Dsubmarine.log.file=${SUBMARINE_SERVER_LOGFILE}" -add_jar_in_dir "${BIN}/../lib" +add_each_jar_in_dir_recursive "${BIN}/../lib" Review comment: For now, let's just use ${BIN}/../lib, as I'm not sure about the conflicts with SUBMARINE_HOME in submarine-env.sh @hhhizzz, If you have the bandwidth, help us to optimize it~ 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r353055215 ## File path: submarine-server/server-rpc/src/main/java/org/apache/submarine/server/rpc/SubmarineRpcServer.java ## @@ -0,0 +1,407 @@ +/* + * 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.submarine.server.rpc; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.Resource; +import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.submarine.client.cli.param.Localization; +import org.apache.submarine.client.cli.param.ParametersHolder; +import org.apache.submarine.client.cli.param.Quicklink; +import org.apache.submarine.client.cli.param.ShowJobParameters; +import org.apache.submarine.client.cli.param.runjob.PyTorchRunJobParameters; +import org.apache.submarine.client.cli.param.runjob.RunJobParameters; +import org.apache.submarine.client.cli.param.runjob.TensorFlowRunJobParameters; +import org.apache.submarine.client.cli.remote.RpcContext; +import org.apache.submarine.client.cli.runjob.RoleParameters; +import org.apache.submarine.commons.rpc.ApplicationIdProto; +import org.apache.submarine.commons.rpc.LocalizationProto; +import org.apache.submarine.commons.rpc.ParameterProto; +import org.apache.submarine.commons.rpc.ParametersHolderProto; +import org.apache.submarine.commons.rpc.PyTorchRunJobParameterProto; +import org.apache.submarine.commons.rpc.QuicklinkProto; +import org.apache.submarine.commons.rpc.ResourceProto; +import org.apache.submarine.commons.rpc.RoleParameterProto; +import org.apache.submarine.commons.rpc.RunParameterProto; +import org.apache.submarine.commons.rpc.ShowJobParameterProto; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc; +import org.apache.submarine.commons.rpc.TensorFlowRunJobParameterProto; +import org.apache.submarine.commons.runtime.ClientContext; +import org.apache.submarine.commons.runtime.Framework; +import org.apache.submarine.commons.runtime.JobSubmitter; +import org.apache.submarine.commons.runtime.RuntimeFactory; +import org.apache.submarine.commons.runtime.api.PyTorchRole; +import org.apache.submarine.commons.runtime.api.Role; +import org.apache.submarine.commons.runtime.api.TensorFlowRole; +import org.apache.submarine.commons.runtime.param.Parameter; +import org.apache.submarine.commons.runtime.resource.ResourceUtils; +import org.apache.submarine.commons.utils.SubmarineConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A sample gRPC server that serve the RouteGuide (see route_guide.proto) service. + */ +public class SubmarineRpcServer { + private static final Logger LOG = LoggerFactory.getLogger( + SubmarineRpcServer.class.getName()); + + private final int port; + private final Server server; + + public SubmarineRpcServer(int port) throws IOException { +this(ServerBuilder.forPort(port), port); + } + + /** Create a RouteGuide server using serverBuilder as a base and features as data. */ + public SubmarineRpcServer(ServerBuilder serverBuilder, int port) { +this.port = port; +server = serverBuilder.addService(new SubmarineServerRpcService()) +.build(); + } + + /** Start serving requests. */ + public void start() throws IOException { +server.start(); +LOG.info("Server started, listening on " + port); +Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { +// Use stderr here since the logger may have been reset by its JVM shutdown hook. +LOG.info("*** shutting down gRPC server since JVM is shutting down"); +SubmarineRpcServer.this.stop(); + } +}); + } + + /** Stop serving requests and shutdown resources. */ + public void stop() { +if
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r353054264 ## File path: submarine-server/server-rpc/src/main/java/org/apache/submarine/server/rpc/SubmarineRpcServer.java ## @@ -0,0 +1,407 @@ +/* + * 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.submarine.server.rpc; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.Resource; +import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.submarine.client.cli.param.Localization; +import org.apache.submarine.client.cli.param.ParametersHolder; +import org.apache.submarine.client.cli.param.Quicklink; +import org.apache.submarine.client.cli.param.ShowJobParameters; +import org.apache.submarine.client.cli.param.runjob.PyTorchRunJobParameters; +import org.apache.submarine.client.cli.param.runjob.RunJobParameters; +import org.apache.submarine.client.cli.param.runjob.TensorFlowRunJobParameters; +import org.apache.submarine.client.cli.remote.RpcContext; +import org.apache.submarine.client.cli.runjob.RoleParameters; +import org.apache.submarine.commons.rpc.ApplicationIdProto; +import org.apache.submarine.commons.rpc.LocalizationProto; +import org.apache.submarine.commons.rpc.ParameterProto; +import org.apache.submarine.commons.rpc.ParametersHolderProto; +import org.apache.submarine.commons.rpc.PyTorchRunJobParameterProto; +import org.apache.submarine.commons.rpc.QuicklinkProto; +import org.apache.submarine.commons.rpc.ResourceProto; +import org.apache.submarine.commons.rpc.RoleParameterProto; +import org.apache.submarine.commons.rpc.RunParameterProto; +import org.apache.submarine.commons.rpc.ShowJobParameterProto; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc; +import org.apache.submarine.commons.rpc.TensorFlowRunJobParameterProto; +import org.apache.submarine.commons.runtime.ClientContext; +import org.apache.submarine.commons.runtime.Framework; +import org.apache.submarine.commons.runtime.JobSubmitter; +import org.apache.submarine.commons.runtime.RuntimeFactory; +import org.apache.submarine.commons.runtime.api.PyTorchRole; +import org.apache.submarine.commons.runtime.api.Role; +import org.apache.submarine.commons.runtime.api.TensorFlowRole; +import org.apache.submarine.commons.runtime.param.Parameter; +import org.apache.submarine.commons.runtime.resource.ResourceUtils; +import org.apache.submarine.commons.utils.SubmarineConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A sample gRPC server that serve the RouteGuide (see route_guide.proto) service. + */ +public class SubmarineRpcServer { + private static final Logger LOG = LoggerFactory.getLogger( + SubmarineRpcServer.class.getName()); + + private final int port; + private final Server server; + + public SubmarineRpcServer(int port) throws IOException { +this(ServerBuilder.forPort(port), port); + } + + /** Create a RouteGuide server using serverBuilder as a base and features as data. */ + public SubmarineRpcServer(ServerBuilder serverBuilder, int port) { +this.port = port; +server = serverBuilder.addService(new SubmarineServerRpcService()) +.build(); + } + + /** Start serving requests. */ + public void start() throws IOException { +server.start(); +LOG.info("Server started, listening on " + port); +Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { +// Use stderr here since the logger may have been reset by its JVM shutdown hook. +LOG.info("*** shutting down gRPC server since JVM is shutting down"); +SubmarineRpcServer.this.stop(); + } +}); + } + + /** Stop serving requests and shutdown resources. */ + public void stop() { +if
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r353053478 ## File path: submarine-workbench/interpreter/spark-interpreter/pom.xml ## @@ -175,6 +175,7 @@ org.apache.zeppelin zeppelin-spark-dependencies ${zeppelin.version} +
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r353053647 ## File path: submarine-server/server-rpc/src/main/java/org/apache/submarine/server/rpc/SubmarineRpcServer.java ## @@ -0,0 +1,407 @@ +/* + * 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.submarine.server.rpc; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.Resource; +import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.submarine.client.cli.param.Localization; +import org.apache.submarine.client.cli.param.ParametersHolder; +import org.apache.submarine.client.cli.param.Quicklink; +import org.apache.submarine.client.cli.param.ShowJobParameters; +import org.apache.submarine.client.cli.param.runjob.PyTorchRunJobParameters; +import org.apache.submarine.client.cli.param.runjob.RunJobParameters; +import org.apache.submarine.client.cli.param.runjob.TensorFlowRunJobParameters; +import org.apache.submarine.client.cli.remote.RpcContext; +import org.apache.submarine.client.cli.runjob.RoleParameters; +import org.apache.submarine.commons.rpc.ApplicationIdProto; +import org.apache.submarine.commons.rpc.LocalizationProto; +import org.apache.submarine.commons.rpc.ParameterProto; +import org.apache.submarine.commons.rpc.ParametersHolderProto; +import org.apache.submarine.commons.rpc.PyTorchRunJobParameterProto; +import org.apache.submarine.commons.rpc.QuicklinkProto; +import org.apache.submarine.commons.rpc.ResourceProto; +import org.apache.submarine.commons.rpc.RoleParameterProto; +import org.apache.submarine.commons.rpc.RunParameterProto; +import org.apache.submarine.commons.rpc.ShowJobParameterProto; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc; +import org.apache.submarine.commons.rpc.TensorFlowRunJobParameterProto; +import org.apache.submarine.commons.runtime.ClientContext; +import org.apache.submarine.commons.runtime.Framework; +import org.apache.submarine.commons.runtime.JobSubmitter; +import org.apache.submarine.commons.runtime.RuntimeFactory; +import org.apache.submarine.commons.runtime.api.PyTorchRole; +import org.apache.submarine.commons.runtime.api.Role; +import org.apache.submarine.commons.runtime.api.TensorFlowRole; +import org.apache.submarine.commons.runtime.param.Parameter; +import org.apache.submarine.commons.runtime.resource.ResourceUtils; +import org.apache.submarine.commons.utils.SubmarineConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A sample gRPC server that serve the RouteGuide (see route_guide.proto) service. Review comment: Done. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r352585831 ## File path: submarine-workbench/interpreter/spark-interpreter/pom.xml ## @@ -175,6 +175,7 @@ org.apache.zeppelin zeppelin-spark-dependencies ${zeppelin.version} +
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r352459684 ## File path: submarine-server/server-rpc/src/test/java/org/apache/submarine/server/rpc/SubmarineServerClient.java ## @@ -0,0 +1,89 @@ +/* + * 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.submarine.server.rpc; + +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.StatusRuntimeException; +import org.apache.submarine.commons.rpc.ApplicationIdProto; +import org.apache.submarine.commons.rpc.ParametersHolderProto; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc.SubmarineServerProtocolBlockingStub; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc.SubmarineServerProtocolStub; +import org.apache.submarine.commons.rpc.SubmarineServerProtocolGrpc; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.TimeUnit; + + +/** + * Sample client code that makes gRPC calls to the server. + */ +public class SubmarineServerClient { Review comment: Thanks. make sense to 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org
[GitHub] [submarine] yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc.
yuanzac commented on a change in pull request #117: SUBMARINE-303. Submarine client submit job to submarine server by grpc. URL: https://github.com/apache/submarine/pull/117#discussion_r352459428 ## File path: dev-support/mini-submarine/conf/bootstrap.sh ## @@ -36,6 +36,16 @@ for f in slaves core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml contai fi done +# Copy submarine config +for f in slaves submarine-site.xml submarine-env.sh; do + if [[ -e ${CONFIG_DIR}/$f ]]; then +cp ${CONFIG_DIR}/$f /opt/submarine-current/conf/$f Review comment: @pingsutw, Thanks for the review. /opt/submarine-current/conf/ has the latest submarine-site.xml and submarine-env.sh with default configuration. So we need to update them with the configuration suitable for mini-submarine. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org