Git Product home page Git Product logo

jnayak1 / pdflatex-lambda Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 0.0 183.04 MB

AWS Lambda function handler for converting LaTeX documents into PDFs

License: Apache License 2.0

Python 0.01% TeX 91.10% Shell 0.88% PostScript 0.28% Prolog 0.06% IDL 0.01% Perl 6.26% Lua 0.71% QMake 0.04% Makefile 0.01% Ruby 0.61% Batchfile 0.01% Perl 6 0.03%
aws aws-lambda lambda latex pdflatex python serverless

pdflatex-lambda's People

Contributors

jnayak1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdflatex-lambda's Issues

Create script to setup TeXLive

Create a script that:

  • Downloads the TeXLive installer
  • Runs the text gui installer allowing user to select what packages they want to install, where they want to install them to, etc.
  • Adds /path/to/package/bin/x86_64-linux to PATH

Also:

  • Look into the TeXLive perltk installer. That might give more options/customizability than the text gui installer.

Figure out how to link packages

Once we get all the packages onto lambda, how do we get them to work together properly?

  • Will modifying PATH be enough to get everything working?
  • Look into TEXMFHOME environment variable

Approach:

Size of LaTeX Package

One issue is that TeXLive, which compiles LaTeX documents, is very large. The full, portable version is about 500MB according to this post 4.6GB.

This is a problem since Lambda limits the size of the zip file you can upload to 250MB unzipped.

However, pdflatex depends on just a subset of the full version.

TODO:

  • Determine the subset of the full version of TeXLive needed to run pdflatex
  • How big is this subset?
  • How can we download and move this subset?

Approach:

  • Research
  • Boot up EC2 Amazon Linux instances and test

Create script to create a lambda function with s3 bucket configured

Create a script that launches a lambda function with the permissions we need:

  • ZIPs up a specified directory
  • Creates an S3 bucket using aws cli
  • Creates a role with read, write permissions with aws cli
  • Uploads the zip to lambda using aws cli with the role just created
  • Initializes a trigger on the lambda function for when a file is uploaded to the s3 bucket using aws cli

Is this working?

I have seen this issue here where it is mentioned that pdflatex does not work. So what does the PdfLaTeX.zip file contain?
Also, since the main problem is the size limit of the package, have you considered implementing this on Azure Functions?
Thanks.

ZIP file size limit

AWS lambda's size limit for the ZIP file is 50MB. texlive-scheme-basic zipped up is a little over 59MB. The error message I get when I try to upload the ZIP says that I should use s3 to upload the ZIP instead.
screen shot 2016-10-03 at 2 49 38 pm

  • Look into how to use s3 to upload the zip
  • Look into see if the package can be further compressed. I had used zip -9 but there might be something else that can compress the package further.
  • Look into if there are additional files we can delete in the texlive-scheme-basic package

Create script to setup TeXCaller

TeXCaller is a package that provides an interface to TeXLive in many different languages (C++, Python, etc.). The nice thing about it is that it provides error handling.

TODO:

  • Script to install TeXCaller locally (just the portion we need, just python part, delete the rest)
  • Test to make sure that TeXCaller can be run locally on Amazon Linux EC2 instance (without sudo)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.