All Products
Search
Document Center

Batch Compute:Use App

Last Updated:Feb 20, 2024

The App is a new function released for Batch Compute. It allows you to encapsulate third-party software into an App for other users. App is a template used for resource allocation in Batch Compute, including image descriptions to be used, instance type, the number of VMs, and so on.

This article describes command line tools for Batch Compute, how to support operations such as adding, deleting, modifying, and querying an App, and how to submit an App job.

Add, delete, modify, and query an App

1. View an App

Obtain an App list

bcs a

Obtain an App parameter

bcs a :cromwell  # View details
bcs a 1          # Use the serial number to view details.

View App details

Only details about private (self-created) Apps can be viewed. The details include information about running command lines and images used by the software.

bcs a my-app 0  # View details about the 0th version

2. Create a private App

Run the create_app|ca command to create a private App.

Command:

bcs create_app|ca <app_name> <cmd> [option]

You can add -h to view the help for bcs ca -h.

Following is the simplest method for creating an App

bcs ca my_app "echo 123" -i img-ubuntu

You can directly use an App description file to submit it:

Firstly, prepare an App description file: ./myapp.json.

{
    "Name": "myapp",
    "EnvVars": {},
    "Description": "", 
    "CommandLine": "echo 123",
    "OutputParameters": {}, 
    "VM": {
        "ECSImageId": "img-ubuntu"
    },
    "Daemonize": false, 
    "InputParameters": {}, 
    "Config": {
        "InstanceCount": {
            "Default": 1, 
            "Description": "", 
            "Overwritable": true
        }, 
        "ResourceType": {
            "Default": "OnDemand", 
            "Description": "", 
            "Overwritable": true
        }, 
        "DiskType": {
            "Default": "ephemeral", 
            "Description": "", 
            "Overwritable": true
        }, 
        "MaxRetryCount": {
            "Default": 0, 
            "Description": "", 
            "Overwritable": true
        }, 
        "Timeout": {
            "Default": 86400, 
            "Description": "", 
            "Overwritable": true
        }, 
        "MinDiskSize": {
            "Default": 40, 
            "Description": "", 
            "Overwritable": true
        }, 
        "InstanceType": {
            "Default": "", 
            "Description": "", 
            "Overwritable": true
        }
    }
}

Then, run the following command to submit it:

bcs ca --file myapp.json

You can specify an option to overwrite the configurations in app.json:

bcs ca --file myapp.json -t ecs.s3.large

3. Modify or delete an App

Use the following command to modify and delete an app respectively.

bcs ua -h         # Modify description of a custom App.
bcs da -h         # Delete description of a custom App.

Use -h to see Help.

Submit an App job

Currently only AutoCluster jobs are supported.

Use the asub command to quickly use the App to submit a job.

bcs asub <app_name> -h  # View parameters of a specified App submission job. The parameters are different for each App.

For example: bcs asub cromwell -h

  • Options started with-input are used to specify input parameters for an App. You can also change it to start with-input-from-file. If the parameter value is a correct local file path, the file is automatically uploaded to the default OSS path.

  • Options started with-output_ are used to specify output parameters for an App.