Fork me on GitHub
#datomic
<
2018-10-19
>
stijn08:10:54

we're seeing some exceptions during the compilation of an ion deploy. the instance terminates itself in this case and then we can deploy. it looks like it happens every other deploy. Anyone else have seen this?

stijn09:10:53

maybe, the answer lies in using a different http lib for making requests. the ion-event-example uses cognitect.http-client https://github.com/Datomic/ion-event-example/blob/master/src/datomic/ion/event_example.clj#L27

stijn09:10:53

is there some documentation about that library? and since it's not in the dependencies, I assume it is available on ions by default?

jeroenvandijk12:10:47

Are session credentials support in the dynamodb connection string? E.g.

"datomic:"
 
I've tried several combination (aws_security_token, session_token, leaving it out). But no luck so far. The error I get is:
com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: The security token included in the request is invalid.
This is telling me that AWS supports it, but I can't tell if Datomic forward this information.

jeroenvandijk12:10:46

Cool, found a working thing via system properties:

(defn with-system-properties [props f]
  (let [p (System/getProperties)]
    (try
      (doseq [[k v] props]
        (System/setProperty k v))
      (f)
      (finally
        (System/setProperties p)))))

 (with-system-properties
            {"aws.accessKeyId" (.getAWSAccessKeyId credentials)
             "aws.secretKey" (.getAWSSecretKey credentials)
             "aws.sessionToken" (.getSessionToken credentials)}
           (d/connect uri))

Chris12:10:47

Can anyone advise if it's more performant to use Java method calls in a :where clause or Clojure? Many examples I see online use Java but it's not clear what the reason is. e.g. [:find ?e :where [?e :person/name ?n] [(.startsWith ^String ?n "Jo")]] vs [:find ?e :where [?e :person/name ?n] [(clojure.string/starts-with ?n "Jo")]]

Chris12:10:50

Or is it just for brevity because a function outside clojure.core needs to be fully qualified?

jeroenvandijk12:10:47

@cbowdon clojure.string/starts-with has been added in clojure 1.8 [see 1]. So these are probably old examples [1] https://clojuredocs.org/clojure.string/starts-with_q

Chris13:10:42

@jeroenvandijk Ah that makes sense, thank you

jeff.terrell15:10:31

If anybody has figured out how to do isolated dev environments with Datomic Cloud in a way that you're satisfied with, I'd be interested in your thoughts here: https://forum.datomic.com/t/any-ideas-for-isolated-dev-environments-with-datomic-cloud/663

jeff.terrell15:10:36

Yes, and I'm not sure that helps, but is there something in particular you're thinking about? Query groups maybe?

jeff.terrell15:10:13

And also, are query groups only for the production topology? I couldn't figure that out from the docs (although maybe I'm just missing it).

marshall15:10:48

Yes, query groups can help with some of that. Yes, production only.

jeff.terrell15:10:46

OK. I'm thinking that's more than I can afford at the moment. I don't suppose y'all have any plans to include the client API in Datomic Free Edition, do you?

jeff.terrell15:10:33

Although, now that I'm checking the price (using the estimator on AWS marketplace), it looks like it might be as little as about $1.50/day all-in for a production topology with query groups. As a sanity check, does that sound realistic to you? (Maybe it matters that I'm still in the free tier on this account?)

marshall15:10:46

I think it’d be a bit more than that IIRC a “default” production topology with 2 compute nodes runs around $400 or so a month

marshall15:10:56

infrastructure + software

jeff.terrell15:10:38

OK. Thanks for the sanity check. Not sure how I was estimating that so wrongly. simple_smile Thanks for all the help, by the way.

ro615:10:06

I guess Ions users are hanging out here more than #ions-aws? Doesn't seem to be much activity there.

ro615:10:05

Is there a way to specify to Ions that you want a certain set of tools.deps aliases to be used when you push/deploy? I guess by default the JVM process+classpath is constructed from the top level deps.edn specification without any aliases merged in?

grzm16:10:39

In Ions, is there a way to piggyback custom code on the validate step during deploy? For example, confirming that the equivalent of -main started without error?

ro618:10:46

Second. I'm wondering about the JVM init process in general with Ions.

ro618:10:49

For example, if I want to set a global uncaught exception handler (as recommended here: https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions), which I'd normally do once in -main, what's the best place to do that in Ions?

luchini14:10:13

I’ve been using the very entry-point function to do all sorts of global system setup and, wherever possible, memoizing things along the lines of the Datomic sample app.

luchini14:10:51

I’m not pretty sure I like this approach so I’m monitoring whether it scales well.

jeff.terrell17:10:51

I notice that the latest version of com.datomic/client-cloud on Maven is v0.8.66 [1], but that version is not listed on the releases page of Datomic Cloud [2]. Is v0.8.66 not an officially supported version? Asking because I encountered a problem with it [3] (which may not be its fault; I dunno). [1] https://search.maven.org/artifact/com.datomic/client-cloud/0.8.66/jar [2] https://docs.datomic.com/cloud/releases.html#current [3] https://github.com/ComputeSoftware/datomic-client-memdb/issues/2

pre17:10:08

Does Datomic support SQL Server? The documentation includes three other sql databases.

ro618:10:49

For example, if I want to set a global uncaught exception handler (as recommended here: https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions), which I'd normally do once in -main, what's the best place to do that in Ions?

joshkh19:10:31

a few hours ago our applications running on AWS lost their connection to datomic cloud, as did my ability to connect locally via the socks proxy. is there an easy way to debug this? we're getting the following error:

{:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message "Total timeout elapsed",...
the docs describe this as a likely configuration error but nothing has changed locally or internal to the VPC.

joshkh19:10:20

(or the following.. but i'm not sure how to recover or why it killed our silo'ed applications https://docs.datomic.com/cloud/transactions/transaction-processing.html#timeouts)

ro621:10:32

Unable to deploy:

$ clojure -Adev -m datomic.ion.dev "{:op :push :uname \"jvm-init-test-1\"}"

{:command-failed "{:op :push :uname \"jvm-init-test-1\"}",
 :causes
 ({:message "Map literal must contain an even number of forms",
   :class RuntimeException})}

ro621:10:05

same error with $ clojure -Adev -m datomic.ion.dev '{:op :push :uname "jvm-init-test-1"}'

Joe Lane21:10:05

try without dashes in the uname OR remove the double quotes and try it as a symbol.

Joe Lane21:10:40

Let me know how it goes @robert.mather.rmm

ro622:10:11

Not so good...

ro621:10:54

no dashes: "{:op :push :uname \"jvminittest1\"}" -> same fail as keyword:

{:command-failed "{:op :push :uname :jvminittest1}",
 :causes
 ({:message "Incorrect args for :push",
   :class ExceptionInfo,
   :data
   #:clojure.spec.alpha{:problems
                        ({:path [:uname],
                          :pred datomic.ion.dev.specs/name?,
                          :val :jvminittest1,
                          :via
                          [:datomic.ion.dev.specs/push-args
                           :datomic.ion.dev.specs/uname],
                          :in [:uname]}),
                        :spec :datomic.ion.dev.specs/push-args,
                        :value {:op :push, :uname :jvminittest1}}})}
-> Spec fail, probably the keyword in that position doesn't satisfy datomic.ion.dev.specs/name?

ro621:10:37

Maybe it's the way my shell is escaping the string?

ro621:10:49

sorry, you said symbol

ro622:10:10

as symbol: "{:op :push :uname jvm-init-test-1}" -> same fail (odd number of forms) as symbol without dashes: "{:op :push :uname jvminittest1}" -> same fail

ro622:10:55

@joe.lane If I want to escalate this a bit more, do you think the dev forum or the Cognitect support case system is better?

Joe Lane22:10:44

clojure -A:dev -m datomic.ion.dev '{:op :push :uname "some-uname"}'

Joe Lane22:10:54

When I push an Ion, it looks like this

Joe Lane22:10:20

Note the single quotes and how i’m not escaping the double quotes.

Joe Lane22:10:34

Does this also not work for you? Because this works for me several times per day.

ro622:10:07

yep, that was my first attempt. I think it may be a shell issue. I'm running Bash on Debian on the Windows Subsystem for Linux (WSL)

Joe Lane22:10:41

Weird, because the first one you posted here contains escaped double quotes.

ro622:10:30

Yeah, I had tried a few by that time

Joe Lane22:10:59

what if you commit a WIP then push?

ro622:10:48

ok, now it's a for real problem: $ clojure -A:dev -m datomic.ion.dev '{:op :push}'

{:command-failed "{:op :push}",
 :causes
 ({:message "Map literal must contain an even number of forms",
   :class RuntimeException})}

ro622:10:34

@joe.lane What is your com.datomic/ion-dev version?

Joe Lane22:10:14

Something tells me the issue isn’t in the library. 0.9.176 is the version.

ro622:10:42

I'm on "0.9.176" as well, which is also the one Stu used in the event example

ro622:10:50

I agree, just covering the bases

ro622:10:11

It's weird though, because I have pushed successfully before from this shell

Joe Lane22:10:55

What were the last 5 things you did before trying to push? Can you eval them in the repl and confirm they dont have typos?

Joe Lane22:10:08

Do you have a typo in your ion-config?

ro622:10:48

haha, yes I do.

ro622:10:45

@joe.lane Thank you sir.

👍 4
ro622:10:11

Error message definitely could have pointed a bit better, but I still feel stupid...

Joe Lane22:10:03

Don’t feel stupid, happens to all of us.

💯 4