How to create a job
To run a container image as a batch workload for training, fine-tuning or data processing, create a job.- CLI
To create a job, run the following command:
In the command, specify the following parameters:
Job creation example
Job creation example
-
Job settings:
--name: Application (job) name.--image: Container image inimage:tagformat. Use a public registry or provide--registry-usernameand--registry-passwordfor private registries.--registry-username(optional): Username for private container registry.--registry-password(optional): Password for private container registry.--container-command(optional): Entrypoint command for the job container.--args(optional): Override container arguments passed to the entrypoint.--env(optional): Environment variables inkey=valueformat. Repeat for multiple variables.--working-dir(optional): Working directory (absolute path).--timeout(optional): Job timeout (e.g.,2h30m10s,24h). Minimum:1h, maximum:168h. Default:24h.
-
Computing resources:
--platform(optional): Platform of compute resources (e.g.,gpu-h100-sxm,gpu-l40s-d). Default:gpu-h100-sxmineu-north1,gpu-h200-sxmelsewhere. See Types of virtual machines and GPUs.--preset(optional): Preset for the platform (e.g.,1gpu-16vcpu-200gb). Default: minimum available preset. See Presets for GPU platforms.
-
Storage:
-
--disk-size(optional): Disk size (e.g.,100Gi,500Gi,1Ti). Default:250Gi. See how disk performance depends on disk size. -
--volume(optional): Volume mount insource:container_pathorsource:container_path:modeformat. Repeat for multiple volumes. For example:Use for job results and checkpoints. Volumes persist if the job is recreated after a maintenance event. -
--shm-size(optional): Size of/dev/shm(e.g.,64Mi,128Mi,1Gi). Default:16Gi.
-
-
Access:
--ssh-key(optional): Comma-separated list of SSH keys to access the container over VM by SSH. When you add an SSH key, a public dynamic IP address is assigned to the job. Before you add the key, check the quota on the number of public IP addresses in the web console.
-
Other parameters:
--parent-id(optional): Project ID. If omitted, taken from the CLI profile.--subnet-id(optional): Subnet ID. Required if the project has multiple subnets.
How to check job logs
To view logs from a running or completed job, run:--followor-f: Stream logs in real time.--since <value>: Show logs starting from the specified time. For example,1h(from 1 hour ago),30m(from 30 minutes ago) or2024-01-01(from that date).--tail <value>: Number of recent lines to show in the output.--timestamps: Include timestamps in the output.--until <value>: Show logs up to the specified time. For example,1h(up to 1 hour ago),30m(up to 30 minutes ago) or2024-01-01(up to that date).
How to cancel a job
If you do not need a job to continue running, you can cancel it. The jobs that finish withCOMPLETED status are canceled automatically.
- CLI
-
List jobs:
In the output, copy the ID of the required job.
-
To cancel a job, run:
How to delete a job
If you want to delete a record about the job, use thedelete command.
- CLI
-
List jobs:
In the output, copy the ID of the required job.
-
Delete the job:
delete cancels the job first.If the job uses additional volumes, they are not deleted with it. You can remove the mounted volumes manually. See the guides on deleting a filesystem and deleting a bucket.