vladholubiev / serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents
https://vladholubiev.com/serverless-libreoffice
513 stars 75 forks source link

Convert build process to Docker #22

Closed aaronsturm closed 3 years ago

aaronsturm commented 4 years ago

Reference https://github.com/shelfio/aws-lambda-libreoffice/issues/40

I want to upgrade the LibreOffice version without needing to spin up and pay for an EC2 instance. It does take about 45 minutes longer on my local machine, but this can also be ran on an EC2 if desired.

I had the following questions after finishing this:

  1. Can/should this repo be merged with https://github.com/shelfio/libreoffice-lambda-layer? The compile and publish steps could be combined.
  2. Since the code ultimately needs to end up in layers.zip, is it still worth compressing with Brotli?

My next step will be trying to get the newest version of LibreOffice to compile, but I did want to provide this change now since it is complete. I welcome any feedback and thank you for initiating this project!

vladholubiev commented 4 years ago

Hey @aaronsturm!

Thanks a lot for this contribution. I'll try to run it on my machine and if it works I'll get it merged!

Regarding

  1. Since the code ultimately needs to end up in layers.zip, is it still worth compressing with Brotli?

Unfortunately yes, see https://docs.aws.amazon.com/lambda/latest/dg/limits.html

image

W/o brotli unpacked layer size will exceed 250 MB

aaronsturm commented 4 years ago

Hi @vladgolubev - Just checking to see if you had an opportunity to run this yet? Thanks!

aaronsturm commented 4 years ago

Hi @vladgolubev - I wanted to follow-up and see if you ever had a chance to test this and if it can be merged in? Thanks!

vladholubiev commented 4 years ago

Hey @aaronsturm, I didn't have a chance to test this yet, but I hope I will be able soon!

dehli commented 4 years ago

Just thought I'd chime in that I got this working on my Mac 👍 Thanks @aaronsturm! Was hoping that it would work on node10 since it's using amazonlinux2 but I'm still running into issues with it. Will try to look into it more when I have time. Cheers!

hochoy commented 4 years ago

Great addition @aaronsturm ! Did u get any compile errors @dehli

dehli commented 4 years ago

I didn't see any Docker compile errors, but when I try to run it on node10 I get the following error:

/tmp/lo/instdir/program/oosplash: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
hochoy commented 4 years ago

Thanks, I'll try again and provide an update

aaronsturm commented 4 years ago

Hi @dehli - Can you let me know what you were trying to run? Was it the code in the src folder in this repo?

dehli commented 4 years ago

Sure @aaronsturm! It's:

/tmp/lo/instdir/program/soffice
    --headless
    --invisible
    --nodefault
    --nofirststartwizard
    --nolockcheck
    --nologo
    --norestore
    --convert-to pdf
    --outdir /tmp/workspace
    test.doc
aaronsturm commented 3 years ago

After almost 2 years and no response from the author, I'm going to close this. I'm tired of seeing it in my PR list.