Fork me on GitHub
#datomic
<
2016-12-13
>
tengstrand11:12:20

We are using pull queries to read nested data structures from the database. Now we plan to add extra information to the :db/txInstant entity about who made the change. Is it possible to use the pull syntax to read all the attributes as before but also “join” in :db/txInstsant with the extra information for every attribute in the pull query?

karol.adamiec11:12:08

wrapping a clojure peer library in a docker causes it to throw com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain . Works if i fire up standalone uberjar locally, but wrapped in docker fails. Any ideas how to make it talk?

karol.adamiec12:12:05

come on guys, surely people do put clojure peer library into docker ? no?

stijn12:12:10

sure, but not on AWS

karol.adamiec12:12:17

i try to run it locally for now

karol.adamiec12:12:26

with dynamo db transactor on aws

karol.adamiec12:12:37

i am clearly missing sth stupid

karol.adamiec12:12:11

i do not understand what credentials it talks about even. i am using iam roles anyway….

robert-stuttaford12:12:11

@karol.adamiec do your docker containers receive iam creds? can you ssh into one and use the aws cli to connect to stuff?

robert-stuttaford12:12:39

@teng d/pull can’t reach T values for EAVs. think about it. where would it go?

robert-stuttaford12:12:06

only if you put a tx id in as your eid will you get db/txInstant. same for d/entity.

karol.adamiec12:12:11

@robert-stuttaford there is no aws cli inside of the container...

robert-stuttaford12:12:35

my point: debug the issue like you would any other bug 🙂

robert-stuttaford12:12:47

poke it with a stick until it twitches

karol.adamiec12:12:19

i am headbanging that for some time now

karol.adamiec12:12:48

are there any magic ports that need to be open for the peer library?

robert-stuttaford12:12:44

what storage are you using?

robert-stuttaford12:12:46

pretty sure there’s a reference for this

karol.adamiec12:12:07

yeah i tried mapping 4334, nothing changes

karol.adamiec12:12:27

will set up the AWS_ keys hardcoded for now, maybe that will help

robert-stuttaford13:12:03

does the container have ddb access via the iam instance profile?

karol.adamiec13:12:29

it is local on my dev machine

robert-stuttaford13:12:33

what does the full stacktrace show @karol.adamiec — what part of datomic is trying to do AWS?

karol.adamiec13:12:35

so dont know ;/

robert-stuttaford13:12:53

oh. then you need to set explicit aws keys always

robert-stuttaford13:12:32

you said you’re using iam roles. i took that to mean you’re working on an instance. what did you mean by iam roles?

robert-stuttaford13:12:45

did you mean aws cli profiles?

karol.adamiec13:12:46

well, all my aws setup is on roles

karol.adamiec13:12:57

i do have aws cli installed locally

robert-stuttaford13:12:04

afaik the peer library doesn’t use aws profiles at all

karol.adamiec13:12:06

that is why maybe it works when i run the jar

robert-stuttaford13:12:12

i added it as a feature request via the new system

robert-stuttaford13:12:32

aws key + secret need to be in your env or otherwise provided as java props

karol.adamiec13:12:58

well, the only mystery is how it works then i run java -jar

karol.adamiec13:12:10

must pick up stuff from aws-cli

robert-stuttaford13:12:13

do you have aws key/secret in your env? env | grep AWS

robert-stuttaford13:12:59

are you connecting to ddb in aws from your local machine?

karol.adamiec13:12:31

repl or my little project i made that integrates peer lib

robert-stuttaford13:12:07

it must be doing something fancy then. datomic doesn’t support profiles afaik

robert-stuttaford13:12:15

anyway. set keys in your env and it’ll work

karol.adamiec13:12:24

yeah, thanx Robert 🙂

karol.adamiec13:12:43

i got sidetracked by not seeing keys in my env...

karol.adamiec13:12:41

btw: are aws access keys needed even when container runs on ecs?

karol.adamiec13:12:54

or only for outsiders?

robert-stuttaford13:12:01

no idea. never run docker once in my life

karol.adamiec13:12:46

works. jeeesuss.. 🙂

karol.adamiec13:12:13

on the good news front, no more javascript datomic silliness 😄

marshall15:12:40

@casperc Can you expound on “ages” ? My general first approach would be to query the log to get the set of EIDs for a specific transaction (based on the import id)

uwo19:12:22

not really a datomic question but, is there a way to get pprint to print tempids as tagged literals instead of like {:part :db.part/user :idx -123}

matystl20:12:09

Hi Is there posibility to update some parts of nested component if i know only its parrent id?

;Schema
{:db/ident :someAttribute
 :isComponent true}
;Data
{:db/id 11 :someAttribute 12}
{:db/id 12
 :nestedAttributeA "aa"
 :nestedAttributeB "bb"}
;Transaction that will replace whole subcomponent
(d/transact conn [{:db/id 11 :someAttribute {:nestedAttributeA "cc"}}])
Result of this is i lost information about :nestedAttributeB and i would like to just change value of :nestedAttributeA

wei23:12:34

does datomic support joint uniqueness? i.e. constrain that user/prop1 and user/prop2 together are unique

val_waeselynck23:12:20

basically, you can either enforce this via transaction functions, or encode the 2 attributes into a scalar "compound" :db/unique attribute

tjtolton23:12:06

Okay, guys, so help me strategize. We're building out a new service that keeps historical data, but I'm a new hire, and the effort to get datomic into our tech stack is going to take some time. HOWEVER, I think I have some pull in how we structure our data in Postgres

tjtolton23:12:49

what's the best way to structure data so that it can be easily forward compatible with datomic?

val_waeselynck23:12:55

@tjtolton from what I heard translating a relational schema to a Datomic schema is usually pretty mechanical. I think the most important thing to do in the first place is avoid relying on overwriting stuff.