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).
@cgrand I still didn't figure out why amazonica test fails in resources-analysis branch :/
@viesti there’s a “/” entry in the zip
yep, filtering it out now
caused by the resource keeps somehow, the statics string seen by the analysis doesn’t always resolve
that is why I try with and without leading /
and keep resource that resolves that way
https://github.com/cgrand/portkey/blob/feature/resource-analysis/test/portkey/core_test.clj#L26
hmm
err
should maybe not create entry like that in the first place (don’t know what creates it)
the problem is in your filetring out you prevent recursion
(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))))
(doto prn)
is mine
the first entry is /
so the loop exits immediatly
but I agree, better not create “crap” in the first place rather than patch later.
my mistake to take a step toward early detection
meh, heisenbug
heinsenbugs are tough but generally rewarding
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
should look how this could be configured with swagger