This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-28
Channels
- # aws-lambda (2)
- # beginners (49)
- # boot (49)
- # cider (7)
- # clara (1)
- # cljsrn (4)
- # clojure (199)
- # clojure-android (49)
- # clojure-dev (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-norway (5)
- # clojure-russia (78)
- # clojure-spec (22)
- # clojure-uk (18)
- # clojurebridge (2)
- # clojurescript (252)
- # core-typed (2)
- # cursive (11)
- # data-science (1)
- # datascript (2)
- # datomic (38)
- # devcards (1)
- # flambo (3)
- # hoplon (10)
- # immutant (2)
- # jobs (3)
- # luminus (1)
- # lumo (2)
- # off-topic (8)
- # om (3)
- # onyx (29)
- # parinfer (1)
- # pedestal (4)
- # portkey (13)
- # re-frame (13)
- # reagent (6)
- # ring (3)
- # ring-swagger (15)
- # schema (2)
- # spacemacs (4)
- # test-check (4)
- # untangled (46)
- # yada (2)
#portkey2017-04-28
>
.zip
because it allows embedding deps as is (no need to unpack and repack or to have a clustom classloader)
the code is here https://github.com/cgrand/portkey/blob/master/src/main/clojure/portkey/core.clj#L143
what’s working: serialization/deserialization of the lambda and computation of the deps
For example serializing
(def stub
(reify com.amazonaws.services.lambda.runtime.RequestStreamHandler
(handleRequest [_ in out ctx]
(prn in out ctx))))
computes that only 4 interfaces are needed out of the AWS sdk so only these classes will be sentI haven’t tested yet (alpha testers welcome!) but portkey now produces things resembling a deployment package:
Clojure 1.9.0-alpha15
user=> (require ‘[portkey.core :as pk])
Preparing for self instrumentation.
Ouroboros succesfully eating its own tail!
Instrumenting clojure.lang.Var... done!
nil
user=> (pk/package! “prn.zip” prn)
“prn.zip”
and
$ unzip -t prn.zip Archive: prn.zip
testing: bootstrap.kryo OK
testing: com/ OK
testing: com/amazonaws/ OK
testing: com/amazonaws/services/ OK
testing: com/amazonaws/services/lambda/ OK
testing: com/amazonaws/services/lambda/runtime/ OK
testing: com/amazonaws/services/lambda/runtime/Client.class OK
testing: com/amazonaws/services/lambda/runtime/ClientContext.class OK
testing: com/amazonaws/services/lambda/runtime/CognitoIdentity.class OK
testing: com/amazonaws/services/lambda/runtime/Context.class OK
testing: com/amazonaws/services/lambda/runtime/LambdaLogger.class OK
testing: com/amazonaws/services/lambda/runtime/RequestStreamHandler.class OK
testing: lib/ OK
testing: lib/asm-5.0.3.jar OK
testing: lib/carbonite-1.4.0.jar OK
testing: lib/chill-java-0.3.5.jar OK
testing: lib/clojure-1.9.0-alpha15.jar OK
testing: lib/kryo-2.21.jar OK
testing: lib/kryo-3.0.3.jar OK
testing: lib/minlog-1.2.jar OK
testing: lib/minlog-1.3.0.jar OK
testing: lib/objenesis-2.1.jar OK
testing: lib/reflectasm-1.07-shaded.jar OK
testing: lib/reflectasm-1.10.1.jar OK
testing: portkey/ OK
testing: portkey/LambdaStub.class OK
testing: portkey/SerializerStub.class OK
testing: portkey/kryo.clj OK
testing: portkey/logdep.clj OK
No errors detected in compressed data of prn.zip.