umihico / docker-selenium-lambda

The simplest demo of chrome automation by python and selenium in AWS Lambda
MIT License
493 stars 118 forks source link

Test event timeout #215

Closed CyberSosig closed 5 months ago

CyberSosig commented 5 months ago

New to docker and lambda so sorry if this is a non-issue but I am really struggling to get the test to work.

Built the images without using serverless - modified the docker file and replaced its contents accordingly.

uploaded ECR and deployed to a lambda function

Run the test event with blank json event {}

Function times out without out returning contents of example.com

Increase time out to 60 seconds and still it times out

umihico commented 5 months ago

It's difficult to answer.

Please try to make changes one by one, step by step. For example you can create lambda functions without serverless but you still can use generated image by serverless for the functions. At some point you'll see errors and you can tell us what change occurred it.

CyberSosig commented 5 months ago

So I did it the serverless way and it works as expected. I didn't want to have to install nodeJS and npm on my work machine but alas I caved in and it was worth it.

Thank you so much for building this demo I have learnt a lot from playing around with it.

So theoretically now that it works, one could just modify main.py to take screenshots of pages and deploy in the same way ?

umihico commented 5 months ago

I didn't want to have to install nodeJS and npm on my work machine

I understand. You can try anyenv or docker( docker can be difficult this time because "docker in docker" happens) instead of installing directly. Serverless is useful, so I hope you can find your own way.

one could just modify main.py to take screenshots of pages and deploy in the same way ?

Sounds good to me. If you have trouble after some modification, smaller modification make the troubleshoot easier.