Name: nbconvert-webapp
Owner: Sage Bionetworks
Description: Converts ipynb file into html. Packaged for Lambda deployment
Created: 2017-11-14 16:30:35.0
Updated: 2017-11-14 16:37:14.0
Pushed: 2017-11-20 22:05:15.0
Size: 104692
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Converts ipynb file into html. This is a light wrapper around nbconvert, packaged to deploy as an AWS Lambda function.
Note, I used python-lambda as a starting point.
Note that a prebuilt package is included in the dist directory. To rebuild… As described in the AWS Lambda “Creating a Deployment Package (Python)” doc, use the Virtualenv tool. Install all dependencies within this environment
install requests
install nbconvert
Now zip up your site-packages directory. I named the archive app.zip
Then add the handler file, service.py, to the app.zip
-g app.zip service.py
To create the function:
bucket_name> is the name of the bucket where the package resides
lambda_role_arn> is the arn of the role to be assumed by the lambda function
lambda create-function --region <region> --function-name nbconvert --code S3Bucket=<bucket_name>,S3Key=app.zip --role <lambda_role_arn> --handler service.handler --runtime python3.6 --timeout 10 --memory-size 1024
To update the function:
lambda update-function-code --function-name nbconvert --s3-bucket <bucket_name> --s3-key=app.zip --publish
Install the python-lambda helper project:
install python-lambda
Now call the lambda handler (service.py using event.json as input) by executing the command:
da invoke -v