From 1ccdff5e77d2140844b3cc2b313d386e3c9bcc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kotiuk?= Date: Tue, 6 Jun 2023 15:52:40 +0200 Subject: [PATCH] Support clearml-init hosts detection for WebApp with no port (#1031) Support clearml-init hosts detection for WebApp with no port and api/files hosts use the default ports. --- clearml/cli/config/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clearml/cli/config/__main__.py b/clearml/cli/config/__main__.py index 16e55cc4..de006d3d 100644 --- a/clearml/cli/config/__main__.py +++ b/clearml/cli/config/__main__.py @@ -237,6 +237,12 @@ def parse_known_host(parsed_host): api_host = parsed_host.scheme + "://" + parsed_host.netloc.replace(':8080', ':8008', 1) + parsed_host.path web_host = parsed_host.scheme + "://" + parsed_host.netloc + parsed_host.path files_host = parsed_host.scheme + "://" + parsed_host.netloc.replace(':8080', ':8081', 1) + parsed_host.path + elif parsed_host.port is None: + print('Web app hosted on standard port using ' + parsed_host.scheme + ' protocol.') + print('Assuming files and api ports are unchanged and use the same (' + parsed_host.scheme + ') protocol') + api_host = parsed_host.scheme + "://" + parsed_host.netloc + ':8008' + parsed_host.path + web_host = parsed_host.scheme + "://" + parsed_host.netloc + parsed_host.path + files_host = parsed_host.scheme + "://" + parsed_host.netloc+ ':8081' + parsed_host.path else: print("Warning! Could not parse host name") api_host = ''