Hello,
I have a basic Ray code that consumes resources.
My aim is to deploy Python code on AWS with dockerized. When I try to use the docker image on AWS Lambda Function, It not working.
Python code which simple consume resource:
import math
import time
import ray
#ray.init(“anyscale://ray-demo-cluster”, runtime_env={“pip”: “requirements.txt”})
#ray.init(“anyscale://anyscale-demo/kd-cluster-v1”)
@ray.remote
def factorial_func(n):
return math.factorial(n)
def lambda_handler(event, context):
start = time.time()
results = [factorial_func.remote(i*40) for i in range(2000)]
ray.get(results)
finish = time.time()
print(f’Total duration:',finish-start)
lambda_handler(None, None)
Issue:
Why is this happening?
Many thanks for your time.