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.



  • 98MB is the zipped size of the jsreport application folder? Including the chrome? That is quite good.

    You can try to remove these files if you want to get it a bit smaller and faster to compress/decompress.

      `node_modules/**/Jenkinsfile`,
        `node_modules/**/Makefile`,
        `node_modules/**/Gulpfile.js`,
        `node_modules/**/Gruntfile.js`,
        `node_modules/**/gulpfile.js`,
        `node_modules/**/.DS_Store`,
        `node_modules/**/.tern-project`,
        `node_modules/**/.gitattributes`,
        `node_modules/**/.editorconfig`,
        `node_modules/**/.eslintrc`,
        `node_modules/**/.eslintrc.js`,
        `node_modules/**/.eslintrc.json`,
        `node_modules/**/.eslintrc.yml`,
        `node_modules/**/.eslintignore`,
        `node_modules/**/.stylelintrc`,
        `node_modules/**/stylelint.config.js`,
        `node_modules/**/.stylelintrc.json`,
        `node_modules/**/.stylelintrc.yaml`,
        `node_modules/**/.stylelintrc.yml`,
        `node_modules/**/.stylelintrc.js`,
        `node_modules/**/.htmllintrc`,
        `node_modules/**/.lint`,
        `node_modules/**/.npmrc`,
        `node_modules/**/.npmignore`,
        `node_modules/**/.jshintrc`,
        `node_modules/**/.flowconfig`,
        `node_modules/**/.documentup.json`,
        `node_modules/**/.yarn-metadata.json`,
        `node_modules/**/.travis.yml`,
        `node_modules/**/appveyor.yml`,
        `node_modules/**/.gitlab-ci.yml`,
        `node_modules/**/circle.yml`,
        `node_modules/**/.coveralls.yml`,
        `node_modules/**/CHANGES`,
        `node_modules/**/changelog`,
        `node_modules/**/LICENSE.txt`,
        `node_modules/**/LICENSE`,
        `node_modules/**/LICENSE-MIT`,
        `node_modules/**/LICENSE-MIT.txt`,
        `node_modules/**/LICENSE.BSD`,
        `node_modules/**/license`,
        `node_modules/**/LICENCE.txt`,
        `node_modules/**/LICENCE`,
        `node_modules/**/LICENCE-MIT`,
        `node_modules/**/LICENCE-MIT.txt`,
        `node_modules/**/LICENCE.BSD`,
        `node_modules/**/licence`,
        `node_modules/**/AUTHORS`,
        `node_modules/**/VERSION`,
        `node_modules/**/CONTRIBUTORS`,
        `node_modules/**/.yarn-integrity`,
        `node_modules/**/.yarnclean`,
        `node_modules/**/_config.yml`,
        `node_modules/**/.babelrc`,
        `node_modules/**/.yo-rc.json`,
        `node_modules/**/jest.config.js`,
        `node_modules/**/karma.conf.js`,
        `node_modules/**/wallaby.js`,
        `node_modules/**/wallaby.conf.js`,
        `node_modules/**/.prettierrc`,
        `node_modules/**/.prettierrc.yml`,
        `node_modules/**/.prettierrc.toml`,
        `node_modules/**/.prettierrc.js`,
        `node_modules/**/.prettierrc.json`,
        `node_modules/**/prettier.config.js`,
        `node_modules/**/.appveyor.yml`,
        `node_modules/**/tsconfig.json`,
        `node_modules/**/tslint.json`,
        `node_modules/jsreport-studio/src`,
        `node_modules/jsreport-studio/static/dist/*.map`
    

    We do this when preparing aws lambda package here.



  • 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+



  • I just link here our AWS lambda tutorial, if you haven't check it already, I recommend to give it a try.
    https://jsreport.net/learn/aws-lambda-serverless



  • 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.



  • 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?



  • I think the limit is 250MB for the extracted zip. Maybe you really reach it with the additional jsreport-aws-S3-storage installed.

    Can you try to have one lambda layer with the basic modules (jsreport). And the second layer with jsreport-aws-S3-storage?



  • Still working on the size difference issue. One good note (to self and others), when testing the S3 storage feature, restart after installing extensions!



  • 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!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.