All Products
Search
Document Center

Platform For AI:FAQ about custom processors

Last Updated:May 17, 2024

This topic provides answers to frequently answered questions about custom processors.

How can I improve the upload efficiency if the package of the custom processor is larger than expected?

In Elastic Algorithm Service (EAS), we recommend that you use Docker images to upload runtime environments and large files. If the business code is modified, you only need to incrementally update the modified part, which significantly improves the development efficiency. For more information, see Develop custom processors by using Python.

How can I solve the problem that libSM.so.6: cannot open shared object file: No such file or directory is reported upon cv2 import?

The common pip install opencv method depends on the libXext, libSM, and libXrender libraries. The libXext, libSM, and libXrender libraries are not pre-installed in the online EAS environment. Therefore, the cv2 that is installed by using this command may run normally in the offline testing environment but may fail to run in the online environment. You can solve this problem by using one of the following methods:

  • Run the pip install openv-python-headless command to install cv2. This method does not depend on libXext, libSM, and libXrender libraries.

  • Search for the ISO files of the libXext, libSM, and libXrender binary libraries that are installed in the system, copy them to the ENV/lib directory, and then upload them together with the processor. This method may involve other dependencies, which you can handle as needed.

How can I configure environment variables in the Python processor of EAS?

The Python processor of EAS automatically adds all directories in the processor directory to the LD_LIBRARY_PATH environment variable. Therefore, you can store the additional dependencies anywhere in the processor directory. We recommend that you run the os.environ['key'] = 'val' command in the Python program to configure other environment variables.

How does the EAS processor prevent a process from exiting due to a code exception?

In the code development process, the try-catch mechanism is added to detect exceptions, which ensures that processes do not exit due to exceptions. If a process exits due to specific reasons, EAS can automatically restart this process to ensure service continuity.

How can I configure the AccessKey pair and endpoint?

You must provide your AccessKey ID and AccessKey secret to complete identity authentication when you deploy a model. By default, the endpoint of the China (Shanghai) region is used. To deploy the model in another region, you can use the -e parameter to specify the endpoint of the corresponding region.

./eascmd64 config -i <yourAccessKey ID> -k <yourAccessKey Secret> -e pai-eas.cn-beijing.aliyuncs.com

Why does the task remain in the [OK] Waiting [Total: 1, Pending: 1, Running: 0] state when I use EASCMD to create a task?

The resources required for task creation may be insufficient or cannot be found. You must check whether the resource region and name are correctly configured, and then determine whether the available resources are sufficient. You can view related configurations in the following EAS description file:

{
  "name": "service",
  "token": "[Authorization-token]",
  "data_image":"[your-public-docker-image-repo]",
  "processor_entry": "app.py",
  "processor_type": "python",
  "processor_path": "[oss://eas-model-shenzhen/xxxxxxxxx/codes.tar.gz]",
  "metadata": {
    "region": "cn-shenzhen", # Ensure that the region of the resource group is correct. 
    "resource": "resource-name", # Ensure that the resource group name, such as EAS-LsFlrwBP56, is correct and that the resource group belongs to the specified region. 
    "gpu": 1,
    "cpu": 6,
    "memory": 2000,
    "instance": 2, # The amount of resources occupied by each instance (gpu=1, cpu=6, memory=2000B). 
                # If the available resources are insufficient, the task remains in the waiting state. 
    "cuda": "10.0"
  }
}

What do I do if I cannot access the Internet over an EAS service?

You can configure Internet access for the service. By default, EAS services cannot access the Internet. If you use a custom processor to deploy a service and you configure related files to be downloaded over the Internet in your code, the service cannot be deployed because the files cannot be loaded. For more information about how to configure Internet access for an EAS service, see Configure Internet access and a whitelist.