App configuration
Wave server configuration
The H2O App Store lets users import and access Apps and run Instances of these apps. Primarily, apps are written using the Python H2O Wave framework. H2O Wave is a web application framework that leverages the Wave server to broker all interactions between the application code and a client.
In the AI App Store, each time a user runs an App, a new App Instance starts in its own pod with its own Wave Server running along the App source code.
As a result, the AI App Store controls most of
the Wave server configuration settings.
However, an AI App Store admin can change these via environment variables, either globally for all
apps, or allow developers to change certain configuration settings on a per-app basis
via app.toml
.
This is useful, for example, when configuring maximum allowed request size via
the H2O_WAVE_MAX_REQUEST_SIZE
setting, as the default is 5MB (requests greater than 5MB will fail
or time out), which may be too small for applications that require handling large file uploads, etc.
By default, Wave environment variables matching the following regular expressions can be changed on
per-app basis via app.toml
:
^H2O_WAVE_ML_.*
^H2O_WAVE_PUBLIC_DIR$
^H2O_WAVE_PRIVATE_DIR$
^H2O_WAVE_MAX_REQUEST_SIZE$
^H2O_WAVE_NO_STORE$
^H2O_WAVE_SESSION_INACTIVITY_TIMEOUT$
^H2O_WAVE_DATA_DIR$
^H2O_WAVE_PING_INTERVAL$
Change a setting for all apps
As an admin, you can change a Wave setting such as a higher limit for HTTP requests for all users and app instances in the AI App Store.
To do this, add the required environment variable to the apps
section in the App Store helm chart:
apps:
[ ... ]
extraEnv:
- name: H2O_WAVE_MAX_REQUEST_SIZE
value: "25MiB"
[ ... ]
This change is not applied to the already existing app instances. It will only be applied to new app instances that are started after the change has been applied.
Change a setting for a specific app
Admin
As an admin, you can change which environment variables can be set by developers
via app.toml
.
To do this, add the required regular expression for matching allowed environment variables to
the config.allowedCoreEnvRegexs
section in the App Store helm chart. This is what the default
config looks like:
config:
[ ... ]
allowedCoreEnvRegexs:
- "^H2O_WAVE_ML_.*"
- "^H2O_WAVE_PUBLIC_DIR$"
- "^H2O_WAVE_PRIVATE_DIR$"
- "^H2O_WAVE_NO_STORE$"
- "^H2O_WAVE_MAX_REQUEST_SIZE$"
- "^H2O_WAVE_SESSION_INACTIVITY_TIMEOUT$"
- "^H2O_WAVE_DATA_DIR$"
- "^H2O_WAVE_PING_INTERVAL$"
[ ... ]
This change is not applied to the already existing apps. It will only be applied to new apps that are imported after the change has been applied.
App developer
App developers can configure the allowed environment variables via the Env
section of
the app.toml
file.
For example, the maximum size of HTTP requests can be changed by specifying the value
of the H2O_WAVE_MAX_REQUEST_SIZE
variable as shown below.
[ ... ]
[[Env]]
Name = "H2O_WAVE_MAX_REQUEST_SIZE"
Value = "20M"
Use a custom container image for an app
As an admin, you can set a custom container image per app version using the h2o app set-image <appID> <image>
command.
To do this, add the required container image regex for matching allowed environment variables to
the config.allowedCustomImageRegexes
section in the App Store helm chart.
config:
[ ... ]
allowedCustomImageRegexes:
- "^docker.io\/h2oai\/model-manager:.*$"
[ ... ]
You can use ".+"
to allow all custom image regexes.
The container must set the location of the app code with the H2O_CLOUD_APP_ROOT
environment variable and the location of the python venv
with the H2O_CLOUD_VENV_PATH
environment variable. If the venv is created by python -m venv /myapp/venv
, then use H2O_CLOUD_VENV_PATH=/myapp/venv
.
- Submit and view feedback for this page
- Send feedback about AI App Store to cloud-feedback@h2o.ai