daily log 11.10.19
Here’s how it went:
- Tried to run my python function using lambdas.
- Couldn’t because I cannot contact the internet from PYTHON CODE DUH.
- But maybe, I could hit a node lambda?
- Anyway, I then made a flask app.
- OH WAIT I FORGOT THAT I FIRST TRIED TO DO ALL OF THIS WITH NODE AND SPAWN CHILD PROCESS
- Flask app is great working swell got it to heroku amazing yay
- Want to get it to AWS because I’m a masochist?
- Cannot figure out how to include NLTK downloads to save my life.
- Back to lambdas. And please start back at 1.
POTENTIAL SOLUTIONS:
- JUST GIVE UP ON AWS: nope. Too stubborn and I love how I can automate it (eventually)
- Lambdas… again? Maybe hitting a node lambda??
- Continue tugging on the EC2 virtual machine thread. I will be entering my double digit hours on this thread.
So I started pulling on thread 2:
- Python lambda working!
- Node lambda also working!
- When Python lambda hits node lambda, they work together!
- EXCEPT I CANNOT DO A SINGLE FREAKING HTTP REQUEST
AFTERNOON UPDATE:
- NODE lambda (
sendsHtml
) is correctly “sending” html https://dijvc4fq4e.execute-api.us-west-2.amazonaws.com/default/sendsHtml - PYTHON lambda (
my-function
) is correctly “receiving” html https://61w53gm2s7.execute-api.us-west-2.amazonaws.com/default/my-function
NOTE: BOTH are being uploaded to AWS (e.g. not inside the lambda console) via
zip -g function.zip lambda_function.py
and
aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip
QUESTION:
Why does python code take so long to run on lambdas
INSTALLING NEW PACKAGES FOR LAMBDA:
source v-env/bin/activate
pip install `package`
deactivate
cd v-env/lib/python3.7/site-packages
zip -r9 ${OLDPWD}/function.zip .
cd $OLDPWD
zip -g function.zip lambda_function.py
aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip