Fork me on GitHub
#clojure-uk
<
2016-10-26
>
maleghast04:10:23

hey there - how’re you all doing over there in Blighty today?

maleghast04:10:46

Anyone got any wisdom to share re deploying Clojure apps on Docker..?

maleghast04:10:20

I am specifically looking for a nice light-weight base that I can drop an (uber)jar on 😉

seancorfield05:10:42

I'll be interested to hear what people recommend for this... it's something we're starting to look into... we're already using Docker for a bunch of stuff and that's on out "todo list" 🙂

maleghast05:10:24

@seancorfield - Glad it’s not just me that is hoping that someone else has already figured this out 🙂 We use Alpine bases for our Python microservices, but there are handy Python3-alpine base images that mean I don’t have to navigate package management for Alpine to get those working. I am hoping that someone somewhere has a solid, but slim, container base for Clj...

seancorfield05:10:41

If you have an uberjar, you only need Java in the container (and your JAR file).

seancorfield05:10:23

If you want to run a Clojure program from source, there's a Boot / Clojure Docker image from Adzerk (I think). Assuming you use Boot 🙂

agile_geek07:10:13

More for running Clojure from source but I guess you guy's must have looked at this? https://hub.docker.com/_/clojure/

agile_geek07:10:51

At my current client they're deploying Docker images from openjdk:8-alpine image and the firing up uberjars using a shell script but all that's doing is java -jar in most cases. Using Kubernetes for deployment, scaling, etc.

Rachel Westmacott07:10:16

I’m just using the java image and an uberjar built with a CI script - but long term I’d rather drop the compilation, as it creates an extra difference between dev and prod.

agile_geek07:10:44

peterwestmacott: So you're planning to run lein or boot in production or bootstrap some other way?

Rachel Westmacott07:10:46

I think so. I guess in theory I could just java -jar with the clojure jar and point it at my source code, but lein would probably make that easier

Rachel Westmacott07:10:53

I’ve not looked at boot yet

Rachel Westmacott07:10:16

my understanding was that it is mostly better for complex clojurescript builds - which I don’t yet have.

Rachel Westmacott07:10:41

also: I told a small lie - I had forgotten that I'm actually using a clojure/lein docker image, not a plain java one

Rachel Westmacott07:10:47

the one you linked in fact, agile_geek

agile_geek07:10:37

peterwestmacott: so not concerned about any performance penalty then?

Rachel Westmacott07:10:21

I generally give no thought at all to performance when I work (besides not writing obviously stupid code).

agile_geek07:10:19

Not necessarily, it depends on your app. You can always start off as you are and move to an uberjar later but I personnaly don't like the idea of my production images pulling down dependencies into m2 directory and running under tooling designed more for development. I would be quite comfortable with an uberjar...but I've lived in the Java world for 19 years so WARs, EARs and JARs are bread and butter 😉

Rachel Westmacott07:10:18

I would have guessed that once the bytecode is loaded it makes no difference how it got there. But I could be wrong.

Rachel Westmacott07:10:28

certainly startup time might be affected

Rachel Westmacott07:10:37

but for a server I don’t consider that an issue

agile_geek08:10:26

Start up time would definitely be effected and this slows your ability to scale fast but it depends what your requirements are. I guess my take would be the benefit of running exactly the same tooling in dev and all other env's is not worth it. I tend to only use lein in local dev and all other env's use the uberjar so I've hammered it in a couple of env's before prod anyway. Nothing stops me running the uberjar in dev if I want to and if I wanted to poke at the code I could host a REPL on a socket and only activate it in dev env's.

mccraigmccraig09:10:11

@maleghast here's my dockerfile https://www.refheap.com/293467ebae06fee93beb200e5 which meets pretty much exactly your requirement 🙂

maleghast09:10:51

Cheer @mccraigmccraig and everyone else that chipped in - all interesting ideas / thoughts; sadly I’ve only just got back to this channel after being “distracted” by work 😞

