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​

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 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.