This topic provides answers to frequently asked questions about custom processors.
-
How can I improve the upload efficiency of a custom processor package?
-
How do I configure environment variables in an EAS Python processor?
-
How can I prevent a process from exiting due to an exception in the EAS processor code?
-
What do I do if an EAS service fails to access the public network?
How can I improve the upload efficiency of a custom processor package?
EAS recommends that you use Docker images to upload runtime environments and large files. When your code changes, you can incrementally update only the modified parts. This greatly improves development efficiency. For more information, see Develop custom processors using Python.
How do I resolve the "libSM.so.6: cannot open shared object file: No such file or directory" error when I import cv2?
The common pip install opencv method depends on the libXext, libSM, and libXrender libraries. Because these libraries are not pre-installed in the online EAS environment, cv2 installed using this command might run correctly in an offline testing environment but fail in the online environment. You can resolve this error in one of the following ways:
-
Install cv2 by running the
pip install opencv-python-headlesscommand. This method does not depend on the libXext, libSM, or libXrender libraries. -
Find the binary files for the installed libXext, libSM, and libXrender libraries in your system. Then, copy them to the ENV/lib directory and upload them with the processor. (This method might introduce other dependency issues that you must also resolve.)
How do I configure environment variables in an EAS Python processor?
The EAS Python processor automatically adds all subdirectories of the processor directory to the LD_LIBRARY_PATH environment variable. You can store additional dependency libraries anywhere in the processor directory. For other environment variables, you can configure them in your Python program using os.environ['key'] = 'val'.
How can I prevent a process from exiting due to an exception in the EAS processor code?
When developing your service logic, add exception handling (try-catch) to critical parts of your code. This prevents the process from terminating due to unhandled exceptions. If a process exits for any reason, EAS automatically restarts it to ensure service stability.
How do I configure an AccessKey and an Endpoint?
Prediction services use an Alibaba Cloud AccessKey for identity authentication. When you submit a task, you must provide an AccessKey ID and AccessKey secret. The default Endpoint is for the China (Shanghai) region. To deploy the model to another region, you can use the -e parameter to specify the Endpoint for that region. For example:
./eascmd64 config -i <yourAccessKey ID> -k <yourAccessKey Secret> -e pai-eas.cn-beijing.aliyuncs.com
Why does a task that I created using EASCMD remain in the [OK] Waiting [Total: 1, Pending: 1, Running: 0] state?
This may be because the resources required to create the task are insufficient or unavailable. First, confirm that the configured resource region and name are correct. Then, confirm that enough resources are available. The following EAS service configuration file shows the relevant configuration.
{
"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", # Make sure that the region of the resource group is correct.
"resource": "resource-name", # Make sure that the resource group name, such as EAS-LsFlrwBP56, is correct and corresponds to the region.
"gpu": 1,
"cpu": 6,
"memory": 2000,
"instance": 2, # The resources occupied by each instance (gpu=1, cpu=6, memory=2000 B).
# If the available resources are insufficient, the task remains in the waiting state.
"cuda": "10.0"
}
}
What do I do if an EAS service fails to access the public network?
If your code is configured to download files from the public network, the deployment of an EAS service that uses a custom processor may fail due to a file loading error. This is because EAS services cannot access the public network by default. To resolve this issue, you can configure a public network connection for the EAS service.
What do I do if the "Download processor files failed: forbidden to download file with size larger than 10G" error occurs during deployment with a custom processor?
When you deploy a service using a custom processor, the system limits the combined size of the model and processor package to 10 GB. If this limit is exceeded, you can use an image-based custom deployment in the console instead.