Fork me on GitHub
#onyx
<
2016-08-23
>
jeroenvandijk10:08:57

Hi all, we are experimenting with an information model for our own application in order to generate specs, documentation, and maybe later if succesful API’s etc. We’re trying to connect the dots that are in onyx-cheat-sheet, onyx core and static analysis, but some things don’t directly add up. For instance I was wondering whether :restrictions is used for validation, and if so, how. Is there some resource that explains the way you have designed the information model maybe?

mariusz_jachimowicz10:08:31

it seems that :restrictions are only simple developer friendly descriptions, not used during schema processing

lucasbradstreet10:08:25

That’s right. We kinda skip building predicates out of the restrictions key, and build them with schema in schema.clj. :restrictions is used for documentation / error messages when these predicates fail

lucasbradstreet10:08:48

The way we built it is we built the schemas first, and then we went and built the information model, and built as much of the schema as we could from it easily. The pieces that seemed like they’d take too much time we left for later, and just added as documentation in the information model. We’ll get around to finishing the job at some point. Maybe once spec is released.

zamaterian11:08:30

I’m having trouble submitting my job to a peer running i a docker container., it seems the catalogs fails to load with a clojure.lang.ExceptionInfo: Could not resolve symbol on the classpath, did you require the file that contains the symbol : :onyx.plugin.sql/read-rows INFO [onyx.log.failure-detector:36] - Starting peer failure detector INFO [onyx.log.failure-detector:30] - Stopping peer failure detector monitor thread

lucasbradstreet11:08:07

Did you require onyx.plugin.sql in the namespace that your peer starts up in?

lucasbradstreet11:08:14

i.e. the one that calls start-peers

mccraigmccraig11:08:19

i did a simple repl dev implementation on top of a new onyx-template project https://www.refheap.com/122498 https://www.refheap.com/122499 @lucasbradstreet - happy to turn it into an onyx-template PR if you want ?

lucasbradstreet11:08:46

That does look good, and would be useful. I’d like to hear what @gardnervickers thinks since he’s behind the job registration bits, and I’d like to make sure it fits in with his vision before you make the effort

mccraigmccraig11:08:08

sure - it doesn't quite fit with the lib-onyz/start-peer fn now (i had to replicate its function because it doesn't return anything), so it might make sense to adapt that too

Travis16:08:07

@lucasbradstreet: Well I didn’t think it was possible but we made it worse, lol

lucasbradstreet16:08:00

Any idea what you changed?

Travis16:08:36

Well we attempted to roll our own create-state-update / apply. Not sure if we didn’t something really bad here

lucasbradstreet16:08:00

Ah k. So tell me what you’re doing in each

Travis16:08:43

so in the create we check to see if we have seen a key before ( initialize if not ) or pull the old one out of the state and then apply the changes

Travis16:08:05

the apply all we are doing is checking for the change log type and writing the :set-value

lucasbradstreet16:08:29

And is the set-value the coll of segments?

Travis16:08:01

in this case i think its just a single segment ( a collapsed form based of our Key ).

Travis16:08:22

but honestly i am not sure how it relates to all the different keys

Travis16:08:41

kind of trying to do our own collect-by-key

lucasbradstreet16:08:43

Maybe you could paste the aggregation in here, or to me in a PM, assuming it’s not doing much that’s secret

Travis17:08:07

trying to see if we are allowed, might not be able to 😫

lucasbradstreet17:08:28

k, basically the main issue would be if you’re returning something bigger from create-state-update than the segment that created it

Travis17:08:24

so before we had something like this because we were doing a collect by key

{:key #{seg1 seg2 seg3}
 :key1 #{seg1 seg2 seg3}
then in the trigger we collapse these into one structure

Travis17:08:48

now we are trying to merge each segment by key into 1 updating certain structures in the map

Travis17:08:10

so the first seg may be bigger but I would think after that it will be much smaller

Travis17:08:27

since we are not keeping the entire segment but just applying what we want to track

lucasbradstreet17:08:33

mmm. I think pretty much all that should be in create-state-update should be the returned segment

lucasbradstreet17:08:45

unless you’re cutting it down

lucasbradstreet17:08:59

In which case it should be something like (select-keys X segment)

Travis17:08:37

so we are taking a look at how collect-by-key in the aggregation code is working and are trying to do a slightly modified form of it. One thing we noticed is defining a super-fn. Is that something we should be doing? Not sure we understand what that does or more its use case

michaeldrogalis17:08:17

super-aggregation functions take two aggregates and merge them together, which is needed for Session windows.

Travis18:08:20

how often should

:aggregation\init
run? We are running sample with our data ( 5 segments which should aggregate ) but it looks like the init function is getting called multiple times blowing away our state?

Travis19:08:49

ignore*, lol

jasonbell20:08:49

This is going to sound like a really daft question (and it’s probably down to my lack of docker experience) but has anyone got a peer running from docker but relying on either a standalone or zookeeper in another docker container?

Travis20:08:10

I am using a standalone zookeeper

gardnervickers20:08:49

That will setup a docker-compose file running external zookeeper

jasonbell20:08:05

that’s what I was working off before.

jasonbell21:08:23

yeah that’s fine but I don’t want that to happen, one will be already running, I just want it to join in the fun

jasonbell21:08:18

if I edit out the zookeeper/link stuff from the yaml it obviously won’t connect.

jasonbell21:08:15

doing a docker run —link zookeeper:zookeeper peerimage then complains about the network host

Error response from daemon: Conflicting options: host type networking can't be used with links. This would result in undefined behavior.

jasonbell21:08:41

I know it’s something configuration/arugment wise but I’m stuck.

gardnervickers21:08:17

No, thats a limitation of docker when using net:host

jasonbell21:08:25

I thought as much

gardnervickers21:08:34

You can’t use links with net:host networking.

gardnervickers21:08:08

You CAN however run your peer container in net:host mode and set your zookeeper address to <my_docker_ip>:<my_zookeeper_port>

jasonbell21:08:53

okay, that sounds like a plan

jasonbell21:08:04

Oh and thanks for the tweet a little earlier @lucasbradstreet 🙂

gardnervickers21:08:22

cough dcos install kubernetes cough 😉