Skip to main content

Running your job with CGC CLI

How to create a one-off job from a custom Docker image with cgc job create, including TTL, startup command, private repository and extra parameters.

Job creation with a custom image. The command to do this is as follows:

cgc job create -n my-app -g 1 -gt NVIDIA-A100-SXM4-80GB -c 8 -m 24 -v my-vol -fp /tmp/data --image repository/my-image:tag

Job creation with a custom image, when logs are not important:

cgc job create -n my-app -g 1 -gt NVIDIA-A100-SXM4-80GB -c 8 -m 24 -v my-vol -fp /tmp/data --image repository/my-image:tag --ttl 3600

All flags remain the same with the exception of:

  • -i, --image - repository/my-image:tag. Note that if you're pulling from a public repository, the dockerhub doesn't require the repository name.

Please be careful with the full mount path -fp. By default, CGC will mount to /usr/my-vol.

Startup command

STDIN is accepted as a startup command. You can use the following command to pass your command to the container:

echo "echo;" | cgc job create -n test --image ubuntu

Or you can use a file:

cat ./command.bash | cgc job create -n test --image ubuntu

In the example above command.bash is a file with your command.

Example content of the command.bash file:

echo "Hello World";
echo "Hello World";

Using a Private Repository

If you need to pull an image from a private repository, create a registry secret in your namespace first:

cgc secret create -r <registry_url> -u <username> -p <password> <secret_name>

Once the secret exists in your namespace, you can include it in your create command by simply passing its name under the --repository-secret <NAME> flag.

Deleting Your Custom App

Applications based on custom images are treated the same as built-in CGC applications. To delete your app, simply use the following command:

cgc job delete my-app

Billing

Jobs are billed in the same way as all other applications.

caution

Images larger than 20GB will not start: the image is unpacked on the node's ephemeral storage, which is limited per app. Please contact us at support@comtegra.pl if your image is larger than that, so that we can increase your default quota.

Extra parameters

  • --ttl - Time to live in seconds after the job is finished
  • --ads - Time to live in seconds after the job is started
  • --shm - Size of shared memory in Gi (0-1024)
  • -cm, --config-map - optional arguments passed to the job as a config map, key=value format