All Projects → vladgolubev → Serverless Libreoffice

vladgolubev / Serverless Libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Serverless Libreoffice

Aws Lambda Libreoffice
85 MB LibreOffice to fit inside AWS Lambda compressed with Brotli
Stars: ✭ 145 (-64.63%)
Mutual labels:  libreoffice, serverless, aws-lambda, pdf-converter
Go Lambda Ping
Deploy a Lambda to Ping a Site in 20 Seconds!
Stars: ✭ 195 (-52.44%)
Mutual labels:  serverless, aws-lambda, terraform
Serverless static website with basic auth
Builds a serverless infrastructure in AWS for hosting a static website protected with Basic Authentication and published on a subdomain registered via Route 53
Stars: ✭ 112 (-72.68%)
Mutual labels:  serverless, aws-lambda, terraform
Modules.tf Lambda
Infrastructure as code generator - from visual diagrams created with Cloudcraft.co to Terraform
Stars: ✭ 267 (-34.88%)
Mutual labels:  serverless, aws-lambda, terraform
Cljs Lambda
Utilities around deploying Clojurescript functions to AWS Lambda
Stars: ✭ 304 (-25.85%)
Mutual labels:  serverless, aws-lambda
Serverless Golang
AWS Lambda Go functions using Serverless Framework and Python shim
Stars: ✭ 292 (-28.78%)
Mutual labels:  serverless, aws-lambda
Grant
OAuth Proxy
Stars: ✭ 3,509 (+755.85%)
Mutual labels:  serverless, aws-lambda
Pipe
Continuous Delivery for Declarative Kubernetes, Serverless and Infrastructure Applications
Stars: ✭ 341 (-16.83%)
Mutual labels:  serverless, terraform
Pdf Flipbook
Browse PDF document like a book turning its pages
Stars: ✭ 279 (-31.95%)
Mutual labels:  pdf, pdf-converter
Terraform Aws Github Runner
Terraform module for scalable GitHub action runners on AWS
Stars: ✭ 326 (-20.49%)
Mutual labels:  serverless, terraform
Serverless Photo Recognition
A collection of 3 lambda functions that are invoked by Amazon S3 or Amazon API Gateway to analyze uploaded images with Amazon Rekognition and save picture labels to ElasticSearch (written in Kotlin)
Stars: ✭ 345 (-15.85%)
Mutual labels:  serverless, aws-lambda
Python Automation Scripts
Simple yet powerful automation stuffs.
Stars: ✭ 292 (-28.78%)
Mutual labels:  pdf, pdf-converter
Hands On Serverless Guide
A hands-on guide for building Serverless applications
Stars: ✭ 288 (-29.76%)
Mutual labels:  serverless, aws-lambda
Node Html Pdf
📄 Html to pdf converter in nodejs. It spawns a phantomjs process and passes the pdf as buffer or as filename.
Stars: ✭ 3,364 (+720.49%)
Mutual labels:  pdf, pdf-converter
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (-30.98%)
Mutual labels:  serverless, aws-lambda
Express
⚡ Take existing Express.js apps and host them easily on cheap, auto-scaling, serverless infrastructure (AWS Lambda and AWS HTTP API).
Stars: ✭ 337 (-17.8%)
Mutual labels:  serverless, aws-lambda
Vscodethemes
Preview themes from the VSCode marketplace.
Stars: ✭ 374 (-8.78%)
Mutual labels:  aws-lambda, terraform
Claudia
Deploy Node.js projects to AWS Lambda and API Gateway easily
Stars: ✭ 3,690 (+800%)
Mutual labels:  serverless, aws-lambda
Serverless Wsgi
Serverless plugin to deploy WSGI applications (Flask/Django/Pyramid etc.) and bundle Python packages
Stars: ✭ 377 (-8.05%)
Mutual labels:  serverless, aws-lambda
Lib
Autocode CLI and standard library tooling
Stars: ✭ 3,773 (+820.24%)
Mutual labels:  serverless, aws-lambda

Serverless LibreOffice

👉🏻 Read the blog post on Medium: How to Run LibreOffice in AWS Lambda for Dirty-Cheap PDFs at Scale 👈🏻

Show Me the Code

This repo contains code used to run the online demo.

├── compile.sh  <-- commands used to compile LibreOffice for Lambda
├── infra       <-- terraform config to deploy example Lambda
│   ├── iam.tf
│   ├── lambda.tf
│   ├── main.tf
│   ├── s3.tf
│   └── vars.tf
└── src         <-- example Lambda function node in Node.js used for website demo
    ├── handler.js
    ├── libreoffice.js
    ├── logic.js
    ├── package.json <-- put lo.tar.gz in this folder to deploy. Download it below
    └── s3.js

Compiled and ready to use archive can be downloaded under Releases section. Also check out NPM package with bundled LibreOffice for Lambda (85 MB).

✨ Check out a new Lambda Layer with LibreOffice!

How to compile by yourself

Check out a comprehensive step-by-step tutorial from 0 to deployed function.

  1. Go to Lambda Execution Environment and Available Libraries page to get the latest AMI id
  2. Click on this link to get AMI id for your region
  3. Spin up a c5.2xlarge spot instance with ~ 100 GB of storage attached
  4. Follow the steps in compile.sh file in the repo

Help

Related Projects

How To Help

Reduce Cold Start Time

Currently ƛ unpacks 109 MB .tar.gz to /tmp folder which takes ~1-2 seconds on cold start.

Would be nice to create a single compressed executable to save unpack time and increase portability. I tried using Ermine packager and it works!! But unfortunately this is commercial software. Similar open-source analogue Statifier produces broken binaries.

Maybe someone has another idea how to create a single executable from a folder full of shared objects.

UPD: TODO: Check out node-packer and libsquash (no FUSE required!)

Further Size Reduction

I am not a Linux or C++ expert, so for sure I missed some easy "hacks" to reduce size of compiled LibreOffice.

Mostly I just excluded from compilation as much unrelated stuff as possible. And stripped symbols from shared objects.

Here is the list of: available RPM packages and libraries available in AWS Lambda Environment, which can be helpful.

You can also use multi compression level, with upx and then decompress after brotli.

Testing

Update repo for testing. Return before S3 for example, hardcode or generate files to convert and setup variables. Then simply run:

docker run \
 -v "\$PWD":/var/task \
 lambci/lambda:nodejs12.x src/handler.handler

After successful execution, get the resulted files to check the pdfs.

docker ps -a

Find exect container id.

Then execute

docker cp containerId:/tmp/filename.pdf ./filename.pdf

Then check your results locally

License

MIT © Vlad Holubiev

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].