You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2022/01/03 05:07:28 UTC

[GitHub] [submarine] KUAN-HSUN-LI commented on a change in pull request #831: SUBMARINE-1117. Connect API for CLI Experiments

KUAN-HSUN-LI commented on a change in pull request #831:
URL: https://github.com/apache/submarine/pull/831#discussion_r777295107



##########
File path: submarine-sdk/pysubmarine/submarine/client/api/experiment_client.py
##########
@@ -14,26 +14,27 @@
 # limitations under the License.
 
 import logging
-import os
 import time
 
+from submarine.cli.config.config import loadConfig
 from submarine.client.api.experiment_api import ExperimentApi
 from submarine.client.api_client import ApiClient
 from submarine.client.configuration import Configuration
 
 logger = logging.getLogger(__name__)
 logging.basicConfig(format="%(message)s")
 logging.getLogger().setLevel(logging.INFO)
+submarineCliConfig = loadConfig()
 
 
 def generate_host():
     """
     Generate submarine host
     :return: submarine host
     """
-    submarine_server_dns_name = str(os.environ.get("SUBMARINE_SERVER_DNS_NAME"))
-    submarine_server_port = str(os.environ.get("SUBMARINE_SERVER_PORT"))
-    host = submarine_server_dns_name + ":" + submarine_server_port
+    submarine_server_dns_name = str(submarineCliConfig.connection.hostname)
+    submarine_server_port = str(submarineCliConfig.connection.port)
+    host = "http://" + submarine_server_dns_name + ":" + submarine_server_port

Review comment:
       Don't change this function. In k8s, pods can connect through the DNS.




-- 
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: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org