Usage Example

Restrictions

The MindCluster service needs to be deployed and the job rescheduling capability (enabled by default in the deployment script) needs to be started. The reconfiguration is classified into two types: with redundant nodes and without redundant nodes.

Procedure

  1. Enable the job rescheduling function.

    This function is configured in the deployment/server_init.yaml file. The key configuration parameters are as follows in bold:

    • fault-scheduling: The value is force, indicating that the job rescheduling function is enabled.
    • fault-retry-times: indicates the number of rescheduling times. The value range is [7200, 10000].
    • restartPolicy: The value is Never.
    ...
    # Define PriorityClass.
    apiVersion: scheduling.k8s.io/v1
    kind: PriorityClass
    metadata:
      name: high-priority
    value: 100
    globalDefault: false
    description: "D used for high-priority jobs and P for low-priority jobs"
    ---
    apiVersion: mindxdl.gitee.com/v1
    kind: AscendJob
    metadata:
      name: xxxx-server-0        # The value varies according to the job. The default value is mindie-ms.
      namespace: mindie            # MindIE is used as an example. You can change the value as required.
      annotations:
        sp-block: "384"
      labels:
        framework: pytorch
        app: mindie-ms-server      # Fixed
        jobID: xxxx               # Name of the inference job, which is user-defined. The default value is mindie-ms.
        ring-controller.atlas: ascend-910b
        fault-scheduling: force
        fault-retry-times: "10000"
        grt-group/deploy-server: 1
    spec:
      schedulerName: volcano   
      runPolicy:
        schedulingPolicy:      
          minAvailable: x      # The value must be the same as that of replicas.
          queue: default
          priorityClass: high-priority
      successPolicy: AllWorkers
      replicaSpecs:
        Master:
          replicas: 1           # Number of server replicas
          restartPolicy: Never
          template:
            metadata:
              labels:
                ring-controller.atlas: ascend-910b
                app: mindie-ms-server
                jobID: xxxx      # Name of the inference job, which is user-defined. The default value is mindie.
    ...

  2. Open the ms_controller.json configuration file and set the port number for connecting to the MindCluster. The default value is 8899.

    {
      "allow_all_zero_ip_listening": false,
      "deploy_mode": "pd_separate",
      "initial_dist_server_port": 10000,
      "cluster_port":8899,
    ...
    }

  3. Go to the /{MindIE installation directory}/latest/mindie-service directory and run the following command to start the service. When a fault occurs, the function of reconfiguration upon a fault is automatically triggered.

    ./bin/mindieservice_daemon