portkey

Portkey: from REPL to Serverless in one call
viesti 2017-08-22T03:20:43.000176Z

There are two parts/possibilities. One is replacing the current update function code with zip by writing to S3 first (we can monitor upload progress) and then passing S3 location to UpdateFunctionCode (a new lambda version gets created which has a slight delay). The more advanced part is to load new serialized code during lambda function invoke (still the first time the Lambda function is created there is initial delay).

viesti 2017-08-22T03:54:29.000117Z

@cgrand I still didn't figure out why amazonica test fails in resources-analysis branch :/

cgrand 2017-08-22T10:58:50.000303Z

@viesti there’s a “/” entry in the zip

viesti 2017-08-22T10:59:14.000306Z

yep, filtering it out now

viesti 2017-08-22T10:59:44.000066Z

caused by the resource keeps somehow, the statics string seen by the analysis doesn’t always resolve

viesti 2017-08-22T11:00:10.000042Z

that is why I try with and without leading / and keep resource that resolves that way

viesti 2017-08-22T11:00:57.000331Z

hmm

viesti 2017-08-22T11:00:59.000132Z

err

viesti 2017-08-22T11:01:16.000119Z

should maybe not create entry like that in the first place (don’t know what creates it)

cgrand 2017-08-22T11:01:50.000091Z

the problem is in your filetring out you prevent recursion

cgrand 2017-08-22T11:02:25.000082Z

(loop []
        (when-some [e (some-> (.getNextEntry zip) (doto prn)
                              (#(when-not (= “/” (.getName %)) %)))]
          (let [f (java.io.File. dir (.getName e))]
            (.deleteOnExit f)
            (if (.isDirectory e)
              (or (.mkdir f)
                (throw (ex-info (str “can’t create dir ” f) {:f f :e e})))
              (io/copy zip f))
          (.closeEntry zip)
          (recur))))

cgrand 2017-08-22T11:02:38.000230Z

(doto prn) is mine

cgrand 2017-08-22T11:03:16.000197Z

the first entry is / so the loop exits immediatly

cgrand 2017-08-22T11:05:20.000142Z

but I agree, better not create “crap” in the first place rather than patch later.

viesti 2017-08-22T11:39:08.000192Z

my mistake to take a step toward early detection

viesti 2017-08-22T12:55:52.000100Z

meh, heisenbug

cgrand 2017-08-22T13:05:35.000495Z

heinsenbugs are tough but generally rewarding

viesti 2017-08-22T18:24:27.000096Z

thinking of supporting lambda that returns binary (say ab image, a qr code perhaps) http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings.html

1👍
viesti 2017-08-22T18:25:02.000357Z

should look how this could be configured with swagger