Fork me on GitHub
#datomic
<
2017-08-24
>
stijn15:08:14

Is there a way to reuse rules between queries in different transaction functions?

val_waeselynck09:08:52

Maybe send the rules as an argument to the tx fn ?

stijn19:08:22

good suggestion, thanks

mgrbyte15:08:23

@stijn only way I can think of is to write a transaction function that returns the rules, then use datomic.api/invoke to retrieve them in other transaction functions

mgrbyte15:08:34

without adding a library to the classpath on the transactor that is

andrea.crotti15:08:06

there are probably not a lot of nixos users using datomic, but at the moment all these commands using /bin/bash would fail on nixos

ag /bin/bash
bin/console
1:#!/bin/bash

bin/repl-jline
1:#!/bin/bash

bin/transactor
1:#!/bin/bash

andrea.crotti15:08:35

the fix is rather trivial, just /bin/bash -> /usr/bin/env bash, and it's generally better to use that form anyway

the-kenny16:08:49

andrea.crotti: just replace them with /usr/bin/env bash

andrea.crotti16:08:15

yeah I know that's the fix

andrea.crotti16:08:32

I was suggesting that they could fix it datomic

the-kenny16:08:40

whoops I thought this was the NixOS channel actually x) My bad!

andrea.crotti16:08:44

I can probably report it somewhere

the-kenny16:08:53

(I'm using Slack via the IRC gateway)

Ethan Miller17:08:05

Hey All, I'm deploying my little datomic project to aws instances, but the default c3.large is too expensive. I've been trying to use some of the smaller instances, but with no luck yet. Some of the possibilities like t2.small don't seem to be supported. If I try to run bin/datomic ensure-cf on properties file with that instance indicated, I get an error Key not found: t2.small. Does anyone know of a workable deploy with a cheaper instance?

Ethan Miller17:08:41

I'll give that a shot @marshall. Was hoping to try something a bit smaller, to save more money...

Ethan Miller17:08:25

Is there a list somewhere of which instances are available, and what specifically an instance needs to support in order to run a datomic transactor?

marshall17:08:07

@ezmiller77 If you look at the generated cf template JSON you’ll see a map of all instance types; theoretically you can use any of them - some folks have been able to get the transactor running on small/micro instances, but you’d need to heavily tweak heap and memory index settings

marshall17:08:21

if you have any substantial load, I would avoid burst instances

Ethan Miller17:08:12

I really don't have any substantial load at this point. Any links to guidance on tweaking heap and memory index settings would be much appreciated. Thanks!

marshall17:08:49

depends how much memory you’re working with; the JVM can (and will) require more than you specify with Xmx, plus you need some for your OS

marshall18:08:06

the memory-index-max will be taken from the heap

marshall18:08:16

so you need to reduce object-cache-max to allow that

marshall18:08:24

and/or reduce memory-index-max

marshall18:08:41

default is for object cache to take half of allocated heap

marshall18:08:34

for what it’s worth - claim to use a t2.small

Ethan Miller18:08:19

Oh yeah, I tried that (some of my commments below the answer there...) Wasn't able to get that to work in the end...

Ethan Miller18:08:26

Might try again when I have a moment.

marshall18:08:59

definitely need to adjust heap, probably object cache, maybe mem index max

petterik18:08:08

@ezmiller77 we're using t2.small transactors. When calling ensure-cf we use any key that's valid/found. Then we manually enter "t2.small":{"Arch":"64h"}, into the produced cf.json. My java options are: java-xmx=1500m and I don't remember having to change the object cache or mem index max

Ethan Miller18:08:23

@petterik : that sounds much like what the stackoverflow question that @marshall linked says. Maybe I need to give it another shot!

marshall18:08:37

@petterik @ezmiller77 http://docs.datomic.com/changes.html#0.9.5561.50 As of 0.9.5561.50 the ensure-cf script should work fine with t2.small (and pretty much all the other instance types)

marshall18:08:23

let me know if that’s not true, b/c it should be 🙂

Ethan Miller18:08:25

@marshall : good to know. If we are on a free version, we aren't able to upgrade is that right?

Ethan Miller18:08:36

I'm on an earlier version...

marshall18:08:55

depends when your Starter license maintenance period expires

marshall18:08:08

you can access updated versions until your maint. period ends (a year)

marshall18:08:22

@ezmiller77 Looks like you got Starter in Jan 2017, so your license key is valid for all versions up until Jan 2018

Ethan Miller18:08:07

then after that you are frozen at whatever version you are on?

marshall18:08:53

until you upgrade to a paid license

petterik18:08:22

@marshall I'm on 0.9.5561, but I'll let you know if specifying t2.small doesn't work when I upgrade 🙂