GithubHelp home page GithubHelp logo

Comments (4)

duartemendes avatar duartemendes commented on August 12, 2024

Yes, that's what's happening behind the scenes and that's exactly what it's needed according to the lambci docs.

I just need to think a bit about the scenario where a SAM template is using several layers, and each function uses different layers. The CLI will probably need to accept a mapping of layers names to their paths. Does this makes sense?

from aws-sam-api-proxy.

S-Cardenas avatar S-Cardenas commented on August 12, 2024

This makes sense, but why would we have to supply the mapping via the cli? Couldn't the CLI parse the SAM template and deduce which functions have layers and then read the path.

I think we also have to take into consideration the case where a layer is specified locally, and the case where the layer is already on AWS and defined by an ARN. When it's defined by an ARN we would need to pull that image down from AWS, store it somewhere, and then run it as a separate container or volume.

from aws-sam-api-proxy.

duartemendes avatar duartemendes commented on August 12, 2024

Okay, I haven't used layers for some time but here is my understanding, let me know what you think.

For any of the following cases, we would have to, at startup, create a folder for each function, in which it would have the necessary function layers code, extracted. This folder would then be used for the docker volume.

  1. Layer is ARN

We'll need to download layer from AWS and store the extracted content (cache needs to take in consideration the layer version).

  1. Layer is a reference to a local resource of type AWS::Serverless::LayerVersion
  • ContentUri is AWS S3 Uri or LayerContent - same as when layer is ARN but zip download is made from the given S3 bucket.

  • ContentUri is a local file path - No need to download anything, just copy the content and make sure the runtime folder is being respect as stated in here.

from aws-sam-api-proxy.

duartemendes avatar duartemendes commented on August 12, 2024

@S-Cardenas Thanks for your interest but supporting layers requires a really big effort and I don't think it's worth it, as the sam cli team has already announced that they will tackle the keep container warm issue.

Said this, if you still want layers support and don't mind getting your hands dirty, I'm more than happy to provide an hand 👍

from aws-sam-api-proxy.

Related Issues (6)

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.