Skip to main content

Configuration

A persistent service is configured via the dais.json file placed in the root of its git repository. An example of a dais.json file is shown below:

{
"containers": [
{
"name": "test-model",
"context": "./test-model",
"port": 8080,
"cpuRequest": 1000,
"cpuLimit": 1000,
"memoryRequest": 1000,
"memoryLimit": 2000,
"capabilities": ["externalInternet"]
}
]
}

All dais.json files have an attribute called containers at the root of the object, and this is set to the array of containers to build for a project. Containers can be services, model runners (type: "model"), or UI services (type: "ui").

An example of dais.json file with multiple containers is shown below:

{
"containers": [
{
"name": "model",
"context": "./model",
"type": "model",
"maxModelDuration": 300,
"taskGeneratorContainerName": "taskgen",
"postProcessContainerId": "aggregator"
},
{
"name": "taskgen",
"context": "./task-generator",
"port": 8080
},
{
"name": "aggregator",
"context": "./result-aggregator",
"port": 8080
}
]
}

Container Attributes

The full set of container attributes available to a user is shown below:

name

The name of the service. Will also be the service's hostname for cross-service communication.

context

The build context for the Docker container relative to the root of the repository.

dockerfile

The path to the Dockerfile the container relative to the build context.

port

The port that the service will be listening on (irrelevant for type: "model").

type

Container type. Supported values:

  • "model" for Docker Model Runner containers.
  • "ui" for UI-serving containers used with customUi.

secretsEnabled

Set to true to mount any secrets provided via container dashboard.

reschedulable

Set to false to prevent Kubernetes from ever moving your containers between nodes while they're running. Please do not change this value without establishing a need and seeking approval from cluster administrators. Note that your container will have to restart from time to time for server maintenance, but setting reschedulable: false should reduce the frequency if it is an issue.

postProcessContainerId

This field is only applicable to containers with type: "model". When model runner completes a task, the service with this name will be notified.

taskGeneratorContainerName

This field is only applicable to containers with type: "model". When creating a submission, model runner will query the service with this name to generate multiple tasks from a single base set of inputs.

maxModelDuration

This field is only applicable to containers with type: "model". Duration after which to forcibly kill model run in seconds.

replicas

Number of replicas of service to deploy.

maxReplicas

If specified and is greater than replicas, it will create a Horizontal Auto Pod Scaling (HPA) for the deployment

scalingResourceType

If an HPA exists, then this will determine what resource metric to monitor (memory, cpu). Default if not specified: cpu

averageUtilization

If an HPA exists, then this will determine the target average utilization for the scalingResourceType. Default if not specified: 20

nodeSelector

If your service has been provisioned a special node pool (for high memory requirements, for example), set this attribute to the node pool name.

cpuRequest

The amount of CPU that will be reserved for the service in mCPU (e.g. 1000 for 1CPU). Only modify this value if you have established a need to. This amount will generally be much lower than the CPU limit because containers mostly sit idle.

cpuLimit

The maximum amount of CPU your container can consume at a given time in mCPU (e.g. 1000 for 1CPU). Only modify this value if you have established a need to.

memoryRequest

The amount of memory that will be reserved for the service in MB (e.g. 1000 for 1GB). This amount will generally be much lower than the memory limit because containers mostly sit idle.

memoryLimit

The maximum amount of memory your container can consume at a given time in MB (e.g. 1000 for 1GB).

capabilities

If your project has been granted escalated networking capabilities (ability to talk to internet from model container), enable it by setting this value to ["externalHTTPS"] or ["externalInternet"] depending on the capability granted.

Custom UI Notes: Subdomains, routesProxy, and Shared Portal Launch

For Custom UI projects, persistent services can be exposed through project subdomains:

  • https://{projectId}.{portal}.{DOMAIN_NAME}/
  • Requests are routed through project-gateway to the appropriate persistent service.

Custom UI service/endpoint can be defined in dais.json using the customUi block. The container must declare "type": "ui". When present and valid, the Admin UI configuration is read-only and the values are sourced from dais.json at build time. See Configure dais.json.

customUi validation rules:

  • customUi can be defined on only one container.
  • The container with customUi must have "type": "ui".
  • A container with "type": "ui" must define customUi.
  • customUi.endpoint is required and must start with /.
  • customUi.csrfHeader is optional, but if provided it must be a non-empty string.

If you need non-service-name paths, define routesProxy in dais.json for the container that should handle those routes.

When launching custom_ui apps from Projects View on a superadmin host, links can be redirected to the shared domain (SHARED_DOMAIN_NAME) and opened in a new tab.