diff --git a/haupt/haupt/common/options/conf_subscriptions/core.py b/haupt/haupt/common/options/conf_subscriptions/core.py index 9f0d4ecd84..d5d042241f 100644 --- a/haupt/haupt/common/options/conf_subscriptions/core.py +++ b/haupt/haupt/common/options/conf_subscriptions/core.py @@ -10,6 +10,8 @@ conf.subscribe(core.HealthCheckWorkerTimeout) conf.subscribe(core.SchedulerEnabled) conf.subscribe(core.UiAdminEnabled) +conf.subscribe(core.UiSingleUrl) +conf.subscribe(core.UiDefaultStreamsUrl) conf.subscribe(core.UiAssetsVersion) conf.subscribe(core.UiBaseUrl) conf.subscribe(core.UiOffline) diff --git a/haupt/haupt/common/options/registry/core.py b/haupt/haupt/common/options/registry/core.py index 553d291890..1c19d9b13c 100644 --- a/haupt/haupt/common/options/registry/core.py +++ b/haupt/haupt/common/options/registry/core.py @@ -14,6 +14,8 @@ UI_OFFLINE = "UI_OFFLINE" UI_ENABLED = "UI_ENABLED" UI_IN_SANDBOX = "UI_IN_SANDBOX" +UI_SINGLE_URL = "UI_SINGLE_URL" +UI_DEFAULT_STREAMS_URL = "UI_DEFAULT_STREAMS_URL" OPTIONS = { LOGGING, @@ -30,6 +32,8 @@ UI_OFFLINE, UI_ENABLED, UI_IN_SANDBOX, + UI_SINGLE_URL, + UI_DEFAULT_STREAMS_URL, } @@ -199,3 +203,27 @@ class UiInSandbox(Option): typing = "bool" default = False options = None + + +class UiSingleUrl(Option): + key = UI_SINGLE_URL + scope = OptionScope.GLOBAL + is_secret = False + is_optional = True + is_list = False + store = OptionStores.SETTINGS + typing = "bool" + default = False + options = None + + +class UiDefaultStreamsUrl(Option): + key = UI_DEFAULT_STREAMS_URL + scope = OptionScope.GLOBAL + is_secret = False + is_optional = True + is_list = False + store = OptionStores.SETTINGS + typing = "str" + default = "" + options = None diff --git a/haupt/haupt/common/settings/ui.py b/haupt/haupt/common/settings/ui.py index f9e04c3928..07415a830e 100644 --- a/haupt/haupt/common/settings/ui.py +++ b/haupt/haupt/common/settings/ui.py @@ -63,6 +63,8 @@ def get_allowed_hosts(): context["UI_OFFLINE"] = config.ui_offline context["UI_ENABLED"] = config.ui_enabled context["UI_IN_SANDBOX"] = config.ui_in_sandbox + context["UI_SINGLE_URL"] = config.ui_single_url + context["UI_DEFAULT_STREAMS_URL"] = config.ui_default_streams_url context["TEMPLATES_DEBUG"] = template_debug context["LIST_TEMPLATE_CONTEXT_PROCESSORS"] = processors context["TEMPLATES"] = [ diff --git a/haupt/haupt/schemas/platform_config.py b/haupt/haupt/schemas/platform_config.py index 126f56c4ea..cb9dae4f35 100644 --- a/haupt/haupt/schemas/platform_config.py +++ b/haupt/haupt/schemas/platform_config.py @@ -25,9 +25,11 @@ ENV_KEYS_UI_ADMIN_ENABLED, ENV_KEYS_UI_ASSETS_VERSION, ENV_KEYS_UI_BASE_URL, + ENV_KEYS_UI_DEFAULT_STREAMS_URL, ENV_KEYS_UI_ENABLED, ENV_KEYS_UI_IN_SANDBOX, ENV_KEYS_UI_OFFLINE, + ENV_KEYS_UI_SINGLE_URL, ) from polyaxon._k8s.namespace import DEFAULT_NAMESPACE from polyaxon._schemas.base import BaseSchemaModel @@ -298,6 +300,10 @@ class PlatformConfig(BaseSchemaModel): ) ui_offline: Optional[bool] = Field(alias=ENV_KEYS_UI_OFFLINE, default=False) ui_enabled: Optional[bool] = Field(alias=ENV_KEYS_UI_ENABLED, default=True) + ui_single_url: Optional[bool] = Field(alias=ENV_KEYS_UI_SINGLE_URL, default=False) + ui_default_streams_url: Optional[str] = Field( + alias=ENV_KEYS_UI_DEFAULT_STREAMS_URL, default=None + ) class Config: extra = Extra.ignore diff --git a/haupt/haupt/schemas/proxies_config.py b/haupt/haupt/schemas/proxies_config.py index 8df747da17..ebd112b1eb 100644 --- a/haupt/haupt/schemas/proxies_config.py +++ b/haupt/haupt/schemas/proxies_config.py @@ -41,6 +41,7 @@ ENV_KEYS_STATIC_ROOT, ENV_KEYS_STATIC_URL, ENV_KEYS_UI_ADMIN_ENABLED, + ENV_KEYS_UI_SINGLE_URL, ) from polyaxon._schemas.base import BaseSchemaModel from polyaxon.api import STATIC_V1 @@ -121,6 +122,7 @@ class ProxiesConfig(BaseSchemaModel): ) static_url: Optional[str] = Field(alias=ENV_KEYS_STATIC_URL) ui_admin_enabled: Optional[bool] = Field(alias=ENV_KEYS_UI_ADMIN_ENABLED) + ui_single_url: Optional[str] = Field(alias=ENV_KEYS_UI_SINGLE_URL) has_forward_proxy: Optional[bool] = Field(alias=ENV_KEYS_PROXY_HAS_FORWARD_PROXY) forward_proxy_port: Optional[int] = Field(alias=ENV_KEYS_PROXY_FORWARD_PROXY_PORT) forward_proxy_host: Optional[str] = Field(alias=ENV_KEYS_PROXY_FORWARD_PROXY_HOST) diff --git a/haupt/tests/tests_common/test_options/test_options.py b/haupt/tests/tests_common/test_options/test_options.py index cb7ad33c5c..57beb0545e 100644 --- a/haupt/tests/tests_common/test_options/test_options.py +++ b/haupt/tests/tests_common/test_options/test_options.py @@ -14,9 +14,13 @@ def test_options_core(self): assert core.UiAdminEnabled.is_global() is True assert core.UiAdminEnabled.is_optional is True assert core.UiAdminEnabled.get_key_subject() == "UI_ADMIN_ENABLED" + assert core.UiAdminEnabled.get_namespace() is None assert core.UiBaseUrl.get_key_subject() == "UI_BASE_URL" assert core.UiAssetsVersion.get_key_subject() == "UI_ASSETS_VERSION" - assert core.UiAdminEnabled.get_namespace() is None + assert core.UiDefaultStreamsUrl.get_key_subject() == "UI_DEFAULT_STREAMS_URL" + assert core.UiDefaultStreamsUrl.get_namespace() is None + assert core.UiSingleUrl.get_key_subject() == "UI_SINGLE_URL" + assert core.UiSingleUrl.get_namespace() is None def test_options_scheduler(self): assert scheduler.SchedulerCountdown.get_namespace() is None