1645013700
Precompiled packages for AWS lambda
6. Lambda function handler and role
7. Advanced settings
8. Code entry type - Upload a .ZIP file - choose Pack.zip from rep
9. Test -> Save and test
Selenium on PhantomJS. In fact - a ready-made tool for web scraping. For example, the demo now opens a random page in Wikipedia and sends its header. (PhantomJS at the same time disguises itself as a normal browser, knows how to log in, click and fill out forms) Also added requests, so you can do API requests for different resources to discard / take away the information.
Useful for web testing and scraping.
Current demo opens random page from wiki (https://en.wikipedia.org/wiki/Special:Random) and prints title.
git clone https://github.com/ryfeus/lambda-packs.git
cd lambda-packs/Selenium_PhantomJS/source/
serverless deploy
serverless invoke --function main --log
You can also see the results from the API Gateway endpoint in a web browser.
https://selenium-python.readthedocs.io/
What does the lambda have to do with it? In a nutshell on AWS in one region you can simultaneously run 200 lambdas (more if you write to support). Lambda works in 11 regions. So you can run in parallel more than 2000 lambdas, each of which will conduct load testing of your service. Five minutes of such testing will cost just one dollar.
Demo in this package tries to send requests to github.com for 5 seconds with 1 connection and also conduct pyresttest dummy test.
https://github.com/svanoort/pyresttest
Package for parsing static HTML pages. Difference here is that it works faster and consumes less memory than PhantomJS but is limited in terms websites it can parse and other features.
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/Lxml_requests/source -n lxml-requests
cd lxml-requests
serverless deploy
serverless invoke --function main --log
wget https://github.com/ryfeus/lambda-packs/blob/master/Lxml_requests/buildPack.sh
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
Lxml 3.7.1
Open source library for Machine Intelligence. Basically revolutionized AI and made it more accessible. Using tensorflow on lambda is not as bad as it may sound - for some simple models it is the simplest and the cheapest way to deploy.
As hello world code I used recognition of images trained on imagenet (https://www.tensorflow.org/tutorials/image_recognition). Given the price tag lambda one run (recognition of one picture) will cost $0.00005. Therefore for a dollar you can recognize 20,000 images. It is much cheaper than almost any alternatives, though completely scalable (200 functions can be run in parallel), and can be easily integrated into cloud infrastructure. Current demo downloads image from link 'imagelink' from event source ( if empty - then downloads https://s3.amazonaws.com/ryfeuslambda/tensorflow/imagenet/cropped_panda.jpg)
Tensorflow 1.4.0
https://www.tensorflow.org/tutorials/image_recognition
Nightly version archive is more than 50 MB in size but it is still eligible for using with AWS Lambda (though you need to upload pack through S3). For more read here:
https://hackernoon.com/exploring-the-aws-lambda-deployment-limits-9a8384b0bec3
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/tensorflow/source -n tensorflow
cd tensorflow
serverless deploy
serverless invoke --function main --log
for Python2:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
for Python3:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack_py3.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index_py3.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack_py3.sh
Note: Remember You should set
python3.6
for AWS Lambda function environment.
arn:aws:lambda:us-east-1:339543757547:layer:tensorflow-pack
Package for fans of machine learning, building models and the like. I doubt that there is a more convenient way to deploy model to the real world.
Package of image processing tools, and not only to style image, but also a large set of computer vision algorithms.
There are currently two zipped packs available, Pack.zip and Pack_nomatplotlib.zip, you probably want to use Pack_nomatplotlib.zip. See https://github.com/ryfeus/lambda-packs/issues/5 for more information.
Scikit-image 0.12.3
Another package of image processing tools, and not only to style image, but also a large set of Computer vision algorithms.
https://pillow.readthedocs.io/
http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_tutorials.html
Package for fans of statistics, data scientists and data engineers. RAM at lambda is 1.5 gigabytes, and the maximum operating time - 5 minutes. I am sure that will be enough for most tasks.
Pandas 0.19.0
Opensource library for Natural Language Processing in python.
Example code loads language model from S3 and uses it to analyze sentence.
OCR (optical character recognition) library for text recognition from the image.
https://github.com/tesseract-ocr/tesseract
"Hello world" code in package creates example of every document. Basically these libs are low memory (less than 128MB) and high speed (less than 0.5 seconds) so it's something like ~1m documents generated per 1$ in terms of AWS Lambda pricing.
AWS Lambda pack in Python for processing satellite imagery. Basically it enables to deploy python code in an easy and cheap way for processing satellite imagery or polygons. In “hello world” code of the pack I download red, green, blue Landsat 8 bands from AWS, make True Color image out of it and upload it to S3. It takes 35 seconds and 824MB of RAM for it so ~2500 scenes can be processed for 1$.
Python 3.6 based PyTorch
# You need `docker` before run
./build-with-docker.sh
Download Details:
Author: ryfeus
Source Code: https://github.com/ryfeus/lambda-packs
License: MIT License
1621154520
If you are here, you may have a pretty good knowledge of how to use AWS CDK for defining cloud infrastructure in code and provisioning it through AWS. So let’s get started on how to grant permission to your lambda function to access the resources in another AWS account.
Let’s say you have two accounts called Account A and Account B, and you need to give permission to lambda function in Account A (ex: 11111111)to access the resources in Account B(22222222). You can easily do this by assuming an IAM Role in Account B and then uses the returned credentials to invoke AWS resources in Account B.
#acces #account #aws #lambda #aws lambda #aws cdk
1621000800
A month back AWS announced a preview of Lambda Extensions, a new way to easily integrate Lambda with your favorite monitoring, observability, security, and governance tools. Extensions can be published as Lambda layers, there are two types are extension:
#aws #aws-secrets-manager #lambda #aws lambda
1645013700
Precompiled packages for AWS lambda
6. Lambda function handler and role
7. Advanced settings
8. Code entry type - Upload a .ZIP file - choose Pack.zip from rep
9. Test -> Save and test
Selenium on PhantomJS. In fact - a ready-made tool for web scraping. For example, the demo now opens a random page in Wikipedia and sends its header. (PhantomJS at the same time disguises itself as a normal browser, knows how to log in, click and fill out forms) Also added requests, so you can do API requests for different resources to discard / take away the information.
Useful for web testing and scraping.
Current demo opens random page from wiki (https://en.wikipedia.org/wiki/Special:Random) and prints title.
git clone https://github.com/ryfeus/lambda-packs.git
cd lambda-packs/Selenium_PhantomJS/source/
serverless deploy
serverless invoke --function main --log
You can also see the results from the API Gateway endpoint in a web browser.
https://selenium-python.readthedocs.io/
What does the lambda have to do with it? In a nutshell on AWS in one region you can simultaneously run 200 lambdas (more if you write to support). Lambda works in 11 regions. So you can run in parallel more than 2000 lambdas, each of which will conduct load testing of your service. Five minutes of such testing will cost just one dollar.
Demo in this package tries to send requests to github.com for 5 seconds with 1 connection and also conduct pyresttest dummy test.
https://github.com/svanoort/pyresttest
Package for parsing static HTML pages. Difference here is that it works faster and consumes less memory than PhantomJS but is limited in terms websites it can parse and other features.
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/Lxml_requests/source -n lxml-requests
cd lxml-requests
serverless deploy
serverless invoke --function main --log
wget https://github.com/ryfeus/lambda-packs/blob/master/Lxml_requests/buildPack.sh
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
Lxml 3.7.1
Open source library for Machine Intelligence. Basically revolutionized AI and made it more accessible. Using tensorflow on lambda is not as bad as it may sound - for some simple models it is the simplest and the cheapest way to deploy.
As hello world code I used recognition of images trained on imagenet (https://www.tensorflow.org/tutorials/image_recognition). Given the price tag lambda one run (recognition of one picture) will cost $0.00005. Therefore for a dollar you can recognize 20,000 images. It is much cheaper than almost any alternatives, though completely scalable (200 functions can be run in parallel), and can be easily integrated into cloud infrastructure. Current demo downloads image from link 'imagelink' from event source ( if empty - then downloads https://s3.amazonaws.com/ryfeuslambda/tensorflow/imagenet/cropped_panda.jpg)
Tensorflow 1.4.0
https://www.tensorflow.org/tutorials/image_recognition
Nightly version archive is more than 50 MB in size but it is still eligible for using with AWS Lambda (though you need to upload pack through S3). For more read here:
https://hackernoon.com/exploring-the-aws-lambda-deployment-limits-9a8384b0bec3
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/tensorflow/source -n tensorflow
cd tensorflow
serverless deploy
serverless invoke --function main --log
for Python2:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
for Python3:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack_py3.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index_py3.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack_py3.sh
Note: Remember You should set
python3.6
for AWS Lambda function environment.
arn:aws:lambda:us-east-1:339543757547:layer:tensorflow-pack
Package for fans of machine learning, building models and the like. I doubt that there is a more convenient way to deploy model to the real world.
Package of image processing tools, and not only to style image, but also a large set of computer vision algorithms.
There are currently two zipped packs available, Pack.zip and Pack_nomatplotlib.zip, you probably want to use Pack_nomatplotlib.zip. See https://github.com/ryfeus/lambda-packs/issues/5 for more information.
Scikit-image 0.12.3
Another package of image processing tools, and not only to style image, but also a large set of Computer vision algorithms.
https://pillow.readthedocs.io/
http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_tutorials.html
Package for fans of statistics, data scientists and data engineers. RAM at lambda is 1.5 gigabytes, and the maximum operating time - 5 minutes. I am sure that will be enough for most tasks.
Pandas 0.19.0
Opensource library for Natural Language Processing in python.
Example code loads language model from S3 and uses it to analyze sentence.
OCR (optical character recognition) library for text recognition from the image.
https://github.com/tesseract-ocr/tesseract
"Hello world" code in package creates example of every document. Basically these libs are low memory (less than 128MB) and high speed (less than 0.5 seconds) so it's something like ~1m documents generated per 1$ in terms of AWS Lambda pricing.
AWS Lambda pack in Python for processing satellite imagery. Basically it enables to deploy python code in an easy and cheap way for processing satellite imagery or polygons. In “hello world” code of the pack I download red, green, blue Landsat 8 bands from AWS, make True Color image out of it and upload it to S3. It takes 35 seconds and 824MB of RAM for it so ~2500 scenes can be processed for 1$.
Python 3.6 based PyTorch
# You need `docker` before run
./build-with-docker.sh
Download Details:
Author: ryfeus
Source Code: https://github.com/ryfeus/lambda-packs
License: MIT License
1642613520
Precompiled packages for AWS lambda
6. Lambda function handler and role
7. Advanced settings
8. Code entry type - Upload a .ZIP file - choose Pack.zip from rep
9. Test -> Save and test
Selenium on PhantomJS. In fact - a ready-made tool for web scraping. For example, the demo now opens a random page in Wikipedia and sends its header. (PhantomJS at the same time disguises itself as a normal browser, knows how to log in, click and fill out forms) Also added requests, so you can do API requests for different resources to discard / take away the information.
Useful for web testing and scraping.
Current demo opens random page from wiki (https://en.wikipedia.org/wiki/Special:Random) and prints title.
git clone https://github.com/ryfeus/lambda-packs.git
cd lambda-packs/Selenium_PhantomJS/source/
serverless deploy
serverless invoke --function main --log
You can also see the results from the API Gateway endpoint in a web browser.
https://selenium-python.readthedocs.io/
What does the lambda have to do with it? In a nutshell on AWS in one region you can simultaneously run 200 lambdas (more if you write to support). Lambda works in 11 regions. So you can run in parallel more than 2000 lambdas, each of which will conduct load testing of your service. Five minutes of such testing will cost just one dollar.
Demo in this package tries to send requests to github.com for 5 seconds with 1 connection and also conduct pyresttest dummy test.
https://github.com/svanoort/pyresttest
Package for parsing static HTML pages. Difference here is that it works faster and consumes less memory than PhantomJS but is limited in terms websites it can parse and other features.
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/Lxml_requests/source -n lxml-requests
cd lxml-requests
serverless deploy
serverless invoke --function main --log
wget https://github.com/ryfeus/lambda-packs/blob/master/Lxml_requests/buildPack.sh
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
Lxml 3.7.1
Open source library for Machine Intelligence. Basically revolutionized AI and made it more accessible. Using tensorflow on lambda is not as bad as it may sound - for some simple models it is the simplest and the cheapest way to deploy.
As hello world code I used recognition of images trained on imagenet (https://www.tensorflow.org/tutorials/image_recognition). Given the price tag lambda one run (recognition of one picture) will cost $0.00005. Therefore for a dollar you can recognize 20,000 images. It is much cheaper than almost any alternatives, though completely scalable (200 functions can be run in parallel), and can be easily integrated into cloud infrastructure. Current demo downloads image from link 'imagelink' from event source ( if empty - then downloads https://s3.amazonaws.com/ryfeuslambda/tensorflow/imagenet/cropped_panda.jpg)
Tensorflow 1.4.0
https://www.tensorflow.org/tutorials/image_recognition
Nightly version archive is more than 50 MB in size but it is still eligible for using with AWS Lambda (though you need to upload pack through S3). For more read here:
https://hackernoon.com/exploring-the-aws-lambda-deployment-limits-9a8384b0bec3
serverless install -u https://github.com/ryfeus/lambda-packs/tree/master/tensorflow/source -n tensorflow
cd tensorflow
serverless deploy
serverless invoke --function main --log
for Python2:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack.sh
for Python3:
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/buildPack_py3.sh
wget https://raw.githubusercontent.com/ryfeus/lambda-packs/master/Tensorflow/index_py3.py
docker pull amazonlinux:latest
docker run -v $(pwd):/outputs --name lambdapackgen -d amazonlinux:latest tail -f /dev/null
docker exec -i -t lambdapackgen /bin/bash /outputs/buildPack_py3.sh
Note: Remember You should set
python3.6
for AWS Lambda function environment.
arn:aws:lambda:us-east-1:339543757547:layer:tensorflow-pack
Package for fans of machine learning, building models and the like. I doubt that there is a more convenient way to deploy model to the real world.
Package of image processing tools, and not only to style image, but also a large set of computer vision algorithms.
There are currently two zipped packs available, Pack.zip and Pack_nomatplotlib.zip, you probably want to use Pack_nomatplotlib.zip. See https://github.com/ryfeus/lambda-packs/issues/5 for more information.
Scikit-image 0.12.3
Another package of image processing tools, and not only to style image, but also a large set of Computer vision algorithms.
https://pillow.readthedocs.io/
http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_tutorials.html
Package for fans of statistics, data scientists and data engineers. RAM at lambda is 1.5 gigabytes, and the maximum operating time - 5 minutes. I am sure that will be enough for most tasks.
Pandas 0.19.0
Opensource library for Natural Language Processing in python.
Example code loads language model from S3 and uses it to analyze sentence.
OCR (optical character recognition) library for text recognition from the image.
https://github.com/tesseract-ocr/tesseract
"Hello world" code in package creates example of every document. Basically these libs are low memory (less than 128MB) and high speed (less than 0.5 seconds) so it's something like ~1m documents generated per 1$ in terms of AWS Lambda pricing.
AWS Lambda pack in Python for processing satellite imagery. Basically it enables to deploy python code in an easy and cheap way for processing satellite imagery or polygons. In “hello world” code of the pack I download red, green, blue Landsat 8 bands from AWS, make True Color image out of it and upload it to S3. It takes 35 seconds and 824MB of RAM for it so ~2500 scenes can be processed for 1$.
Python 3.6 based PyTorch
# You need `docker` before run
./build-with-docker.sh
Download Details:
Author: ryfeus
Source Code: https://github.com/ryfeus/lambda-packs
License: MIT License
1617875400
2020 was a difficult year for all of us, and it was no different for engineering teams. Many software releases were postponed, and the industry slowed its development speed quite a bit.
But at least at AWS, some teams released updates out of the door at the end of the year. AWS Lambda received two significant improvements:
With these two new features and Lambda Layers, we now have three ways to add code to Lambda that isn’t directly part of our Lambda function.
The question is now: when should we use what?
In this article, I try to shine some light on the Lambda Layers, Lambda Extensions, and Docker image for Lambda.
First things first. All these Lambda features can be used together. So if you think about where to put your code, at least your decisions aren’t mutually exclusive. You can upload a Docker image and attach a regular Lambda Layer and a Lambda Extension. The same is possible if your Lambda function is based on a ZIP archive.
What does this all mean? Keep reading and find out.
#aws #aws-lambda #serverless #devops #docker #lambda