Skip to content

Commit

Permalink
feat: add allow_custom_resource_allocation to webserver config (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 authored Oct 30, 2023
1 parent 5dd0218 commit 2c2322b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/1666.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a `allow_custom_resource_allocation` config to webserver to show/hide the custom allocation on the session launcher.
2 changes: 2 additions & 0 deletions configs/webserver/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ force_2FA = false
# system_SSH_image = ""
# If true, display the amount of usage per directory such as folder capacity, and number of files and directories.
directory_based_usage = false
# If true, display the custom allocation on the session launcher.
# allow_custom_resource_allocation = true

[resources]
# Display "Open port to public" checkbox in the app launcher.
Expand Down
1 change: 1 addition & 0 deletions src/ai/backend/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
t.Key("force_2FA", default=False): t.ToBool(),
t.Key("system_SSH_image", default=""): t.String(allow_blank=True),
t.Key("directory_based_usage", default=False): t.ToBool(),
t.Key("allow_custom_resource_allocation", default=True): t.ToBool(),
}
).allow_extra("*"),
t.Key("resources"): t.Dict(
Expand Down
1 change: 1 addition & 0 deletions src/ai/backend/web/templates/config.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ connectionMode = "SESSION"
{% toml_field "systemSSHImage" config["service"]["system_SSH_image"] %}
{% toml_field "directoryBasedUsage" config["service"]["directory_based_usage"] %}
{% toml_field "maxCountForPreopenPorts" config["session"]["max_count_for_preopen_ports"] %}
{% toml_field "allowCustomResourceAllocation" config["service"]["allow_custom_resource_allocation"] %}

[resources]
{% toml_field "openPortToPublic" config["resources"]["open_port_to_public"] %}
Expand Down

0 comments on commit 2c2322b

Please sign in to comment.