From 48c38b5dffc42d5779323ba3264a77107c024b31 Mon Sep 17 00:00:00 2001 From: octodog Date: Fri, 22 Nov 2024 15:00:42 +0900 Subject: [PATCH] feat: Add `show_non_installed_images` config on webserver (#3124) (#3130) Co-authored-by: Jihyun Kang --- changes/3124.feature.md | 1 + configs/webserver/sample.conf | 2 ++ src/ai/backend/web/config.py | 1 + src/ai/backend/web/templates/config.toml.j2 | 1 + src/ai/backend/web/templates/config_ini.toml.j2 | 4 ++++ 5 files changed, 9 insertions(+) create mode 100644 changes/3124.feature.md diff --git a/changes/3124.feature.md b/changes/3124.feature.md new file mode 100644 index 0000000000..2d036122d4 --- /dev/null +++ b/changes/3124.feature.md @@ -0,0 +1 @@ +Add an `show_non_installed_images` option to show all images regardless of installation on environment select section in session/service launcher page. \ No newline at end of file diff --git a/configs/webserver/sample.conf b/configs/webserver/sample.conf index d2c2ce4648..a46a4a1b08 100644 --- a/configs/webserver/sample.conf +++ b/configs/webserver/sample.conf @@ -98,6 +98,8 @@ max_file_upload_size = 4294967296 # e.g. cr.backend.ai/stable/python # You should pick default_environment in ui section too. #allowlist = "" +# Show all environment images regardless of installation +show_non_installed_images = false [plugin] # Comma-separated string diff --git a/src/ai/backend/web/config.py b/src/ai/backend/web/config.py index d81da9b6b0..7e1d94ae0c 100644 --- a/src/ai/backend/web/config.py +++ b/src/ai/backend/web/config.py @@ -86,6 +86,7 @@ }).allow_extra("*"), t.Key("environments"): t.Dict({ t.Key("allowlist", default=None): t.Null | tx.StringList(empty_str_as_empty_list=True), + t.Key("show_non_installed_images", default=False): t.ToBool, }).allow_extra("*"), t.Key("plugin"): t.Dict({ t.Key("page", default=None): t.Null | tx.StringList(empty_str_as_empty_list=True), diff --git a/src/ai/backend/web/templates/config.toml.j2 b/src/ai/backend/web/templates/config.toml.j2 index 6566beed2f..56bb4a7246 100644 --- a/src/ai/backend/web/templates/config.toml.j2 +++ b/src/ai/backend/web/templates/config.toml.j2 @@ -53,6 +53,7 @@ connectionMode = "SESSION" [environments] {% toml_strlist_field "allowlist" config["environments"]["allowlist"] %} +{% toml_field "showNonInstalledImages" config["environments"]["show_non_installed_images"] %} [menu] {% toml_strlist_field "blocklist" config["ui"]["menu_blocklist"] %} diff --git a/src/ai/backend/web/templates/config_ini.toml.j2 b/src/ai/backend/web/templates/config_ini.toml.j2 index e4e32e5147..d2dd04f3b5 100644 --- a/src/ai/backend/web/templates/config_ini.toml.j2 +++ b/src/ai/backend/web/templates/config_ini.toml.j2 @@ -6,6 +6,10 @@ {% toml_field "enableLLMPlayground" config["ui"]["enable_LLM_playground"] %} connectionMode = "SESSION" +[environments] +{% toml_strlist_field "allowlist" config["environments"]["allowlist"] %} +{% toml_field "showNonInstalledImages" config["environments"]["show_non_installed_images"] %} + [wsproxy] {% toml_field "proxyURL" config["service"]["wsproxy"]["url"] %} # proxyBaseURL =