Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda: create a Dockerfile that can run as a Lambda function #215

Closed
3 tasks done
patheard opened this issue Feb 3, 2023 · 4 comments · Fixed by #232
Closed
3 tasks done

Lambda: create a Dockerfile that can run as a Lambda function #215

patheard opened this issue Feb 3, 2023 · 4 comments · Fixed by #232
Assignees

Comments

@patheard
Copy link
Member

patheard commented Feb 3, 2023

Description

Currently the app runs in Heroku using the Node http module:

We need to wrap calls to the server so that the Lambda invocation events are converted into an HTTP request that the Node http server understands how to process. We should be able to use the serverless-http module to make this happen.

Todo

Related

@omartehsin1
Copy link
Collaborator

  • At the moment just testing out creating a Dockerfile for the Lambda Functional URL to behave as a website. Testing it out on a basic hello-world application before moving to simplify privacy statements
  • Right now trying to get a better grasp of Docker

Plans for next week:

  • Hopefully have the basic app running before moving to the simplify privacy statement
  • Get a better understanding of Lambda Functions

@omartehsin1
Copy link
Collaborator

This week:

  • Making progress with Lambda and Docker, able to have the Dockerfile for the lambda function, it is able to run as a website. The part that I am stuck on is it being able to generate the word doc -> always leads to an error.
  • Continuing to do research on this issue

Next week:

  • Continue to learn more about Docker and Terraform.

@omartehsin1
Copy link
Collaborator

This week:

  • Still trying to figure out the nodePandoc issue, having some trouble with downloading the file
  • Looking into other AWS resources, specifically EFS to see if it will help us

@omartehsin1
Copy link
Collaborator

Completed

  • Created a Lambda container image that behaves like a website.
  • Using serverless-http module to wrap calls to the Node http server
  • The biggest hurdle was being able to use node-pandoc to convert then download the file. The issue was:
    1.) Lambda timed out before the response could be processed so we increased the timeout to give pandoc time to generate the file
    2.) Send the html response in the nodepandoc callback to give pandoc the time it needed to generate the file. lambda will only be terminated once it send the response
    3.) let serverless-http know that is should base64 the docx files before streaming the response.

@omartehsin1 omartehsin1 linked a pull request Mar 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants