DRApps is a simple command line interface (CLI) providing the tools required to host a custom application, such as a Streamlit app, in DataRobot using a DataRobot execution environment. This allows you to run apps without building your own Docker image. Custom applications don't provide any storage; however, you can access the full DataRobot API and other services. Alternatively, you can upload an AI App (Classic) or a custom application (NextGen) in a Docker container.
Paused custom applications
Custom applications are paused after a period of inactivity. The first time you access a paused custom application, a loading screen appears while it restarts.
Creates a new custom application from a Docker image or base environment. If the application is created from a project folder, the custom application image is created or the existing application is updated. For more information, use the drapps create --help command:
More detailed descriptions for each argument are provided in the table below:
Argument
Description
APPLICATION_NAME
Enter the name of your custom application. This name is also used to generate the name of the custom application image, adding the Image suffix.
--token
Enter your API Key, found on the API keys and tools page of your DataRobot account. You can also provide your API Key using the DATAROBOT_API_TOKEN environment variable.
--endpoint
Enter the URL for the DataRobot Public API. The default value is https://app.datarobot.com/api/v2. You can also provide the URL to Public API using the DATAROBOT_ENDPOINT environment variable.
--base-env
Enter the UUID or name of execution environment used as base for your Streamlit app. The execution environment contains the libraries and packages required by your application. You can find list of available environments in the Custom Model Workshop on the Environments page. For a custom Streamlit application, use --base-env '[DataRobot] Python 3.9 Streamlit'.
--path
Enter the path to a folder used to create the custom application. Files from this folder are uploaded to DataRobot and used to create the custom application image. The custom application is started from this image. To use the current working directory, use --path ..
--image
Enter the path to an archive containing an application docker image. You can save your docker image to file with the docker save <image_name> > <file_name>.tar command.
--skip-wait
Enables exiting the script immediately after the application creation request is sent, without waiting until the application setup completes.
Enter the ID or the name of an application for which you want to view the logs.
--token
Enter your API Key, found on the API keys and tools page of your DataRobot account. You can also provide your API Key using the DATAROBOT_API_TOKEN environment variable.
--endpoint
Enter the URL for the DataRobot Public API. The default value is https://app.datarobot.com/api/v2. You can also provide the URL to Public API using the DATAROBOT_ENDPOINT environment variable.
--follow
Enables the script to continue checking for new log records to display as they appear.
Enter your API Key, found on the API keys and tools page of your DataRobot account. You can also provide your API Key using the DATAROBOT_API_TOKEN environment variable.
--endpoint
Enter the URL for the DataRobot Public API. The default value is https://app.datarobot.com/api/v2. You can also provide the URL to Public API using the DATAROBOT_ENDPOINT environment variable.
--id-only
Enables showing only the IDs of the entity. This command can be useful with piping to terminate the command.
Enter a space separated list of IDs or names of the applications to be removed.
--token
Enter your API Key, found on the API keys and tools page of your DataRobot account. You can also provide your API Key using the DATAROBOT_API_TOKEN environment variable.
--endpoint
Enter the URL for the DataRobot Public API. The default value is https://app.datarobot.com/api/v2. You can also provide the URL to Public API using the DATAROBOT_ENDPOINT environment variable.
(Text) Enter your API Key, found on the API keys and tools page of your DataRobot account. You can also provide your API Key using the DATAROBOT_API_TOKEN environment variable.
-E, --endpoint
(Text) Enter the URL for the DataRobot Public API. The default value is https://app.datarobot.com/api/v2. You can also provide the URL to Public API using the DATAROBOT_ENDPOINT environment variable.
--set-external-sharing
(Boolean) Determines whether or not external sharing is enabled for the application.
--add-external-user
(Text) Grants the specified user access to the application.
--remove-external-user
(Text) Revokes the specified user's access to the application.
First, clone the dr-apps repository so you can access example apps. You can then deploy an example Streamlit app using the following command from the root of the dr-apps repository:
Finds the execution environment through the /api/v2/executionEnvironments/ endpoint by the name or UUID you provided, verifying if the environment can be used for the custom application and retrieving the ID of the latest environment version.
Finds or creates the custom application image through the /api/v2/customApplicationImages/ endpoint, named by adding the Image suffix to the provided application name (i.e., CustomApp Image).
Creates a new version of a custom application image through the customApplicationImages/<appImageId>/versions endpoint, uploading all files from the directory you provided and setting the execution environment version defined in the first step.
Starts a new application with the custom application image version created in the previous step.
When this script runs successfully, a link to the app on the Applications tab appears in the terminal.
Application access
To access the application, you must be logged into the DataRobot instance and account associated with the application.
Consider the following when creating a custom app:
The root directory of the custom application must contain a start-app.sh file, used as the entry point for starting your application server.
The web server of the application must listen on port 8080.
The required packages can be listed in a requirements.txt file in the application's root directory for automatic installation during application setup.
The application should authenticate with the DataRobot API through the DATAROBOT_API_TOKEN environment variable using a key found in the DataRobot API keys and tools. The DataRobot package on PyPI already authenticates this way. This environment variable is added automatically to your running container by the custom apps service.
The application should access the DataRobot Public API URL for the current environment through the DATAROBOT_ENDPOINT environment variable. The DataRobot package on PyPI already uses this route. This environment variable is added automatically to your running container by the custom apps service.