Architecture combinations between lambdas and layers

0

Hi,

Any information or insights into what combinations of architectures work between lambdas and the layers attached to them? For example I have a lambda with two attached layers. One layer is arm64, one is x86_64.

If the lambda is built as an x86_64 this all works. If it's built as an arm64 lambda it doesn't (unmet dependencies errors):

WORKS:            lambda (x86_64) -> layer1 (arm64) -> layer2 (x86_64)
DOESN'T:          lambda (arm64)  -> layer1 (arm64) -> layer2 (x86_64)

Runtime is Nodejs18.x for everything.

How do layers work anyway? I thought they were like "included" files, but the fact that shared libraries and so on can be included suggests they're more like compiled/linked binaries. Any pointers would be very interesting.

David

dmb0058
posta 9 mesi fa239 visualizzazioni
2 Risposte
0

Lambda layers are just a way to add files to the lambda execution environment. All the files in the Layer (which is a zip file) are extracted to the /opt folder.

You should not mix them, however, if you are using a runtime like Python or Node which uses interpreted code, it may work. Python sometimes also includes binary dependencies, so that might cause issues. Not sure about Node.js.

profile pictureAWS
ESPERTO
Uri
con risposta 9 mesi fa
0

Thanks Uri,

That fits with what I'm seeing.

My guess is that the architecture of the lambda is used to select the hardware that it's run on:

x86 lambda (Node) + ARM layer (Node) + x86 layer (binary) would work when unbundled onto an x86 processor because the Node elements would be interpreted appropriately on either platform but wouldn't work if deployed to an ARM processor because the binary layer wouldn't run.

David

dmb0058
con risposta 9 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande