Fork me on GitHub
#datomic
<
2019-12-15
>
Chris Bidler16:12:24

I have not encountered that problem but it sure sounds to me like a good use case for incorporating AWS Lambda Layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). I imagine that might run into trouble in that it would likely need to be the Cloud instance’s …instance… of Lambda the Ultimate that actually held the Layer refs, so if you had two Ions that wanted incompatible versions of the AWS SDK for example, that would hurt

Chris Bidler16:12:22

But I could definitely see a future state where Datomic Cloud exposes the machinery of Layers to help you slim down the dependency payload for a given Ion, it would just need to be thought through well (and for all I know, correctly incorporated with existing use of Layers - I have no visibility into how Lambda the Ultimate or Ions are actually implemented today)

kenny17:12:53

Ions don’t deploy to Lambdas. I think they already do an intelligent diff of dependencies, only uploading the ones that changed. It sounds like joshkh may want to increase a timeout of some kind.

Chris Bidler17:12:52

You’re correct, it was me who needed more time to think things through well. 🙂

joshkh18:12:38

thanks for the input @chris_johnson. one can never know too much about lambdas, and i will explore layers for sure. @kenny is right though - I'm not using lambdas at the moment, and i don't know of a way to increase this timeout.

dominicm19:12:19

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "PoolCleaner[2018699554:1576421257813]"
Exception in thread "Thread-4 (ActiveMQ-client-global-scheduled-threads-270014218)" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Thread-2 (ActiveMQ-client-global-scheduled-threads-270014218)" java.lang.OutOfMemoryError: Java heap space

I'm seeing this, does it mean that my query will never return? I'm doing some big queries. Will it recover?

onetom19:12:13

im trying to make an ion, but im getting back base64 encoded responses. is there a way to get non-encoded responses somehow?

(ns hodur-example-app.core)

(defn debug [payload]
  {:status 200
   :headers {"Content-Type" "text/plain"}
   :body    "debug"})

(def debug-ion (api-gateway/ionize debug))
datomic/ion-config.edn:
{:allow [hodur-example-app.core/debug-ion]

 :lambdas {:debug-ion
           {:fn hodur-example-app.core/debug-ion
            :integration :api-gateway/proxy}}
 
 :app-name "enterprise-sandbox"}
aws lambda invoke --function-name enterprise-sandbox-compute-debug-ion /dev/stdout:
{"statusCode":200,"headers":{},"body":"ZGVidWc=","isBase64Encoded":true}{
    "ExecutedVersion": "$LATEST", 
    "StatusCode": 200
}
where ZGVidWc= is indeed the expected debug response:
$ echo 'ZGVidWc=' | base64 -d
debug

onetom19:12:13

and if i expose the lambda via an API gateway, i do get the base64 content still:

$ curl -d '' 
ZGVidWc=