📘

Note

While using TrueFoundry python SDK type is not a required field in any of the imported classes

Job

Description

Describes the configuration for the job

Schema

{
  "type": "string",
  "name": "string",
  "image": {},
  "trigger": {
    "type": "manual"
  },
  "params": [
    {
      "name": "string",
      "description": "string",
      "default": "string",
      "param_type": "string"
    }
  ],
  "env": null,
  "resources": {
    "cpu_request": 0.2,
    "cpu_limit": 0.5,
    "memory_request": 200,
    "memory_limit": 500,
    "ephemeral_storage_request": 1000,
    "ephemeral_storage_limit": 2000,
    "gpu_count": 0,
    "shared_memory_size": 64,
    "node": {}
  },
  "retries": 0,
  "timeout": 0,
  "concurrency_limit": 0,
  "service_account": "string",
  "mounts": [
    {}
  ],
  "labels": {
    "property1": "string",
    "property2": "string"
  }
}

Properties

NameTypeRequiredDescription
typestringtrue+value=job
namestringtrueName of the job
imageobjecttrueSpecify whether you want to deploy a Docker image or build and deploy from source code
triggerobjecttrueSpecify the trigger
params[Param]falseConfigure params and pass it to create different job runs
envobject¦nullfalseConfigure environment variables to be injected in the service. Docs
resourcesResourcesfalseDescribes the resource constraints for the application so that it can be deployed accordingly on the cluster
To learn more you can go here
retriesintegertrueSpecify the maximum number of attempts to retry a job before it is marked as failed.
timeoutintegerfalseJob timeout in seconds.
concurrency_limitintegerfalseNumber of runs that can run concurrently
service_accountstringfalseService account that this workload should use
mounts[object]falseConfigure data to be mounted to job pod(s)
labelsobjectfalseAdd labels to service metadata

Examples


Triggers

The modules below help configure the Triggers for the Job

Manual

Description

Describes that we are going to manually trigger our job.

Schema

{
  "type": "string"
}

Properties

NameTypeRequiredDescription
typestringtrue+value=manual

Schedule

Description

Describes that we are going to schedule our job to run at a schedule, making our job a cron job.

Schema

{
  "type": "string",
  "schedule": "string",
  "concurrency_policy": "Forbid",
  "timezone": "string"
}

Properties

NameTypeRequiredDescription
typestringtrue+value=scheduled
schedulestringtrueSpecify the schedule for this job to be run periodically in cron format. Learn more
concurrency_policystringtrueChoose whether to allow this job to run while another instance of the job is running, or to replace the currently running instance. Allow
will enable multiple instances of this job to run. Forbid will keep the current instance of the job running and stop a new instance from being run.
Replace will terminate any currently running instance of the job and start a new one.
timezonestringfalseTimezone against which the cron schedule will be calculated, e.g. "Asia/Tokyo". Default is machine's local time.
https://docs.truefoundry.com/docs/list-of-supported-timezones

Enumerate Values

PropertyValue
concurrency_policyForbid
concurrency_policyAllow
concurrency_policyReplace

Param

Description

Describes a parameter for configuration

Schema

{
  "name": "string",
  "description": "string",
  "default": "string",
  "param_type": "string"
}

Properties

NameTypeRequiredDescription
namestringtrueName of the param
descriptionstringfalseDescription of param
defaultstringfalseDefault value or placeholder
param_typestringfalsenone

Enumerate Values

PropertyValue
param_typestring
param_typeml_repo