Skip to main content

Running Your Image

The key difference when compared to predefined applications is the use of the custom keyword when creating a custom resource. The command to do this is as follows:

cgc compute create custom -n my-app -g 1 -gt A100 -c 8 -m 24 -v my-vol -fp /workspace/my-app --image repository/my-image:tag

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 /workspace/my-vol as required by Jupyter Lab.

If you want to check all mount paths currently used in your applications, you can use the following command:

cgc compute list-mounts

Extra flags to consider during the creation of a custom application:

  • --repository-secret - name of the secret used to pull the image from a private repository
  • --node-port-enabled - enable NodePort service for the compute resource in the CGC OnPremise instances (available from client version 1.0.14)
  • -d, --resource-data - additional data to be included in the environments (list of whitelisted keys as of CGC 1.0.13: ['llama_model_path', 'rag_cache_path', 'postgre_host', 'postgre_password', 'postgre_name', 'app_token', 'label_studio_username', 'weaviate_transformers_inference_api', 'weaviate_enable_modules', 'custom_image', 'image_pull_secret_name', 'custom_command', 'node_port_enabled'])
    • most of those whitelisted keys are entity specific and are used to configure the entity environment
    • for the custom entity / jobs, you can use the following keys:
    • custom_image - the name of the custom image
    • image_pull_secret_name - the name of the secret used to pull the image from a private repository
    • custom_command - the command to be executed in the container
    • node_port_enabled - enable NodePort service for the compute resource in the CGC OnPremise instances

Startup command​

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

"echo;" | cgc compute create custom -n test --image ubuntu

Or you can use a file:

cat ./command.bash | cgc compute 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​

Our platform allows you to create and manage your own secrets, which enable you to pull images from private repositories. To configure access, you must first create a registry secret and then reference it when launching your custom compute instance:

  1. Create a registry secret Create a secret within your namespace using the CGC CLI. This secret will store your registry credentials securely and can be reused for future image pulls.
cgc secret create -r <registry_url> -u <username> -p <password> <secret_name>

The secret will be stored in your namespace and can be reused.

  1. Start a Custom instance with the secret Once the secret is created, use it to launch a custom instance:
cgc compute create custom -n <name> -c <CPU> -m <RAM> --image <registry_url>/<namespace>/<image_name>:<TAG> --repository-secret <secret_name>

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 compute delete my-app
# or
cgc rm my-app

Billing​

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

caution

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