Task
The Container runtime supports four task actions: job
, serve
, build
, and deploy
. A Task
is created via the run()
method; task parameters are passed through that call and differ by action.
Parameters (Shared)
Name |
Type |
Description |
action |
str |
Task action. One of: job , build , serve , deploy . Required |
node_selector |
list[dict] |
Node selector. |
volumes |
list[dict] |
List of volumes. |
resources |
dict |
Resource limits/requests. Example: {"limits": {"cpu": "1", "memory": "512Mi"}, "requests": {"cpu": "250m", "memory": "128Mi"}} . |
affinity |
dict |
Affinity configuration. |
tolerations |
list[dict] |
Tolerations. |
envs |
list[dict] |
Environment variables. Example: [{"name": "FOO", "value": "bar"}] . |
secrets |
list[str] |
List of secret names. |
profile |
str |
Profile template. |
Action-Specific Parameters
Job
Serve
Name |
Type |
Description |
replicas |
int |
Number of replicas. |
service_ports |
list[dict] |
Ports to expose for the service. Example: [{"port": 80, "targetPort": 8080}] . |
service_type |
str |
Service type. |
run_as_user |
int |
User ID to run the container. |
run_as_group |
int |
Group ID to run the container. |
Build
Name |
Type |
Description |
instructions |
list[str] |
Build instructions executed as RUN lines in the generated Dockerfile. |
base_image |
str |
Base image used when building the execution image. Required for build unless a full image is provided. |
image |
str |
Target image name:tag to build/push. If not provided, a local image name may be generated by the runtime. |
Deploy
Instructions
Instructions are executed as RUN
instructions in the generated Dockerfile. Example:
instructions = ["apt-get install -y git"]
Task Actions
Supported actions: