Fork me on GitHub
#datomic
<
2018-06-22
>
gdeer8100:06:46

yeah it is a real head scratcher

marshall00:06:00

Try switching server type to :cloud

marshall00:06:21

You are missing proxy port

marshall00:06:41

:proxy-port <local-port for SSH tunnel to bastion>

marshall00:06:02

Add the proxy port entry

gdeer8100:06:10

I couldn't ever figure out which port number to use so I just left it off and let it use the default port

marshall00:06:20

Doesnt work that way ;)

marshall00:06:47

If you used the one in the docs its 8182

marshall00:06:13

If you didnt overload on the socks proxy script

marshall00:06:42

But you do need to supply it in the cfg map @gdeer81

gdeer8100:06:41

okay, I set it to 8182 in the config map and it threw an error in my repl and the terminal where the proxy script was running terminated, so I restarted the proxy script and reran

(def client (d/client cfg))
and didn't get any errors, so it's working I guess? :man-shrugging::skin-tone-2:

gdeer8100:06:01

oh boy, now I can get to the fun part

gdeer8100:06:50

I spoke too soon >_<

user=> (d/create-database client {:db-name "movies"})
ExceptionInfo java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter  clojure.core/ex-info (core.clj:4739)

gdeer8100:06:15

probably just a java 9+ problem, I've seen something like this at work before

gdeer8101:06:11

in case anyone stumbles upon this conversation in the future: I had to update my deps.edn to add the module with an alias I named "my-ops"

{:deps
  {com.datomic/client-cloud {:mvn/version "0.8.54"}}
 :aliases
 {:my-ops {:jvm-opts ["--add-modules" "java.xml.bind"]}}}
Then I started up clojure with the command line flag -O to use it
clj -O:my-ops
and now I am able to do the thing I was trying to do for like two days now
user=> (d/create-database client {:db-name "movies"})
true
šŸ˜

gdeer8101:06:39

Thanks @marshall for your assistance with that config mess. I'll to try to find where I read that the proxy-port key defaults to something if not provided. not sure if I ran into bad docs or if grossly misread something šŸ™ƒ

marshall01:06:25

Np. Glad to help

sekao14:06:32

is it a bad idea to serve your appā€™s root html from an ion? iā€™m guessing the warmup time makes that impracticalā€¦

stuarthalloway14:06:14

@sekao it depend on usage patterns. Is your app in continuous use, and how many 9s of low latency response do you need?

stuarthalloway14:06:51

@sekao and if you are playing the long game, don't sweat the specifics of the current integration too much, we can offer other integrations besides the Lambda proxy in the future

Chris Bidler14:06:53

Iā€™m going to repeat a question from yesterday because I think it got lost in the surrounding discussion, but if it doesnā€™t get any bites this time I wonā€™t bother the channel again. šŸ˜‡

Chris Bidler14:06:58

question about Ions: if I run say items-by-type out of ion-starter at the REPL I get a nice pretty string with an array of arrays in it, suitable for such activities as deserializing into JSON when I invoke that ion as a Lambda, however, I get a nice pretty string that is the first string wrapped in a hashset (e.g., "#{[[...stuff...]]}") (edited) This presents a problem if I want to then deserialize the result of a Lambda execution somewhere. Is that extra #{...} wrapper Lambda the Ultimateā€™s doing? Is there a way to ā€œturn it offā€? (apologies if this is answered in the video above, which I havenā€™t gotten a chance to watch. Stupid linear time!)

Chris Bidler14:06:36

The use case here is that I have an example almost completely done showing how to set up AppSync and Cognito to work with Ions and I want to show the difference between doing the transformation of data shape between GraphQL and Lambda in a net-new ion vs. in the AppSync resolver VTL template (tl; dr: do you want to use Velocity when you have Clojure ready to hand, for data transform? You do not!)

Chris Bidler14:06:22

but the AppSync invocation of the items-by-type Lambda chokes on the #{ ... }

stuarthalloway15:06:18

@chris_johnson The answer is not immediately obvious to me, but the problem is almost certainly not in the Lambda. Why can't AppSync handle the set notation?

Chris Bidler15:06:58

because itā€™s not JSON

stuarthalloway15:06:10

items-by-type does not return JSON

stuarthalloway15:06:32

if you want it to do so, modify it to print JSON instead of printing edn

stuarthalloway15:06:22

and then I hope you will be good to go! Are you going to publish the example?

Chris Bidler15:06:07

