Fork me on GitHub
#clojure
<
2015-06-25
>
ej00:06:20

But that's for a whole app inclusive of db in one container?

ej00:06:25

Am I correct?

arohner01:06:38

@ej That container doesn’t contain a transactor, no

escherize04:06:17

alright, I'm using honeysql. How do i end up with select LOWER('A');

escherize04:06:45

ahh:

(-> (select :%max.id) (from :foo) sql/format)
=> ["SELECT max(id) FROM foo"]   

zane05:06:09

@escherize: How do you like HoneySQL so far?

ulsa08:06:36

@ragge: looking into the s3events, and the higher level thing you mentioned would really come in handy here

ragge08:06:27

@ulsa: have been thinking about a version of the macro that just calls a fn instead

ragge08:06:59

@ulsa: so you would say (deflambdafn example.MyFunction my-handler)

ragge08:06:18

@ulsa: where my-handler is just a normal fn of [in out ctx]

ragge08:06:44

@ulsa: then you can just use function composition to construct a json handler

ragge08:06:00

@ulsa: get out of macroland quickly

ragge08:06:14

(defn json-handler
  [f]
  (fn [in out ctx]
    (let [event (json/read (io/reader in))
          res (f event ctx)]
      (json/write res (io/writer out)))))

ragge08:06:21

means you could do:

ragge08:06:46

(defn handle-event
  [event ctx]
  (println "Got the following event: " (pr-str event))
  {:status "ok"})

(def my-handler (json-handler handle-event))

helveticafire09:06:20

@ej: I am doing this, our setup is to have datomic use the AWS cloudformation that already exists in datomic to setup the transactor and then build docker image on circleci and push to AWS Elastic Beanstalk using the AWS CLI

helveticafire09:06:41

@ej: It is useful to do it this way because then datomic sets up all the cloudwatch data feeds. I would prefer to have the datomic transactor containerised but I am yet to experiment with that

helveticafire09:06:40

@ej: down side is that you cannot easily ssh into the transactor machine, and adding dependency for datomic's Database Function is tricky

ej09:06:28

@helveticafire What do you mean about the latter? Adding the db dep?

ej09:06:11

Makes sense though, yeah thought that as an option.. Shame elastic beanstalk doesn't easily support multi container deployments

ej09:06:28

... They should make it compatible with dockercompose sigh

ej09:06:03

I also assume you're using dynamodb as a storage service? @helveticafire

helveticafire09:06:37

@ej: http://aws.amazon.com/about-aws/whats-new/2015/03/aws-elastic-beanstalk-supports-multi-container-docker-environments/ Whoop whoop yet to play with this either, kind of want to move to Amazon EC2 Container Service

helveticafire09:06:32

@ej: yes we are using dynamodb.

helveticafire10:06:54

@ej: so for db deps say you want to add a transaction function http://docs.datomic.com/database-functions.html and you have an external dep like clj-time then you need to have that dep in the datomic lib directory. Is that clearer?

ej10:06:59

Haha yeah saw that, kind of annoying since I think current boot and leiningen plugins only work with one Dockerfile, not a multi container deploy xD

mikecarter10:06:16

i am writing some code to parse an XML feed and import the data into a MySQL database using yesql. What's the best way to define the fields of each row? The XML feed doesn't include blank fields. At the moment I am defining a map with the fields set to nil and doing a merge with the parsed XML data but I feel there might be a better way!

ej10:06:04

Oh I get what you mean. Yeah I don't think I'll be use transactor functions tbf Sounds tricky with external deps!

helveticafire10:06:06

@ej quite annoying, quite a bit of hacking to get it working. To solve the multiple containers you could use a bash script

ej10:06:18

Appreciate the sharing of knowledge.. Cloud formation, ebs,cloudfront,dynamodb it is then :D can't wait Currently making a sound cloud killer. Ironic that they're hosted on aws too.

ej10:06:07

Yeah for now its a bit weird since I'm the only current working dev on the project temporarily, not even sure I want to setup circleci Project is prototyping for now

ej10:06:42

@mikecarter I might be wrong but try a zip?

ej10:06:55

Almost the same though :/

mikecarter10:06:21

@ej thanks, i'll look into it

mikecarter10:06:56

(def union-schema {:name nil
                   :org_code nil
                   :org_id nil
                   :email nil
                   :phone nil
                   :fax nil
                   :web_site nil
                   :is_active nil
                   :is_public nil
                   :time_zone nil
                   :longitude nil
                   :latitude nil})

mikecarter10:06:12

that's what i'm doing at the moment

mikecarter10:06:57

i think i'll put those keys in a vector and do it another way

escherize10:06:26

@zane I am using honeysql in one part of my app that requires dynamic sql queries, otherwise I prefer jdbc

Busy escaping the comfort zone14:06:50

Did anyone get to use slamhound with VIM? from what I recall it didn't work too well

jstokes15:06:56

has anyone had any luck with a sparkling/gorilla repl combination?

jstokes15:06:10

getting java.lang.SecurityException when trying to create a spark context inside of gorilla repl

jstokes15:06:21

ah yes, thank you once again @chrisbetz

chrisbetz15:06:37

@jstokes: And see at the end of project.clj for usage.

chrisbetz15:06:11

@jstokes: if you want to understand the code: the trick is to install the GorillaREPL middleware in your Spark drivers nrepl and to start a GorillaREPL in a separate process connecting to that spark nrepl.

jstokes15:06:28

@chrisbetz ill definitely have to think that one through, still fairly new to nrepl - that makes sense though

devn15:06:37

Phoning a friend on this one: AES-256-GCM

devn15:06:58

Is there a Clojure library that supports this? If not, where should I be looking in Java land?

voxdolo16:06:05

@devn: there's this https://github.com/clavoie/lock-key/blob/master/src/lock_key/core.clj which purports to do AES, though I haven't used it. I'm just using javax.crypto directly.

devn16:06:00

i think i'll use it directly also

devn16:06:16

but this is basically what im going to be doing

devn16:06:33

interestingly, PKCS5Padding actually means PKCS7Padding

devn16:06:38

and is an artifact of the DES days

noisesmith17:06:58

michaeldrogalis: where would I look to see "the current state of onyx"? I talked to you about it at Clojure/West and it sounded like a good time to try it was coming up soon...

noisesmith18:06:33

michaeldrogalis: thanks for the update, I'll give it a good look and might just be using it in production

michaeldrogalis18:06:13

@noisesmith: Cool. Let me know if you need anything.

shriphani20:06:43

has anyone deployed a clojure service on aws lambda /

shriphani21:06:55

oh that is not bad at all.

settinghead21:06:56

why is http-kit more performant? how is its algorithm different?

ragge22:06:26

@shriphani: i have, and i wrote that piece of glue... let me know if you have any issues

shriphani22:06:54

ragge: I was just curious how people managed with that jar size limit

ragge22:06:15

@shriphani: what is it? 50mb?

shriphani22:06:39

I have a few ML models that are several megs in size that I need to upload as well.

ragge22:06:53

you know the time limit is 60s though?

ragge22:06:01

that's the biggest impediment for me

shriphani22:06:04

yeah this is like a backend service.

shriphani22:06:15

so it does a dot-product at most

ragge22:06:29

i think lambda is only really suitable for gluing together aws services

ragge22:06:43

like put a message to sqs when an s3 bucket is updated

ragge22:06:57

and then do actual processing elsewhere

ragge22:06:12

unless you can guarantee for how long you'll need to execute

ragge22:06:04

i initially thought it could be useful for batch processing

michaelr23:06:06

sente users, is it expected that server->client events arrive at a different order than how send-fn was called?