portkey

Portkey: from REPL to Serverless in one call
viesti 2018-06-09T05:11:37.000045Z

Invoke API has LogType parameter, which set to Tail (when InvokeType is RequestResponse) returns last 4kB of logs https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax

viesti 2018-06-09T05:11:56.000035Z

That might do it

viesti 2018-06-09T05:12:35.000086Z

aws cli has this wrapped, but we can use our lib :)

viesti 2018-06-09T06:01:57.000065Z

a bit shortened version of this instruction could help https://docs.aws.amazon.com/lambda/latest/dg/with-userapp-walkthrough-custom-events-invoke.html

viesti 2018-06-09T07:40:23.000100Z

but I guess people might already know how to get logs from Cloudwatch, in this particular case it might be that we swallow the actual cause

viesti 2018-06-09T07:45:05.000049Z

or say the java crypto classes, a field isnโ€™t serialized (I think) and stack just says โ€œnpeโ€: https://circleci.com/gh/portkey-cloud/portkey/62

2018-06-09T08:01:34.000135Z

baptiste-from-paris 2018-06-09T08:01:43.000065Z

ahh

baptiste-from-paris 2018-06-09T08:01:55.000068Z

love to see portkey growing ๐Ÿ˜„

viesti 2018-06-09T08:01:57.000096Z

so whipped a test for instaparse, similar serialization issue I think

viesti 2018-06-09T08:02:38.000054Z

maybe Iโ€™m pessimist but at least it breaths and is kind of warm ๐Ÿ™‚

baptiste-from-paris 2018-06-09T08:04:57.000018Z

lol

baptiste-from-paris 2018-06-09T08:05:04.000151Z

long term view

viesti 2018-06-09T08:05:12.000012Z

@viesti uploaded a file: https://clojurians.slack.com/files/U06QSF3BK/FB4CXRJ20/null.clj

baptiste-from-paris 2018-06-09T08:05:12.000125Z

so far itโ€™s still growing

viesti 2018-06-09T08:06:22.000045Z

yeah, along these lines https://twitter.com/richhickey/status/1004757794183106560

viesti 2018-06-09T08:07:24.000014Z

last summer had many more of these exceptions, should not forget my veteran status ๐Ÿ™‚

baptiste-from-paris 2018-06-09T08:08:12.000075Z

lol, true !

viesti 2018-06-09T08:09:48.000082Z

https://circleci.com/gh/portkey-cloud/portkey/65

baptiste-from-paris 2018-06-09T08:33:32.000103Z

so, you will find an example of the generated fns ser and resp in here

baptiste-from-paris 2018-06-09T08:34:15.000021Z

it compiles but there is an error in resp generation (quick fix, I just donโ€™t destructure the input)

baptiste-from-paris 2018-06-09T08:35:11.000036Z

and we still have ser-create-function-request somehow ๐Ÿ˜ž

baptiste-from-paris 2018-06-09T08:37:43.000123Z

nope fixed

baptiste-from-paris 2018-06-09T08:37:47.000124Z

sorry for spaming

baptiste-from-paris 2018-06-09T08:41:16.000098Z

next step => 1) fix destructuring for resp 2) integrate with the existing -rest-json-call

baptiste-from-paris 2018-06-09T08:41:20.000050Z

and make it work ๐Ÿ˜„

cgrand 2018-06-09T08:42:52.000093Z

@baptiste-from-paris had a quick glance: dudnโ€™t you switch resp and req?

baptiste-from-paris 2018-06-09T08:43:13.000080Z

no no, reload the file

baptiste-from-paris 2018-06-09T08:44:11.000118Z

ser does serialization & resp gather inputs by request type and required inputs

baptiste-from-paris 2018-06-09T08:44:26.000092Z

(clojure.core/defn resp-list-event-source-mappings-request [resp-input48914] (clojure.core/cond-> {} (clojure.core/contains? resp-input48914 "EventSourceArn") (clojure.core/assoc-in [:query-string "EventSourceArn"] (ser-arn resp-input48914)) (clojure.core/contains? resp-input48914 "FunctionName") (clojure.core/assoc-in [:query-string "FunctionName"] (ser-function-name resp-input48914)) (clojure.core/contains? resp-input48914 "Marker") (clojure.core/assoc-in [:query-string "Marker"] (ser-string resp-input48914)) (clojure.core/contains? resp-input48914 "MaxItems") (clojure.core/assoc-in [:query-string "MaxItems"] (ser-max-list-items resp-input48914))))

baptiste-from-paris 2018-06-09T08:44:44.000008Z

for example

cgrand 2018-06-09T08:48:32.000101Z

Resp is for response not for request > resp gather inputs by request type

baptiste-from-paris 2018-06-09T08:48:47.000033Z

looool

baptiste-from-paris 2018-06-09T08:49:03.000039Z

itโ€™s just a little typo

baptiste-from-paris 2018-06-09T08:49:05.000035Z

๐Ÿ˜„

cgrand 2018-06-09T08:49:31.000036Z

Thatโ€™s what I said :-)

baptiste-from-paris 2018-06-09T08:49:44.000017Z

req/resp, who cares ? ๐Ÿ˜„

baptiste-from-paris 2018-06-09T08:49:45.000034Z

loool

baptiste-from-paris 2018-06-09T08:50:15.000093Z

I really need to leave paris for few days ๐Ÿ‘Œ

cgrand 2018-06-09T08:50:44.000027Z

Only us who deal with code gen. Letโ€™s all agree to mentally switch request and response.

baptiste-from-paris 2018-06-09T08:51:18.000003Z

lol, Iโ€™ll fix it immediatly, was it req<- ?

cgrand 2018-06-09T08:51:44.000130Z

Iirc yes

baptiste-from-paris 2018-06-09T13:13:41.000074Z

so I just fixed destructuring for req<-*, it should be close to something working

baptiste-from-paris 2018-06-09T13:32:49.000092Z

so this function request =>

baptiste-from-paris 2018-06-09T13:32:53.000037Z

(req<-create-alias-request {:function-name "The Name" :name "kikoulol" :function-version 3})

baptiste-from-paris 2018-06-09T13:32:55.000069Z

gives =>

baptiste-from-paris 2018-06-09T13:33:10.000029Z

{:uri {"FunctionName" "The Name"}, :body {"Name" "kikoulol", "FunctionVersion" 3}}

baptiste-from-paris 2018-06-09T13:33:19.000067Z

all this work for this ๐Ÿ˜‚

viesti 2018-06-09T13:41:02.000091Z

portkey setting hair on fire? :)

baptiste-from-paris 2018-06-09T13:41:17.000073Z

lol