5 ms·
Doesn't exposing the hardware under the lambda kinda defeat the point of the lambda?
by DeepYogurt 5y ago
Doesn't exposing the hardware under the lambda kinda defeat the point of the lambda?
- koolba 5y agoNot at all. If you want to run assembly code that targets a specific architecture you need to know what that architecture is going to be. At it’s heart Lambda is just a Linux container running a CGI app.
- aynyc 5y agoWhy would you run assembly on lambda?
- nightfly 5y agoSIMD is a thing
- stevemk14ebr 5y agoEverything is assembly, that's how your CPU works. If you run C code, rust, go whatever you have to Target an architecture so the compiler can generate the correct assembly instructions. Even python or js interpreters must be recompiled per each architecture you wish to run those languages in. Lambda doesn't change that, as the comment above says its just a container
- aynyc 5y agoThe whole point of container is to abstract away the underlying OS & hardware. If you need CPU architecture specific code, running it on lambda seem a bit pointless to me.
- monocasa 5y agoContainers are more about abstracting away kernel state tables, but not deeper env like processor arch. You can see this in how there was a lot of work into deploying aarch64 containers over the past year to support M1 docker. And lambda is more about changing the process lifecycle from traditional always using resources. Sort of the inetd for hyperscalers.
- aynyc 5y agoThe whole arch64 and docker is my point. I use docker to abstract that pain so I don’t have to care about (to a certain degree). If all of sudden, I need to worry about my underlying arch, then I might as well run on VMs. For lambda, it’s more of a micro-OS anyway than a generic docker container.
- monocasa 5y agoDocker explicitly doesn't abstract aarch64. That's why it took tons of work to build up the ecosystem this far and even then and still you'll come across public images that aren't multiarch.
- viraptor 5y agoI'm not sure what you mean by not caring about underlying arch. With docker you use an arch-specific image. The author may transparently provide multiple arch versions of the image, but I wouldn't call it abstracting. (not in the sense fat-binaries do for example) Specifically, if you then make your own app image on top of the base one, it will again need to be built for each architecture separately.
- detaro 5y agoHow does docker abstract arch64 for you?
- __turbobrew__ 5y agoThe default docker runtime does not run the containers in a VM but instead on top of the host kernel using namespaces. In this case the kernel which the container utilizes is the same kernel running the rest of the system. The container is limited by the CPU architecture and configuration of the underlying kernel. If your container runtime uses an emulator (say QEMU) you are able to run containers which do not match the host system, albeit at a slower speed than running the container using a matching architecture and namespaces.
- imtringued 5y agoHere is what you want: https://blog.cloudflare.com/webassembly-on-cloudflare-workers/ https://blog.cloudflare.com/webassembly-on-cloudflare-worker...
- tehbeard 5y agoBetter question, why wouldn't you? If you can compile the single task your lambda will perform down to as close to bare metal as possible, without affecting your workflow, why not? I use JavaScript in the few lambdas I have because of dev. ex. What little additional cost it would add offset by speed of development for me, and how important speed is to my tasks.
- aynyc 5y agoLambda is never meant for low latency CPU app, where speed is king, due to startup cost. I don’t see why you would run architecture specific code on lambda.
- estebarb 5y agoThere are languages like Go, Rust or C that are compiled. If your lambda uses compiled languages you need to recompile to the right platform. Additionally, a lot of interpreted languages depends on native libraries. You need to build those libraries using the right arch. It happens a lot if you want, for example, deploy a Rails app in Lambda. By the way, Lambda works great for low latency apps. The "startup cost" is negligible if you know how to implement it. You can serve ML models from a lambda, and in that case you want a math library optimized for the platform. Unless you have a lot of traffic a Lambda usually is cheaper.
- Rebelgecko 5y agoThere are plenty of usecases where latency isn't that important but speed is (e.g. reencoding an hour long video file)
- tehbeard 5y agoI wouldn't have a task that would quite so extensive on lambda (though tbh I don't know how it costs compared to aws' video encoder service) But in a similar vein, extracting interesting thumbnails would at scale, be one use case where lambda with assembly/compiled static bins may be a good choice.
- detaro 5y agoUnless you want to restrict lambda to only run interpreted code with interpreter & binary dependencies provided by AWS, or run things in emulation, you can't really hide it.
- acdha 5y agoIt's a question of how much you can do with the tool. If Lambda only supported, say, pure Python or Node libraries you'd run into cases where you couldn't use it or would see big performance penalties. Being able to push a container with, say, a high-performance image processing library which your Lambda needs makes it a lot more versatile but also forces you to think about things like x86 or ARM. Overall, I see that as a win: you can get started by putting code in something like Python or JavaScript and not caring but when you do hit more complex dependencies you have a path which is an extension of what you've already been using rather than having to switch to a completely different service like ECS.
- arduinomancer 5y agoHow would you use something like Go without knowing what you’re compiling for?