Skip to main content

Apps with a managed instance lifecycle

By default, users of the App Store are encouraged via the UI to create and run their own instance of an app, but can also share instances and see instances from other users with a few button clicks.

However, as an app owner, you have the ability to add a restriction that only allows the app owner (you) or adminstrators to create a new instance of this specific app. This is called an 'app with managed instance lifecycle' (while the default behavior is called on 'demand instance lifecycle').

Users are directed to visit a particular (your) instance of the app in the UI instead of being given the option to create their own. This is ideal for apps that either have no state or are explicitly built to be multi-user.

This feature allows for an easier user experience, as users don't have to always wait to start their own instance. Additionally, it saves costs by sharing resources when appropriate.

  1. All apps that are published on the H2O AI Cloud App Store require an app.toml file, which tells the App Store how the app works and how to display it to end users.

  2. The [App] section of the app.toml file has a parameter called InstanceLifecycle. This is an optional parameter and by default the value will be ON_DEMAND, which means every user creates/runs their own instance. Change this value to MANAGED.

  3. Next, use the UI or CLI to upload the app.

    h2o bundle import -v ALL_USERS

    When the owner visits the app in the App Store, they will have the option to run the app. Other users who have permission to see the app will be able to see the app details, but will not be able to create a new instance of the app. Below, we see that Michelle is the owner of the app and Doug is visiting the app details page.

    App owner view managed-instance-app-owner-view

    App visitor view managed-instance-app-visitor-view

  4. As the app owner, you can run the app using the UI or you can use the following CLI command.

    h2o app run <APP_ID> -v ALL_USERS

    Once at least one version of the app exists, all FULL_ACCESS users and visitors that are able to see the app will have a Visit button that will open up the newest app instance.

    managed-instance-app-running-app.


Feedback