Fork me on GitHub
#portkey
<
2017-08-22
>
viesti03:08:43

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).

viesti03:08:29

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

cgrand10:08:50

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

viesti10:08:14

yep, filtering it out now

viesti10:08:44

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

viesti11:08:10

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

viesti11:08:16

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

cgrand11:08:50

the problem is in your filetring out you prevent recursion

cgrand11:08:25

(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))))

cgrand11:08:38

(doto prn) is mine

cgrand11:08:16

the first entry is / so the loop exits immediatly

cgrand11:08:20

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

viesti11:08:08

my mistake to take a step toward early detection

viesti12:08:52

meh, heisenbug

cgrand13:08:35

heinsenbugs are tough but generally rewarding

viesti18:08:27

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

viesti18:08:02

should look how this could be configured with swagger