serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents

Github星跟踪图

Serverless LibreOffice

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.

License

MIT © Vlad Holubiev

主要指标

概览
名称与所有者vladholubiev/serverless-libreoffice
主编程语言Dockerfile
编程语言HCL (语言数: 3)
平台
许可证
所有者活动
创建于2017-11-11 16:49:47
推送于2023-03-04 21:57:26
最后一次提交2023-03-04 22:57:26
发布数5
最新版本名称v6.4.0.1 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数523
关注者数16
派生数73
提交数64
已启用问题?
问题数33
打开的问题数19
拉请求数7
打开的拉请求数3
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?