Fork me on GitHub
#tools-deps
<
2018-09-29
>
miridius04:09:41

Hi all, what's the best practice for running a deps.edn based project in production? Is it ok to run it "dynamically" with clojure -Aprod -m my.app.main or is it better to AOT compile the app -- and if so, how?

seancorfield06:09:05

AOT really only saves you startup time.

dominicm06:09:24

We do that sometimes. No complaints.

seancorfield06:09:28

We still use JAR files for production deployment but we never AOT anything.

seancorfield06:09:25

We use uberjars for the convenience of knowing our production system will never be dependent on reaching out to Maven or Clojars at application startup. But we use clojure.main as our Main-Class.

miridius06:09:34

what do you use for creating the uberjar? juxt/pack.alpha -> Capsule?

seancorfield06:09:58

We're still using Boot but we're moving toward clj/`tools.deps`.

seancorfield06:09:30

I'm leaning toward depstar for the simplicity of the tooling, but cambada seems to be very slick.

miridius06:09:41

ah ok 🙂 thanks. I'm currently using lein for the uberjar task and literally nothing else

seancorfield06:09:01

We outgrew Leiningen years ago and switched to Boot -- we've built almost our entire build/test/deploy pipeline on top of that.

seancorfield06:09:20

But we're in the process of retooling to something simpler, based on deps.edn etc.

miridius06:09:29

depstar and cambada both look really cool! thanks for those

miridius06:09:57

Yeah I've tried both leiningen and boot and found them both to increase the amount of complexity I face rather than decrease it. Troubleshooting them when they don't behave is especially painful! So I've happily moved everything to tools.deps, and the only piece missing now is production deployment

seancorfield06:09:33

Our build.boot file is close to 2,000 lines. We have a ways to go 🙂

miridius06:09:15

I use docker so theoretically don't have any need to uberjar anything, as long as I can make sure all the deps are there. I was thinking of adding a :quit command-line arg to my main class that quits immediately and just running that at build time so that it downloads all the deps. Kind of hacky though...

seancorfield06:09:17

Can't you do clj -Stree to force the downloads?

miridius06:09:34

oh! I didn't know it would download the deps, I thought it just prints them

miridius06:09:42

hey btw, I use your dot-clojure repo, it's really helpful 🙂

miridius06:09:51

-Stree works... nice

dominicm08:09:28

We (JUXT) use pack in many projects now, it's gone very well overall.

miridius06:09:21

thanks for the tips 🙂

bbrinck21:09:04

Hi, I just made a small utility (using clj-new- thx @seancorfield) to validate deps EDN from stdin - https://github.com/bhb/check-deps. Feedback/questions welcome 🙂

bbrinck21:09:09

(and suggestions)