I was thinking that I could create a lambda function to create the endpoint, then after the prediction is done, in the same function, clean the data and delete the endpoint, but this doesn’t seem to be possible since the maximum execution time of a lambda function is 15 minutes and the creation of the endpoint takes more than 10 minutes, it may work sometimes but it may not, so I’m looking for a different way, any suggestions?
can you use a batch transform, instead of a real-time endpoint?
you could use lambda to launch the endpoint, then cloudwatch event rules to monitor the invocation of the endpoint, calling the lambda again to ask it to shutdown the endpoint
or use a new serverless endpoint, which will be cheaper to run
In (1) I was told by the data scientist that it’s easier for him to control the pre and post processing using an endpoint, and also that the creation of the instance in batch transform takes as long as creating the endpoint so it wouldn’t make much difference
can you further explain how would (2) work? is there a way to pause the lambda function so as to not consume any more resources? when you launch the endpoint as well, doesn’t it have to wait for it to finish before ending the function? a 10 min lambda function is very expensive
regarding (3) what do you mean exactly by a new serverless endpoint?
I was thinking maybe I can create a ci/cd with SAM and put an API to launch the endpoint from there and then call the lambda function with that endpoint, i don’t know if what I’m saying it’s possible since i’ve never used it but does it seem viable?
is create endpoint blocking? I don’t believe it is. you should be able to call boto3 or whatever to request starting the endpoint, then immediately exit…