This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-17
Channels
- # admin-announcements (63)
- # beginners (1)
- # boot (83)
- # cider (17)
- # clojure (33)
- # clojure-android (3)
- # clojure-france (3)
- # clojure-gamedev (1)
- # clojure-russia (20)
- # clojure-sg (9)
- # clojurescript (81)
- # core-async (77)
- # cursive (13)
- # datomic (30)
- # hoplon (7)
- # instaparse (54)
- # ldnclj (1)
- # off-topic (4)
- # om (2)
- # onyx (23)
- # re-frame (16)
- # reagent (3)
- # yada (2)
Sooo... I am creating uberjars with boot and it's slooooowww (which is a known problem I know) how do you guys deploy to AWS?
@mitchelkuijpers: currently building uberjars as part of CI but I think in near future I’ll move to just running things with boot in production
that said it still would be nice if uberjar building would be as fast as it is in lein
@martinklepsch: true I saw some talk of adding it to the jar task, I think while not as idiomatic it would be a good solution
@mitchelkuijpers: most of our stuff is beanstalk+docker and in our docker file we run the boot entrypoint (no servlet container)
this is nice because the boot runtime (pods) are available at runtime
@mitchelkuijpers: are you using tomcat on beanstalk or something different?
@alandipert: We are currently creating our deployment, we are checking if we would like to run on beanstalk or spin up a ec2 instance ourselve
Creating an uberjar takes a while but for the rest it is running absolutely fine
but do you guys just download all dependencies when deploying on the instance?
that’s the docker way
when deploying to a servlet container, the way to go is with the —as-jars option to uber
that leaves the unpacking of the jars to the servlet container and is pretty snappy
but if you want to be on AWS with boot for a web service, i personally think docker on beanstalk is the way to go
Aha we don't want to deploy on a servlet container, because we are using catacumba
so we need to run a jar
here is one of our latest Dockerfiles for a boot web app: https://gist.github.com/alandipert/3d39b47ce7bc320f3a01
@alandipert: out of curiosity, how do you handle image building/storage?
we don’t, yet… ultimately we want to run our own docker registyr
private image storage notwithstanding, i think docker has been a win if only because it helps so much with reproducibility
like everyone on the team has working docker knowledge, and can get every app at least started
We also have the problem that we need to compile our cljs, I would like to do that only once and not on every machine that we start
that and deployment flexibility… we stood up dokku on an EC2 recently for little things like slack hooks
@alandipert: I see you guys have an m2 proxy where you download the deps from that fixes losing dependencies
yeah we’ve been running nexus for that, not super happy with it… been working on http://projars.com/ on the side
We also run nexus, it works pretty much for us
Ahh well for now we'll simply go for the simple route (an uberjar) for us. Might have to take a look at docker later on. Thanks for the example @alandipert
@mitchelkuijpers: no prob! yes i hope this week to stand up a “Deployment” wiki page, i’m not sure the various options have been enumerated anywhere
uber might not be so slow soon, last week micha and i paired on a ‘caching-uber’ branch, which bypasses the slow parts of fileset for files that don’t change
@mitchelkuijpers: for cljs deployment I’d recommend CI pushing to S3 and then serving through CDN
@alandipert @micha: I have some time to hack on boot, specifically https://github.com/boot-clj/boot/issues/255.
@alandipert: When you push that wiki page on deployment, I'll add a paragraph on boot-runit, the deployment strategy I've been using the last year
@danielsz: that sounds great, feel free to start it
@danielsz: we’re currently using upstart, I briefly searched for a comparison etc, can you point me to something that tells me why I should use runit?
@martinklepsch: Oh, with great pleasure. You'll find runit advocacy on the accompanying blog post: http://danielsz.github.io/2014/12/06/lein-runit/
But in one borrowed paragraph: Dan Bernstein (of qmail fame) wrote the seminal process supervision toolkit daemontools, which is a beautifully-designed set of small, ultra-reliable and highly-specialised programs that cooperate in the UNIX tradition to manage process supervision trees. Runit is a more conveniently licensed and more actively maintained reimplementation of daemontools, written by Gerrit Pape.
I’m past that paragraph 😛
@martinklepsch: And this one? The beauty of runit is its brevity and simplicity: the runsv command, which manages each process, is only 600 lines of code. In this post I want to explain how runit works and why I’m so impressed.
is it possible to develop boot tasks without having to ship them as libs - I'm finding the dev workflow really painful. I want to use some functions of boot.core but it doesn't seem to be accessible at all - all the examples on the web are trivial and use clojure.core, but I'm trying to write filesets etc.
@malcolmsparks: you can require boot.core
in any namespace
I must be doing something wrong, it just isn't letting me require boot.core
perhaps I need to declare a 'boot src' dir or something
@malcolmsparks: is your namespace in :source-paths
?
:source-paths #{"src"}
and do you get an exception requiring boot.core or what exactly happens?
I've created a ns, juxt.stencil:
(ns juxt.stencil (:require [boot.core :as c])) (c/deftask gen [] (let [tmp (c/tmp-dir!)] (fn middleware [next-handler] (fn handler [fileset] (c/empty-dir! tmp) (let [fs' fs] (next-handler fs') )))))
it's in src
in my build.boot I refer to it
(deftask gen [] js/gen )
but when I boot gen
[malcolm@tulkas website]$ boot gen clojure.lang.ExceptionInfo: No such var: c/tmp-dir! data: {:file "juxt/stencil.clj", :line 6}
@malcolmsparks: what version of boot?
I'm sure I'm doing something wrong 😞 but really appreciate you trying to help @martinklepsch
let me check
We’ll have this sorted in 5min
2.0.0-rc14
there’s the culprit
I installed boot ages ago, just picking it up again
update boot
1. update binary
2. boot -u
i'll try upgrading, thanks very much
latest binary can be found here: https://github.com/boot-clj/boot/releases/tag/2.2.0
temp-dir! was renamed to tmp-dir! in boot 2.0.0
great, thanks @martinklepsch , that was the problem, I'm out of the rut
(-> fileset
((partial reduce core/add-asset) (map io/file add-asset))
)
some of these bootisms are very cool - took me a while to grok what was going on here but once I got it I smiled
map/reduce ftw
Hah grok is a great word
I'm actually writing a boot task to generate content from mustache templates - does anyone here know of something that already does that? it must be a common need - if not, i'll publish
Most of existing tasks are listed here: https://github.com/boot-clj/boot/wiki/Community-Tasks
@daraen thanks
Maybe using ids filter (in snapshot)