Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello,
When using DO Functions, I require to import a Python module and once I do, the Function stops working with an The function exhausted its memory and was aborted. error.
When using doctl, the following message appears: Request accepted, but processing not completed yet. All functions invocation >= 30s will get demoted to an asynchronous invocation.
My example function:
from tronpy import Tron
def main(args):
client = Tron()
wallet = client.generate_address()
return {
"body": {
"wallet": {
"base58check_address": wallet["base58check_address"],
"hex_address": wallet["hex_address"],
"private_key": wallet["private_key"],
"public_key": wallet["public_key"],
},
},
}
This code is valid when run separately in my IDE but doesn’t work when using DO Functions.
I confirm the execution stops at from tronpy import Tron because I also tested this by removing further library function calls.
I also tried this with just the mysql-connector-python library, and it also doesn’t work, so that rules out tronpy failing.
My build.sh file:
#!/bin/bash
# Stop on the first error found
set -e
# Clean build and virtual environment
rm -rf venv
rm -f __deployer__.zip
# Create virtual environment and install dependencies
python3.11 -m venv --without-pip venv
source venv/bin/activate
# --compile --no-cache-dir
pip install "tronpy==0.4.0" --target venv/lib/python3.11/site-packages
deactivate
Notes about my build.sh file:
virtualenv as docs say, the function doesn’t even run with standard library code.-r requirements.txt, but the result is equivalent if I did that.My .include file just in case:
venv
__main__.py
Thanks in advance,
Rory McEwan
Anjanesh Lekshminarayanan
182d09356ab94d3893ddfaca4f0270
Prashant Kumbhat
kprichard
e452769e8f30404d81a3bc803143f4
robert
Eleanor
GamesmenJordan