portkey

Portkey: from REPL to Serverless in one call
viesti 2019-01-08T06:32:07.023500Z

hmm

viesti 2019-01-08T06:34:57.025400Z

So I was listening to the repl podcast, interview with Antonio

viesti 2019-01-08T06:35:28.026100Z

in the interview, he mentioned an idea on having a Lambda layer with Lumo

viesti 2019-01-08T06:37:33.027200Z

so what if there would be a retake on portkey proper, this time on cljs...

viesti 2019-01-08T06:56:41.028500Z

thing with Lumo (needs a maintainer btw.) that it is more self-contained for dev time use

viesti 2019-01-08T06:59:48.029400Z

this of course would mean that the Ouroboros things would be quite different…

cgrand 2019-01-08T08:39:37.030400Z

@anmonteiro was quite enthusiastic about portkey after our original demo

cgrand 2019-01-08T08:42:43.032600Z

I looked in V8, and JavaScriotCore at the time and found nothing that could help make portkey-like state serialization possible (I found no public debug api for example)

cgrand 2019-01-08T08:43:41.033500Z

A wild idea was to use a metainterpreter (like Narcissus) locally to be able to capture ad serialize state

viesti 2019-01-08T11:46:33.034400Z

this state serialization is interesting thing, but am I too depressed in thinking on how to avoid it? 🙂

cgrand 2019-01-08T11:47:02.034800Z

then isn’t it ions?

cgrand 2019-01-08T11:47:46.035500Z

v8 snapshots could have been an option too

viesti 2019-01-08T11:47:55.035900Z

yeah well, Ions treat lambda just as enabler, a proxy

viesti 2019-01-08T11:48:05.036100Z

not as a compute platform

viesti 2019-01-08T11:48:37.037100Z

I’m thinking that there are use cases on doing some computation in the Lambda

cgrand 2019-01-08T11:48:42.037400Z

yeah but deployment model should be similar (without state capture) no?

viesti 2019-01-08T11:48:54.037700Z

and for stuff that people normally do, they use some amount of libraries

viesti 2019-01-08T11:49:06.038100Z

one needs to deploy user code and make libs available

viesti 2019-01-08T11:49:19.038300Z

yeah, true that point

viesti 2019-01-08T11:49:43.038900Z

you get to code JVM/Clojure even

cgrand 2019-01-08T11:49:58.039300Z

There are so many use cases

viesti 2019-01-08T11:50:03.039500Z

hmm, but the startup time

viesti 2019-01-08T11:50:06.039800Z

yeah

viesti 2019-01-08T11:50:28.040600Z

on startup time, the JVM on the datomic query group restarts, no?

cgrand 2019-01-08T11:50:35.040900Z

“AWS lambda the ultimate coprocessor”

cgrand 2019-01-08T11:50:47.041300Z

no idea

viesti 2019-01-08T11:50:50.041500Z

if code would be deployed to a hot JVM then there would be less startup time

viesti 2019-01-08T11:51:08.042Z

there are analogies, like “real time” in analytics 🙂

viesti 2019-01-08T11:51:16.042300Z

not real time as in chips 🙂

viesti 2019-01-08T11:51:43.042900Z

I think you have a good sales pitch there 🙂

viesti 2019-01-08T11:51:57.043100Z

so hmm

viesti 2019-01-08T11:52:15.043400Z

is the state serialization then the killer in portkey?

viesti 2019-01-08T11:52:43.044300Z

is “killer” a term for something unique and non-replacable? 🙂

cgrand 2019-01-08T11:53:10.045Z

the killer as in “the hairy stuff that no one wants to work on and that keeps the project from moving forward”?

😁 2
viesti 2019-01-08T11:53:17.045300Z

😄

viesti 2019-01-08T11:53:25.045700Z

you read between the lines 🙂

cgrand 2019-01-08T11:53:31.045900Z

ah more like killer feature

viesti 2019-01-08T11:53:38.046200Z

yeah

viesti 2019-01-08T11:54:04.046800Z

well I think just the “from repl to cloud” is a neat thing

viesti 2019-01-08T11:54:34.047700Z

https://zeit.co/ without pushing code even

cgrand 2019-01-08T11:54:36.047900Z

not a killer feature but something different enough to open new use cases (offload compute to AWS)

viesti 2019-01-08T11:55:05.048300Z

everyone is already in AWS nowadays 🙂

viesti 2019-01-08T11:55:17.048600Z

or well, not my repl now

viesti 2019-01-08T11:55:29.048900Z

or maybe this is matrix illusion

cgrand 2019-01-08T11:55:59.049600Z

I haven’t looked into custom runtimes, but could we use criu?

viesti 2019-01-08T12:04:42.049900Z

criu?

viesti 2019-01-08T12:06:00.050400Z

aa https://criu.org/Main_Page

viesti 2019-01-08T12:07:24.052300Z

lambda layers are zip packages (5 at max) that are extracted onto the Lambda runtime, each ontop of each other (edit: layers)

viesti 2019-01-08T12:07:42.052900Z

äh

viesti 2019-01-08T12:10:13.054400Z

custom runtime is a way to expose a cross platform api for running a lambda https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html

viesti 2019-01-08T12:13:28.055600Z

what was the thing in common lisp where your make the process exit and serialize its state to create an executable

viesti 2019-01-08T12:14:13.056600Z

Lumo uses V8 snapshotting, JVM has some form of snapshotting mechanism too (class sharing thing, I forget the canonical name/link to it’s documentation)

viesti 2019-01-08T12:14:52.057200Z

Criu seems to be more general tool

cgrand 2019-01-08T12:16:54.057500Z

JVM has snapshotting !?

cgrand 2019-01-08T12:17:44.058500Z

Given https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html it may be possible to restore a on Lambda a process checkpointed on the client

viesti 2019-01-08T12:19:19.059300Z

> When the JRE is installed using the installer, the installer loads a set of classes from the system Java Archive (JAR) file into a private internal representation, and dumps that representation to a file called a shared archive. If JRE installer is not being used, then you can generate the shared archive manually. > > When the JVM starts, the shared archive is memory-mapped to allow sharing of read-only JVM metadata for these classes among multiple JVM processes. The startup time is reduced thus saving the cost because restoring the shared archive is faster than loading the classes.

viesti 2019-01-08T12:19:56.060Z

but this seems not to make a big impact: https://mjg123.github.io/2017/10/04/AppCDS-and-Clojure.html

viesti 2019-01-08T12:20:39.060500Z

uuh, pull the coprocessor state from the cloud into my laptop

viesti 2019-01-08T12:21:41.060700Z

> The benefit of regular CDS is going to be greater when your app loads fewer classes - ie when the core Java classes make a large proportion of your app. So for a larger app we need to look beyond regular CDS.

viesti 2019-01-08T12:21:55.061200Z

hmm, I thought that one could include user classes into the dump also

viesti 2019-01-08T12:42:16.061600Z

Re: pull the coprocessor state from the cloud. Misunderstood “restore a on Lambda a process checkpointed on the client”, but yeah

baptiste-from-paris 2019-01-08T13:05:42.062Z

great read !