mccraigmccraig09:10:33

here's my other dockerfile @maleghast from my onyx project , which is a bit more modern - https://www.refheap.com/972b2163b5ad5de61e8d8f24d

mccraigmccraig09:10:51

though it's got some onyx-specific bits in there which you would probably want to drop

mccraigmccraig09:10:06

in particular it's using S6 for managing the aeron media driver as a separate process from the application process, within the same container

maleghast10:10:16

I may create some crazy hybrid that uses the alpine base from the Onyx file but is simpler in the “what’s going on” department like the Ubunutu 14.04 Dockerfile you posted / pasted first 🙂

mccraigmccraig10:10:42

that wouldn't be crazy @maleghast - i should update the first dockerfile to use the alpine base

meshy10:10:36

perhaps it could be modified to look like the London Eye?

meshy10:10:59

I like the Berlin one :)

maleghast10:10:00

@mccraigmccraig - I was employing exaggeration as a device… Oh hold on, you’ve figured that out already, haven’t you? 😉

maleghast10:10:16

The Berlin Clojure logo is Klasse.

maleghast10:10:31

I’ve been up that Fernsehtuum

otfrom10:10:23

martinklepsch & jr0cket we could do the same as Berlin. We could just take out the circle bit and it could be the shard. 😉

maleghast10:10:49

Thanks @otfrom - Good to have lots of options / ideas 🙂 Is there a particular reason y’all went with the phusion base..?

otfrom10:10:02

maleghast you'd have to ask elise_huard

otfrom10:10:19

I'm just a CTO now. They don't let me make technical decisions

maleghast10:10:37

That makes sense 😉

maleghast10:10:56

I’m still making them for now, but I can see the writing is on the wall… 😉

maleghast10:10:25

@elise_huard - tell me the tale of phusion, please? 😉

otfrom10:10:46

btw, I think using openjdk8 in a docker image might be a violation of the Java license (something around trademark/releases/compatibility) so azure jvm might be the way to go

maleghast10:10:51

@otfrom Oooh, really? That’s all a bit hectic! How about Oracle Java 1.8?

otfrom11:10:19

maleghast same issue.

otfrom11:10:08

or at least I think so or something

otfrom11:10:48

sorry, I meant azul not azure

maleghast11:10:07

Ah OK, that makes more sense

mccraigmccraig11:10:06

@otfrom reading this http://blog.takipi.com/running-java-on-docker-youre-breaking-the-law/ it would seem to me that you are fine to run oracle java on docker if you install in your Dockerfile

otfrom11:10:12

that's the one

otfrom11:10:32

mccraigmccraig minimal does this mean your links enter Thunderdome now?

minimal11:10:17

I’m always prepared for a fight to the death

maleghast11:10:41

Right, so if I start with Alpine base and add Oracle Java to it myself I am golden, but if I start with an alpine+Oracle Java 8 base image I am in trouble..?

mccraigmccraig11:10:54

umm what happens in the thunderdome @otfrom @minimal ?

minimal11:10:32

2 parens enter, 1 paren leaves

maleghast11:10:29

See y’all later - time to leave the office and head home...

mccraigmccraig11:10:54

@minimal unbalanced parens !

minimal11:10:25

unbalanced is better than dead

glenjamin11:10:07

I’ve just realised how apt that illustration is

otfrom11:10:53

mccraigmccraig in this case, 2 links enter

otfrom11:10:19

minimal I'd rather be dead than unbalanced

minimal12:10:28

otfrom: admirable, but presumes you are balanced

elise_huard12:10:46

@maleghast @otfrom: to be fair the phusion base came from my colleague Antony - but it makes sense to use a minimal ubuntu

elise_huard12:10:25

we'll have to ask him how he came upon it @acron ?

acron12:10:59

ello ello?

acron12:10:37

Ah so i'd seen it used by a couple of other folks and the Onyx people had it in their sstarter template

acron12:10:45

