-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add benchmarks * Format with Black * refactor: renamed chrome benchmark and edited markdown2html lambda code and payload * Format with Black * add source codes Co-authored-by: Github Actions Bot <> Co-authored-by: Arshia Moghimi <arshiamoghimi98@gmail.com>
- Loading branch information
1 parent
fbb36ac
commit 08ed093
Showing
23 changed files
with
873 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "benchmarks/formplug/formplug"] | ||
path = benchmarks/formplug/formplug | ||
url = https://github.com/danielireson/formplug | ||
[submodule "benchmarks/ocr/lambda-OCRmyPDF"] | ||
path = benchmarks/ocr/lambda-OCRmyPDF | ||
url = https://github.com/chronograph-pe/lambda-OCRmyPDF.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Daniel Ireson | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This benchmark is from [https://github.com/danielireson/formplug](https://github.com/danielireson/formplug). | ||
Follow the [instructions](https://github.com/danielireson/formplug#setup) to deploy it to AWS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Princeton University | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This benchmark was taken from [faas-profiler](https://github.com/PrincetonUniversity/faas-profiler/blob/master/functions/markdown-to-html/markdown2html.py). | ||
We modified the code for our own purposes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import markdown | ||
import base64 | ||
|
||
|
||
def lambda_handler(event, context): | ||
try: | ||
text = event["markdown"] | ||
except: | ||
return {"Error": "Possibly lacking markdown parameter in request."} | ||
|
||
decoded_text = base64.b64decode(text.encode()).decode() | ||
|
||
html = markdown.markdown(decoded_text) | ||
|
||
return {"html_response": html} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This benchmark is taken from [https://github.com/chronograph-pe/lambda-OCRmyPDF](https://github.com/chronograph-pe/lambda-OCRmyPDF). | ||
Running `./deploy.sh` deploys the function to AWS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
lambda_name=$1 | ||
s3_bucket=$2 | ||
s3_file_key=$3 | ||
|
||
zip_file_name="lambda-ocrtopdf.zip" | ||
download_url="https://github.com/chronograph-pe/lambda-OCRmyPDF/releases/download/v1.0-alpha/lambda-ocrtopdf.zip" | ||
|
||
wget -O $zip_file_name $download_url | ||
|
||
aws s3 cp $zip_file_name s3://$s3_bucket/$s3_file_key | ||
aws lambda update-function-code --function-name $lambda_name --s3-bucket $s3_bucket --s3-key $s3_file_key | ||
aws lambda update-function-configuration --function-name $lambda_name \ | ||
--handler apply-ocr-to-s3-object.apply_ocr_to_document_handler \ | ||
--environment "Variables={PATH=/var/task/bin,PYTHONPATH=/var/task/python,TESSDATA_PREFIX=/var/task/tessdata}" \ | ||
--timeout 900 \ | ||
--memory-size 3008 \ | ||
--runtime "python3.6" |
Submodule lambda-OCRmyPDF
added at
3b11b9
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"function_name": "formplug-dev-receive", | ||
"mem_bounds": [ | ||
128, | ||
1024 | ||
], | ||
"mem_size": 128, | ||
"region": "us-east-1", | ||
"vendor": "AWS", | ||
"workload": { | ||
"instances": { | ||
"instance1": { | ||
"application": "formplug-dev-receive", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"SERVICE_NAME": "formplug", | ||
"ENCRYPTION_KEY": "formsaregreat", | ||
"REGION": "us-east-1", | ||
"STAGE": "dev", | ||
"SENDER_ARN": "arn:aws:ses:us-east-1:880306299867:identity/arshiamoghimi77@gmail.com", | ||
"WHITELISTED_RECIPIENTS": null, | ||
"RECAPTCHA_SECRET_KEY": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"instances": { | ||
"instance1": { | ||
"application": "formplug-dev-receive", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"function_name": "markdown2html", | ||
"mem_bounds": [ | ||
128, | ||
1024 | ||
], | ||
"mem_size": 128, | ||
"region": "us-east-1", | ||
"vendor": "AWS", | ||
"workload": { | ||
"instances": { | ||
"instance1": { | ||
"application": "markdown2html", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"instances": { | ||
"instance1": { | ||
"application": "markdown2html", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"function_name": "ocr", | ||
"mem_bounds": [ | ||
128, | ||
1024 | ||
], | ||
"mem_size": 128, | ||
"region": "us-east-1", | ||
"vendor": "AWS", | ||
"workload": { | ||
"instances": { | ||
"instance1": { | ||
"application": "ocr", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"pages": "4", | ||
"awsRegion": "us-east-1", | ||
"s3": { | ||
"bucket": { | ||
"name": "larmol-public" | ||
}, | ||
"object": { | ||
"key": "socc21_multi-cloud_serverless.pdf" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"instances": { | ||
"instance1": { | ||
"application": "ocr", | ||
"payload": "payload.json" | ||
} | ||
}, | ||
"random_seed": 100, | ||
"test_duration_in_seconds": 15, | ||
"test_name": "IntegrationTest1" | ||
} |