Przejdź do głównej zawartości

Running Your Job

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

cgc job create -n my-app -g 1 -gt A100 -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 A100 -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;" | cgc job create custom -n test --image ubuntu

Or you can use a file:

cat ./command.bash | cgc job create custom -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, you should first contact us to share details about access. Currently, CGC does not provide commands to manage secrets.

Once the secret has been added to 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.

uwaga

Please contact us if your image is larger than 20GB so that we can increase your default quota.

Extra parameters

  • --ttl - Time to live in seconds
  • --ads - Auto delete seconds
  • --shm - Shared memory size