that's where I first learnt about it

agile_geek12:10:56

@mccraigmccraig @otfrom looks like OpenJDK is OK in Docker thou (according to that article)

mccraigmccraig12:10:24

my reading was oracle jdk is fine in docker too as long as you are not re-distributing your images @agile_geek

otfrom12:10:16

minimal I'm dead and unbalanced.

otfrom12:10:45

but my parens always match b/c I use the proper paredit commands to navigate and kill C-M-k

maleghast12:10:29

(I am home now)

maleghast12:10:40

SO now I am going to read that blogpost ^^ Thanks again peeples!

agile_geek12:10:12

@mccraigmccraig so I assume that means distributing for public consumption rather than distributing at runtime for your own use?

otfrom12:10:47

agile_geek that is my understanding

mccraigmccraig12:10:21

that was my assumption @agile_geek and would seem reasonable, but who knows, this is oracle, maybe backing up your system is verboten too ?

maleghast12:10:37

I am going to be just fine with the alpine openjdk “official” base image, I reckon 🙂

maleghast12:10:40

Thanks All 🙂

mccraigmccraig14:10:02

@otfrom i think you sent me a terraboot related link a couple of weeks ago - dyu have it again ? i appear to have misplaced it facepalm

otfrom14:10:29

done by jasonbell and elise_huard (with some help from thattommyhall)

thattommyhall14:10:13

I'm going to blog about my Ruby one soon :-)

mccraigmccraig14:10:10

ah, cool - i think you sent me a link to a PR, but it's all merged now @otfrom

mccraigmccraig14:10:26

i'll kick it's tyres then

practicalli-johnny15:10:02

Or you could just use Heroku... https://devcenter.heroku.com/articles/getting-started-with-clojure - git push heroku master then get back to coding...

otfrom15:10:40

:redcard: vendor pitch 😉

otfrom15:10:17

says the man who posted a link to his company github

practicalli-johnny15:10:01

@martinklepsch do you have an .svg version of the Clojure Berlin logo? And if so, would we have permission to create a modified version of your image. Thank you

practicalli-johnny15:10:15

@otfrom I didnt suggest you pay for Heroku... unless you like coding over devops 🙂

otfrom15:10:18

jr0cket depends on what you are doing. heroku is good for a goodly number of usecases and thankfully has a zero carbon EU location now (IIUC that they run in Dublin)

practicalli-johnny15:10:19

Good to know about the zero carbon footprint, thanks.

practicalli-johnny15:10:10

I've added more content to the [ClojureBridge curriculum using Klipse](http://jr0cket.co.uk/community-docs/docs/curriculum/). I like [Klipse](https://github.com/viebel/klipse), it works very well and its a very usable alternative to setting up Clojure environments for ClojureBridge. I like Klipse so much, I even created Klipse snippets in Spacemacs 🙂

mccraigmccraig15:10:13

@jr0cket i looked at heroku a while back, and the only cassandra addon was remarkably expensive, and as soon as you want multi-datacenter support you are on your own anyway

practicalli-johnny15:10:53

@mccraigmccraig I've never seen any figures on how much that would cost for cassandra if you would do it yourself, so couldn’t comment if it was expensive. Was it https://elements.heroku.com/addons/instaclustr you looked at?

practicalli-johnny15:10:40

Thanks for the logo @martinklepsch I will see what my modest artistic skills can make of it...

mccraigmccraig15:10:57

these days i'm using DataStax Enterprise with multi-datacenter and spark, and i don't know that that's available as a service anywhere

martinklepsch15:10:32

@jr0cket if you end up making a rough thing and you're not happy with it's polish I'm happy to try to improve it

glenjamin16:10:13

The heroku pipelines stuff with github integration they have now is really good

glenjamin16:10:39

can promote a built slug across environments, and also create deployments for open PRs with a button press

glenjamin16:10:17

at the very least I like to use heroku as the comparison point for how smooth someone’s build/deploy/run process is