Skip to main content

App Configuration

Wave Server Configuration

The H2O App Store allows users to 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 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$

How to change a setting for all apps?

As an admin, to 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 that, add the required environment variable to the apps section in the App Store helm chart:

appstore.yaml
apps:
[ ... ]
extraEnv:
- name: H2O_WAVE_MAX_REQUEST_SIZE
value: "25MiB"
[ ... ]
note

This change is not applied to the already existing app instances. It will only be applied to new app instances started after the change has been applied.

How to change a setting for a specific app?

Admin

An admin can change which environment variables can be set by developers via app.toml.

To do that, 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:

appstore.yaml
config:
[ ... ]
allowedCoreEnvRegexs:
- "^H2O_WAVE_ML_.*"
- "^H2O_WAVE_PUBLIC_DIR$"
- "^H2O_WAVE_PRIVATE_DIR$"
- "^H2O_WAVE_NO_STORE$"
- "^H2O_WAVE_MAX_REQUEST_SIZE$"
[ ... ]
note

This change is not applied to the already existing apps. It will only be applied to new apps 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 H2O_WAVE_MAX_REQUEST_SIZE variable as shown below.

app.toml
[ ... ]
[[Env]]
Name = "H2O_WAVE_MAX_REQUEST_SIZE"
Value = "20M"