Custom processors FAQ
This page answers common questions about deploying and running custom processors on Elastic Algorithm Service (EAS).
Deployment issues
How can I improve the upload efficiency of a custom processor package?
Error: "Download processor files failed: forbidden to download file with size larger than 10G"
Runtime issues
How do I configure environment variables in an EAS Python processor?
How do I prevent a process from exiting due to an unhandled exception?
What do I do if an EAS service cannot access the public network?
Authentication and configuration
How can I improve the upload efficiency of a custom processor package?
Use Docker images to package your runtime environment and large files. When your code changes, only the modified layers need to be rebuilt and pushed, not the entire package. This significantly speeds up iteration during development.
For details, 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 importing cv2?
The standard pip install opencv package depends on libXext, libSM, and libXrender, which are not pre-installed in the EAS runtime environment. The package may work in a local testing environment but fail when deployed online.
Fix this using one of the following approaches:
Recommended: Install
opencv-python-headlessinstead. This variant does not depend on libXext, libSM, or libXrender.pip install opencv-python-headlessAlternative: Locate the binary files for libXext, libSM, and libXrender on your local system, copy them to the
ENV/libdirectory inside your processor package, and upload the package.Note: This approach may introduce additional dependency issues that you will need to resolve separately.
How do I configure environment variables in an EAS Python processor?
EAS automatically adds all subdirectories of the processor directory to LD_LIBRARY_PATH, so dependency libraries stored anywhere in the processor directory are picked up automatically.
For other environment variables, set them programmatically in your Python code:
import os
os.environ['key'] = 'val'How do I prevent a process from exiting due to an unhandled exception?
Wrap the critical sections of your service logic in try-catch blocks to prevent unhandled exceptions from terminating the process.
If the process exits for any reason, EAS automatically restarts it to maintain service availability. Exception handling at the application level gives you finer control and avoids unnecessary restarts.
How do I configure an AccessKey and an endpoint?
EAS prediction services use an Alibaba Cloud AccessKey for identity authentication. Configure your AccessKey ID, AccessKey Secret, and endpoint using the eascmd64 config command:
./eascmd64 config -i <yourAccessKeyID> -k <yourAccessKeySecret> -e <endpoint>The default endpoint connects to the China (Shanghai) region. To deploy to a different region, specify that region's endpoint with the -e parameter. For example, to use the China (Beijing) region:
./eascmd64 config -i <yourAccessKeyID> -k <yourAccessKeySecret> -e pai-eas.cn-beijing.aliyuncs.comWhy does a task created with EASCMD stay in the "[OK] Waiting [Total: 1, Pending: 1, Running: 0]" state?
The task is waiting because the resource group does not have enough available resources to start the requested instances.
Check the following in your service configuration file:
Region: Confirm that
metadata.regionmatches the region where your resource group is located.Resource group name: Confirm that
metadata.resourceis the correct resource group name for that region (for example,EAS-LsFlrwBP56).Available resources: Confirm that the resource group has enough free GPU, CPU, and memory to satisfy the
instancecount you configured.
The following example configuration shows the relevant fields:
{
"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",
"resource": "resource-name",
"gpu": 1,
"cpu": 6,
"memory": 2000,
"instance": 2,
"cuda": "10.0"
}
}In this example, each instance requires 1 GPU, 6 CPUs, and 2000 B of memory. If the resource group cannot satisfy this for 2 instances simultaneously, the task stays in the waiting state.
What do I do if an EAS service cannot access the public network?
EAS services cannot access the public network by default. If your processor code downloads files from the internet at startup, the deployment will fail with a file loading error.
To fix this, configure a public network connection for your EAS service.
Tip: Before deploying, test your processor locally to confirm it does not rely on public network access that may be unavailable in the EAS environment.
Error: "Download processor files failed: forbidden to download file with size larger than 10G"
EAS limits the combined size of the model and processor package to 10 GB. If your package exceeds this limit, use image-based custom deployment through the console instead.