Run settings reference
When running apps or deployments by API, AI Hub supports runtime configs and webhooks. You can also specify a file path to a connected drive to act as your run’s input or output location.
Runtime configs
You can use the runtime_config
setting to specify key-value pairs to pass into the run at runtime. These values are propagated to downstream processes and can be referenced in validation functions.
For example, if your validation function’s behavior varies based on time of year, you might use runtime_config
to pass in the current date:
Webhook parameters
You can use the webhook_config
setting to ensure your application is notified when a run completes. AI Hub POSTs JSON-encoded data of the format below to the webhook endpoint:
The response body contains the following fields:
-
status
:"OK"
|"ERROR"
-
msg
: (optional) Error message. Present only if status is ERROR. -
job_id
: A unique identifier for the run. -
input_dir
: Input directory. -
output
: The full path to the root output folder.
To acknowledge receipt of the event, your endpoint must return a 2xx HTTP status code. All response codes outside this range, including 3xx codes, indicate to AI Hub that you did not receive the event.
If AI Hub does not receive a 2xx HTTP status code, the notification attempt is repeated up to 7 times.
Specifying file paths
When running an app using the v2/apps/runs
endpoint, there are two methods to specify the app’s input:
-
Batch: Create a batch using the Batches endpoint, upload files from your local filesystem, then use the
batch_id
parameter to specify the batch. All files in the batch are processed. -
Connected drive: Use the
input_dir
parameter to specify a file path to an input folder in a connected drive. All files in the input folder are processed.
When specifying a file path in a connected drive, the format varies if you have a community or organization account.
-
Community account:
/<USER-ID>/my-repo/fs/<DRIVE-NAME>/<FOLDER>/
-
Organization account:
/<ORGANIZATION-ID>/<WORKSPACE>/fs/<DRIVE-NAME>/<FOLDER>/