Question is a little cryptic and I am a noob on this tool but increasing the timeout period to 1 minute (only needs ~30 seconds) and memory for my lambda to 1024 mb helped a lot. I have other issues related to FS on lambda so not a complete solution.
Posts made by weisisheng
-
RE: Problems with jsreport on serverless (lambda)
-
Any users tried using AWS S3 with a serverless setup?
This may be a bit OT but also part of more frequent use cases.
I have had some early success with pulling data from Dynamodb and once I am confident the code is good, will post for others to consider. However, I only need individual data records a few times since the reports I am developing are transactional and infrequent in nature.
Has anyone tried querying on AWS S3 using their "Select" feature which provides for very cheap moderately fast access?
Thanks in advance.
-
RE: Would adding aws-s3-storage feature bump the zipped layer by 13MB?
We can close this for now. I realized I was adding the "aws-sdk" in dependencies which was bloating the layer significantly. It is already included with lambda although best practice is to pin against a specific version. When I get some time, I will look at adding multiple layers or slimming puppeteer further. Thank you!
-
RE: Would adding aws-s3-storage feature bump the zipped layer by 13MB?
Still working on the size difference issue. One good note (to self and others), when testing the S3 storage feature, restart after installing extensions!
-
how to loop over sample (local) data?
I've scoured the documents and SO forum and I can't seem to get the inputs right. I've tried to use {{this.foo}} but this doesn't work. The report renders but without the custom data inputs. Thanks in advance.
{{#each this}}
<div>
<span>Artist: {{artist}}</span></br>
<span>Song: {{song}}</span></br>
<span>Id: {{id}}</span></br>
<span>Price: {{priceUsdCents}}</span></br>
<span>Publisher: {{publisher}}</span></br>
</div>
{{/each}} -
RE: Would adding aws-s3-storage feature bump the zipped layer by 13MB?
If I create a "plain-vanilla" Lamba Layer per the instructions on the AWS Serverless page, I get an 82MB package which gets accepted by the Lambba Layer CLI. With the added jsreports-aws-S3-storage, the package is 90MB and rejected as too large. This is before I make any additional package upgrades for npm package warnings (npm audit kind).
Is there an absolute MB size that I shouldn't go over when Lambda Layer is zipped?
-
RE: Would adding aws-s3-storage feature bump the zipped layer by 13MB?
Yes, followed this carefully (it's well done) and have a 'hello world' running on the AWS console and using the test.js file. My original S3 issue was related to installing the S3 blobStorage feature locally and pushing it up to AWS but the lambda layer was being rejected due to size. Working on completing the process by having output go to an S3 bucket. Will give a try again tomorrow.
-
RE: Would adding aws-s3-storage feature bump the zipped layer by 13MB?
Thanks for the fast response. I will give it a try again and repot back. For some reason, in the past, anytime, I got above around 86-90MB, lambda layer creation console then rejects it as being an expanded 260MB+
-
Would adding aws-s3-storage feature bump the zipped layer by 13MB?
I removed all the samples but the invoice one then added the node module for s3 and I am at 98 MB zipped. Welcome any tips on what I can slim down (learning about that too now). Thanks all.
-
Really stumped on aws-s3-storage error
Using docker with a mapped volume to my main jsreports directory, uploaded to aws serverless and the base "invoice-main" sample works except for a strange "foreach" error. But when I try to add the aws-s3-storage feature, adding the BlobStorage provider "aws-s3-storage" to my prod.config.json file, and then adding all the extensions required, I get the following error when I try to restart docker.
error: Error occured during reporter init Error: options contain values that does not match the defined full root schema. schema validation errors: rootOptions.blobStorage.provider should be equal to one of the allowed values. allowed values: ["memory", "fs", "azure-storage", "gridFS"]
S3 isn't even there?!?! I tried adding and removing "S3Options": {} in the extensions section with no difference in result.
I am a node.js noob so any assistance would be appreciated.
-
RE: AWS Appsync API and Lambda
For what it is worth, if anyone is looking to test from the CLI, after setting up the lambda and layer on serverless, create a properly formatted .json file with the following payload and then use the command below.
{
"renderRequest": {
"template": {
"name": "template-name-here"
}
}
}aws lambda invoke --function-name foo-report --payload file://foopayload.json foo-out.txt
Please note the function name, the payload (in json file format) and the text file are all required.
Next up, fronting a secure API...
-
RE: AWS Appsync API and Lambda
No problem at all. Thank you for your cordial response and extraordinary platform. I will keep collecting more info on it. All the best.
-
RE: AWS Appsync API and Lambda
If I understand correctly, I need to put an API in front of the lambda, make sure it is secured, and then pass it the minimum payloads of {
"resource": "/report",
"path": "/",
"httpMethod": "POST",
"template": {
"name": "testreport"
}
}Is that roughly correct?
-
AWS Appsync API and Lambda
Hello Everyone-
I am used to using the AWS amplify framework which is drop dead easy to set up but not applicable for this current use case. Would someone have good reference or code/toy example to connect an Aws Appsync API to a Lambda triggering report creation and email?
In the last few days, and brand new to JSReport, I've been able to follow along and get the serverless version working and emails sent when using test.js. I am trying to move to a more production-like app.
Now I want to put an API in front of the Lambda and pass variables. Googling and Github didn't seem to surface much.
Thanks in advance!
-
RE: Installing on Ubuntu 20.04
Thanks for the fast response, I upgraded from node 10.x to 12.x and npm is latest, same result. I will try to look at the medium piece next week when I have more time. For now, probably default to docker. Much appreciated!
-
Installing on Ubuntu 20.04
Trying to add this to a properly working system, can't get past the last step:
npm install jsreport-cli -g
mkdir jsreportapp
cd jsreportapp
jsreport initError message is " jsreport init-->Command 'jsreport' not found, did you mean: foo, foo, foo". Should I install globally with sudo?
Would appreciate any tips or tricks. It would seem easier to use Docker version but then injecting new templates before using AWS serverless would be better locally? Thanks in advance.
Vince