Okay, that makes sense. I was hoping to be able to take just the raw edn string value and process it in VTL on the AppSync side, not because itā€™s a thing youā€™d want to do often but to demonstrate dropping AppSync ā€œontoā€ an existing ion, but AppSync tries to deserialize it before handing it off

Chris Bidler15:06:53

yeah, that gives me the information I need. I do already have an items-by-type-gql which returns JSON but itā€™s also doing the output data shaping.

stuarthalloway15:06:22

any name with more than two hyphens is doing too much šŸ™‚

stuarthalloway15:06:36

I-do-it-all-the-time-myself

Chris Bidler15:06:45

I do intend to publish this example just as soon as I get these last couple bits polished up and finish finding or creating enough cool memes to put in the README

Chris Bidler15:06:43

I will also go look again and see if thereā€™s a way to make the AppSync resolver expect a raw string instead of something it can parse into JSON, which would be delightful.

stuarthalloway15:06:09

once you are out in the broader AWS world you should probably be in JSON anyway šŸ˜ž

Chris Bidler15:06:25

I mean, they expose VTL for you to template the output! Why would they give you a possibly-Turing-complete tool for shaping the output data but insist on pushing it through JSON.readString first? :thinking_face:

madstap16:06:59

(Cross post from #clojure) I have what I think is a backup of a datomic database. It is a directory with the contents ./data/db/datomic.h2.db. Does this seem right? How do I translate that to a file:///home/... url? I am getting a clojure.lang.ExceptionInfo: :restore/no-roots No restore points available at error.

favila16:06:37

That's not a backup of a datomic db

madstap16:06:04

Oh, ok. I'll have to dig up the old computer I had the backups running on. Thanks!

favila18:06:43

that's a dev h2 database

favila18:06:57

i.e. what the datomic dev transactor uses to store its blobs

souenzzo16:06:20

Can I (or have plans) to generate a "amazon event that triggers a lambda" on every transaction on datomicIons?

eraserhd18:06:29

[(identity ?list) [[?e ?a "" _ true] ...]] seems to match any value. You can't use literals in this way, can you?

cjsauer18:06:37

My ion with API Gateway integration is responding with the body base64 encoded...what might I be doing incorrectly? :thinking_face:

stuarthalloway19:06:03

@cjsauer in the API Gateway test UI, or as viewed from e.g. curl?

cjsauer19:06:19

@stuarthalloway it's within the API Gateway UI, but I'm also seeing it happen within the Lambda console using a sample API Gateway event. My handler is returning a string in the response :body field.

stuarthalloway19:06:28

@cjsauer that is by design. You must make a gateway level choice about how to do this, and then Gateway will fix it on the way through

stuarthalloway19:06:42

the only way to see it the way you want is to consume all the way from the outside edge, e.g. from your browser or curl

cjsauer19:06:33

@stuarthalloway hm...even hitting it with curl returns a base64 encoded string. I'm testing at the REPL as well by doing (my-handler {:input (slurp "fixture.json")}) and am also seeing the encoding.

stuarthalloway19:06:25

maybe you left out "Choose Add Binary Media Type, and add the */* type, then Save Changes." from https://docs.datomic.com/cloud/ions/ions-tutorial.html#sec-5-3

stuarthalloway19:06:03

I left that out about 100 times when testing it ^^

cjsauer19:06:44

@stuarthalloway DOH...that was it!! Working now. Thank you! šŸ»

mtbkapp22:06:29

I don't have any experience running applications that require HIPPA compliance. I'm curious if anyone has ran Datomic in such an environment and if it would be possible to store HIPPA protected data in Datomic Cloud.

adammiller23:06:11

has anyone successfully used figwheel main along with datomic cloud client? It seems there are some dependency issues on the version of jetty that each one requires. if I try to use the version of jetty that datomic cloud api requires (9.3.7.v2016011) then figwheel can't connect...looks like it gets an error trying to create the websocket. If I use the version figwheel main relies on which looks to be (9.2.21.v20170120) then of course datomic cloud api gets errors trying to connect.

adammiller23:06:18

jetty seems to be the one library that is constantly frustrating when it comes to dependency management in clojure

adammiller23:06:27

i'm looking at that now

adammiller23:06:04

well but i'm in dev mode working on my app that utilizes the datomic client api....that's the issue. Figured it out with Bruce's help in the figwheel-main channel. If anyone else comes across the issue you just need to exclude the websocket libs from figwheel main then add the version matching the jetty client (9.3) in your top level deps.