Fork me on GitHub
#boot
<
2016-05-11
>
superstructor00:05:28

@richiardiandrea: have you seen Dirac (https://github.com/binaryage/dirac) ? boot-cljs-repl doesn’t allow e.g. eval in the context of a stack frame (breakpoint), or connecting to Cursive IDE REPL.

richiardiandrea00:05:20

@superstructor: really you can't? I have to try to connect from cursive..that would be a thing I can improve or add as option

richiardiandrea00:05:58

I am familiar with Dirac but haven't tried it myself to be honest

richiardiandrea00:05:05

Wow installing it looks pretty articulated

superstructor00:05:23

@richiardiandrea: jupl/boot-cljs-devtools packages Dirac support for Boot.

richiardiandrea00:05:00

But boot-cljs-devtools should probably be in by default

richiardiandrea00:05:35

Ah ok all included nice

superstructor00:05:49

@richiardiandrea: there is also a channel for #C0J01U7MY

superstructor00:05:55

@richiardiandrea: if you were interested in adding support to the lambone template, I’ve got it working with my boot projects already, so I could do a pull request ?

richiardiandrea00:05:02

Yes, I still don't know if I want it as default or as option, but definitely!

richiardiandrea00:05:01

@superstructor: the fastest patch in the history of GH, I only announced it here basically ;)

kenbier00:05:45

is there a way to make sure certain namespaces are added to the classpath by defaut? i see certain ones missing when i run from uberjar if they are not required

kenbier00:05:10

this is for running from an uberjar

micha00:05:30

the files that will be on the classpath shouldn't have anything to do with what you require

micha00:05:51

are you doing AOT?

micha00:05:27

ah that explains it

micha00:05:48

the clj files should be in :resource-paths, not :source-paths

micha00:05:03

if you want them to be included in a jar or other packaging

kenbier00:05:23

ah i did that

kenbier00:05:28

let me double check

kenbier00:05:40

perhaps grep has failed me

micha00:05:41

can you inspect the jar file and see if the .clj files are in there?

kenbier00:05:58

how do i do that?

micha00:05:18

i do like jar tf target/project.jar |less

micha00:05:32

or you can open the jar file in Vi or Emacs

kenbier00:05:33

ok let me try that

kenbier01:05:03

yup its there simple_smile

seancorfield01:05:26

boot-expectations 1.0.9 available — adds -S / —startup option for symmetry with existing -s / —shutdown option, and provides more flexibility than expectations_options.cljhttps://clojars.org/seancorfield/boot-expectations

micha01:05:45

@kenbier: if it's there it should be on the classpath, no?

kenbier01:05:02

id assume so yeah

kenbier01:05:52

i logged the classpath but im guessing i just didnt look hard enough

kenbier01:05:06

gonna look through the log once more

micha01:05:41

i need to hit the road, i'll b back online later

kenbier01:05:03

k thanks for the help!

seancorfield01:05:32

This may be a #C0617A8PQ question but I figured I’d ask here first… If I want an expression evaluated when I cider-jack-in to a Boot project, is there a way to do that?

seancorfield01:05:12

I initially thought I could use the -e option but CIDER uses boot repl -s wait and -e is a client option, not a server option.

richiardiandrea01:05:23

@seancorfield: you have to customize...let me fetch it for you

seancorfield01:05:56

(technically I want the expression evaluated once when I start the server not really when I start the client)

seancorfield01:05:30

So —init perhaps?

richiardiandrea01:05:22

ok, let me see if I understood, if you want to execute something different from boot repl -s wait you need to customize: cider-boot-parameters

richiardiandrea01:05:41

(setq cider-boot-parameters "cider dev")

seancorfield01:05:03

I already have that… I think I was just coming at this from the wrong angle… let me try something...

seancorfield01:05:09

Ugh! No. —init is also a client-only operation.

richiardiandrea01:05:16

uhm yeah interesting problem, now I got what you mean

richiardiandrea01:05:38

but I don't have a solution

richiardiandrea01:05:03

Is someone here using cursive with boot? it looks like a colleague of mine cannot see files as Clojure files...EDIT: found https://github.com/boot-clj/boot/wiki/For-Cursive-Users

seancorfield02:05:59

Answer: just put the definitions I want in build.boot...

seancorfield02:05:04

Background: I’m setting up the Reloaded Workflow and wanted to pull in the equivalent of Stuart’s "dev" namespace file… but Boot makes it simpler. Duh!

flipmokid11:05:43

Hi all, probably a silly one but what's the simplest boot file I need to have to have get a clojurescript nodejs repl going?

chunsj11:05:54

How can I specify java source code path in build.boot? In project.clj (for leiningen) I can do this with :java-source-paths key in defproject.

micha13:05:25

@chunsj: any .java files in your :source-paths or :resource-paths will be on the classpath for compilation

micha13:05:40

@chunsj: you can then use the javac task to compile them

micha13:05:01

compiling java is just another task like any other

dimiter13:05:04

@juhoteperi: I am trying to use boot-sass to include some CSS files packaged as part of cljsjs component. My deps are:

[cljsjs/react-select "1.0.0-beta12-0" :exclusions [[cljsjs/react-dom] [cljsjs/react]

dimiter13:05:24

My style task is:

(deftask styles []
         "Compile Styles"
         (set-env! :source-paths #{"sass" "cljsjs"}
                   :resource-paths #{})
        (comp (watch)
              (speak)
              (sass)
              (sift :include #{ #"([^\s]+(\.(?i)(css))$)"})
              (target :dir #{"compiled_css"})))

dimiter13:05:57

And I am trying the following import (And variations on it)

@import "cljsjs/react-select/common/react-select.inc”;

micha13:05:48

@dimiter: is boot-sass able to @include resources on the classpath?

micha13:05:20

because that looks like it would be a file in the cljsjs jar, right?

dimiter13:05:48

Yes. That is my question I guess. The css file is in a JAR file.

dimiter13:05:08

However, I am not sure if boot-sass looks for css file or just .scss files

micha13:05:12

you can extract the contents of the jar into the fileset with the sift task

dimiter13:05:32

Yeah, that is the approach I took for now.

micha13:05:33

see the -j, --add-jar option

micha13:05:48

ah cool, so you're in business now?

micha13:05:56

i mean it's working the way you need it?

juhoteperi13:05:19

@dimiter: Only .scss. You must define the extension in import if it is something else.

dimiter13:05:22

Right, but if it has an extension, the compiler just translates it to a URL Import call.

dimiter13:05:43

Ideally, it would look for .css files as well if I want to import them inline.

juhoteperi13:05:39

I have no idea how sass works with this. Less has import options to select how compiler imports the file.

dimiter13:05:57

Yeah, SASS does not have the (inline) tag option.

dimiter13:05:05

Or maybe even add it as an option on the boot-sass task to specify valid extensions.

juhoteperi13:05:18

I don't think options is needed. This add-ext/find logic just needs some tweaking to check for css files if scss doesn't exist: https://github.com/Deraen/sass4clj/blob/master/src/sass4clj/core.clj#L60-L71

dimiter13:05:56

Ok. I might take a look at it. Later.

mobileink14:05:02

I switched to 2.6.0-SNAPSHOT and now I’m getting a dependency fail. The dep is [com.google.appengine/appengine-java-sdk LATEST :scope "provided" :extension "zip”] which is available at http://mvnrepository.com. It used to work, now I get “Could not find artifact”. Help?

mobileink14:05:07

PS the zipfile is already in my local maven repo; why is it going to the web?

micha14:05:17

beacuse you're using LATEST

micha14:05:27

it can't know what the latest is without checking the repository

micha14:05:34

but i would use RELEASE

micha14:05:40

instead of LATEST

micha14:05:48

and it needs to be a string i think too

mobileink14:05:18

Both RELEASE and “RELEASE” fail.

mobileink14:05:01

Even with LATEST it successfully finds the latest, because it’s trying to fetch 1.9.37

micha14:05:16

perhaps there is an issue with the repository?

mobileink14:05:27

The msg is Could not find artifact com.google.appengine:appengine-java-sdk:jar:1.9.37 in maven-central ()

mobileink14:05:48

Shouldn’t that be :zip: instead of :jar:?

micha14:05:50

could be a regression, you're saying it works if you do BOOT_VERSION=2.5.5 boot ...?

micha14:05:00

with the same build.boot file?

mobileink14:05:22

Hmm, now that 2.5.5 fails too. Lemme try some other projects...

micha14:05:50

what if you try a specific version, like 1.9.37

micha15:05:04

could be that their metadata file is corrupted

micha15:05:12

or some other version

micha15:05:38

maybe they pushed a new version and something went wrong

jethroksy15:05:46

@micha have you guys moved away from beanstalk?

jethroksy15:05:28

so just building from raw AMIs now?

micha15:05:19

no, we just use ASGs with a user-data script that provisions the machine in a very simple way

micha15:05:48

basically we organize it similar to beanstalks, like we have a git repo for the service that will run on the cluster

micha15:05:01

and in that git repo is a Makefile

micha15:05:54

then we have some scripts to create ASGs (environments in beanstalk parlance) with a generated user-data script that pulls the repo from s3, loads it on the new instance, and runs the "provision" and "deploy" targets of the makefile

micha15:05:43

basically we removed all the ruby and python script nonsense and layers of nginx proxies and all that

jethroksy15:05:59

hmm, didn't know beanstalk had that under the hood

jethroksy15:05:21

I'm getting annoyed by the deploy time

micha15:05:29

beanstalk combines too many separate functions

micha15:05:34

yeah that's the worst part

jethroksy15:05:47

takes up to 3 minutes for me

micha15:05:47

but also the worst part is that they force you to update things, like docker versions

jethroksy15:05:54

it's just a small app 😞

micha15:05:59

if you have a cluster of any size it can take hours

micha15:05:05

and it fails often

micha15:05:12

sometimes leaving you with downtime

jethroksy15:05:28

yeah, i'm dealing with that with fake blue-greens

micha15:05:29

and there's nothing you can do about it because they lock you out while beanstalk is doing things

micha15:05:43

yeah that's also problematic because you can't really clone environments

micha15:05:51

like they have a clone button but it's broken

micha15:05:58

it doesn't clone security groups and things like that

jethroksy15:05:16

also I think I did everything right

jethroksy15:05:23

but my maven deps aren't getting cached

jethroksy15:05:08

configuring the single container config is quite a PITA

micha15:05:31

yeah we use this anti-beanstalk script we wrote now and uberjars

micha15:05:36

instead of beanstalk and docker

micha15:05:57

it's way simpler and we can deploy reliably

micha15:05:11

we deploy by just doubling the desired instance count in the ASG

micha15:05:18

then it scales back down normally

micha15:05:23

removing the old instances

mobileink15:05:42

@micha very strange. now it’s working again and I have no idea why. maybe I had a network problem?

micha15:05:44

so we can do this under heavy load, no problem

jethroksy15:05:57

that's really cool

micha15:05:02

because we never decrease the capacity of the ASG during the deploy

micha15:05:13

we overprovision for a while during the deploy

micha15:05:27

so we can watch it and if things start going south we can just terminate the new instances

jethroksy15:05:12

i attended the AWS summit last month, and came back with no new knowledge whatsoever haha

micha15:05:43

you might look into cloudformation

jethroksy15:05:46

too bad I've gotta drop everything I'm doing in a week to begin my studies

micha15:05:00

we're not using it because it seems to want to generate crazy names for things

jethroksy15:05:10

so does beanstalk 😛

micha15:05:10

but maybe there is a way around that

micha15:05:17

yeah that's completely unacceptable

jethroksy15:05:34

I'm looking at convox

micha15:05:34

like we get paged with an alert that awseb923402712346bz9345 is down

jethroksy15:05:44

not sure if it'll help

micha15:05:24

yeah i am staying away from tooling for now, just doing the minimum to get an instance running, then we can program the rest of the way

micha15:05:33

like the makefile can do anything

micha15:05:38

so we can separate those concerns

jethroksy15:05:48

I'd do the same, but time is a huge constraint

micha15:05:53

allocation of AWS resources separated from provisioning and deploying software

micha15:05:05

i think that's the key thing

micha15:05:13

like we still have stuff on chef

micha15:05:19

and it's really terrible imo

micha15:05:51

all the things we move off of chef get easier to work with and stop failing all of a sudden in the middle of the night

micha15:05:12

like when someone in the world changes a ruby dependency for left-pad lol

jethroksy15:05:46

AWS is a huge maze, and really needs someone good at navigating around it

jethroksy15:05:20

reason I'm using beanstalk is because I don't have to jump around all the consoles so much

micha15:05:38

yeah that makes sense

micha15:05:47

if you have a small application it works well i think

jethroksy15:05:56

I guess a boot for devops needs to be made haha

micha15:05:00

and if you can tolerate occasional downtime when it gets confused

jethroksy15:05:02

build tooling for devops tools

micha15:05:25

yeah that's kind of what we're doing

micha15:05:42

our philosophy is to remove the frameworks and let you program directly

micha15:05:44

like boot

micha15:05:51

with devops that means unix

micha15:05:55

with boot it's clojure

jethroksy15:05:58

sure looks like the way to go

micha15:05:13

so our thing we use is just a way to get a unix environment running so your makefile can run

micha15:05:27

just like boot is a way to get a clojure environment going so your build.boot can run

micha15:05:46

and it doesn't do anything else

jethroksy15:05:52

I can only hope 4 years later the scene is much better

micha15:05:06

the ec2 container service might work for you

micha15:05:15

it's an application container like heroku kind of

jethroksy15:05:16

ah i tried that with docker-compose

micha15:05:26

there is also a thing called dokku that might work for you

micha15:05:41

it's a heroku buildpack compatibility thing for ec2 docker

jethroksy15:05:34

might play around with those in my free time

jethroksy15:05:03

for now my main objective is to clean up my mess so I can leave the company in peace

micha15:05:25

it's not difficult to set up just an ASG with your application running

micha15:05:48

you put your application on s3 and make a user-data script that pulls it down when a new instance is launched

micha15:05:11

then you can make a launch config for that ASG to associate it with the user-data script

micha15:05:38

an afternoon of fiddling around with it would get you going

jethroksy15:05:41

thanks for your time

jethroksy15:05:03

my build process isn't hard, so maybe I can hack something up

micha15:05:41

i prefer the hack because i can at least see what it's doing and change it if i need to

micha15:05:50

i mean as someone who is maintaining the thing later

micha15:05:02

vs. layer upon layer of framework

jethroksy15:05:14

totally agree with you on that

jethroksy15:05:08

I'm not going to be the one maintaining my mess, so I'm morally obliged to make the process easy

jethroksy15:05:14

or at least understandable

micha15:05:21

like we have boot building the uberjar, that could get complex if we need to do fancy things at build time

micha15:05:39

and then once you have the uberjar and an upstart script or whatever to manage it on the instance

micha15:05:54

there is really very little you need to do for the ops part

micha15:05:09

just install the uberjar and upstart script, start service

micha15:05:34

so boot is really doing all the heavy lifting

micha15:05:23

the logic involved with bringing up a new instance and getting the service installed and running is trivial

jethroksy15:05:31

what made you move away from using boot as the starting point?

micha15:05:41

simplicity really

micha15:05:52

like dependencies etc

micha15:05:15

it's easier to use uberjar + upstart script, at least for now

micha15:05:12

could work the other way too

micha15:05:18

where you just deploy a build.boot

micha15:05:41

but then you'd need to have a maven proxy cache or something

micha15:05:50

in case repos go down

jethroksy15:05:12

I'd definitely go with uberjars

jethroksy15:05:27

but I always get aot problems

jethroksy15:05:32

or resource/class-path problems

micha15:05:35

yeah we avoid all aot

jethroksy15:05:41

not too familiar with clojure in general

micha15:05:46

i make a shim namespace

jethroksy15:05:02

I used that boot task as well

micha15:05:55

(ns shim
  (:gen-class))

(defn -main [& argv]
  (require 'my.app.entrypoint)
  (apply (resolve 'my.app.entrypoint/-main) argv))

micha15:05:11

then i just AOT that namespace and set it as the :main for the jar

micha15:05:31

my real application main fn is in my.app.entrypoint namespace

micha15:05:37

which i do not AOT

micha15:05:32

our deployment situation was getting too complicated so we had to ruthlessly remove many things lol

micha15:05:42

now it's much better

jethroksy15:05:20

I really should find companies who care more about their tech

micha15:05:12

where are you in the world?

jethroksy15:05:14

can't blame them, their main source of revenue is from an iOS app

micha15:05:46

ah i was going to suggest adzerk, but we're in USA simple_smile

jethroksy15:05:58

haha maybe some day simple_smile

jethroksy15:05:27

after I complete my studies, if you're still hiring

jethroksy15:05:40

gotta go, thanks for the insights!

micha15:05:47

see you later!

micha15:05:52

good luck!

seancorfield15:05:53

@dominicm: boot-new supports both Leiningen templates and Boot templates. Not sure what @richiardiandrea meant by his comment in the announcements channel.

richiardiandrea15:05:43

I think @dominicm was asking whether boot-new has its own template engine

seancorfield16:05:05

And boot-new generators can be used in both Leiningen and Boot projects too.

richiardiandrea16:05:30

but the question was: why I chose lein templating

seancorfield16:05:22

boot-new only loads Leiningen if it is processing a Leiningen template. Leiningen is not used to process a Boot template.

richiardiandrea16:05:07

probably then I could have chosen the latter, I will explore what are the advantages of having a boot template

richiardiandrea16:05:27

in my mind they were interchangeable

richiardiandrea16:05:53

and I chose lein for no rigorous reason

micha16:05:36

@mobileink: is the dependency issue resolved now? or is there a regression in 2.6.0-SNAPSHOT that needs to be fixed?

richiardiandrea16:05:43

but of course boot-new can generate both so...I don't think there is any problem with that

mobileink16:05:52

@micha: seemed to fix itself. i don’t think i made any material changes, it just started working. maybe some kind of network wierdness I guess.

micha16:05:17

ah ok, thanks

seancorfield16:05:33

I'd be very interested in suggestions for new Boot-template-only features for boot-new @richiardiandrea @dominicm

dominicm16:05:05

@seancorfield: I think I've misunderstood the term "boot template"

seancorfield16:05:11

Boot template: https://github.com/framework-one/fw1-template/blob/master/src/boot/new/fw1.clj — currently looks a lot like a Leiningen template but doesn’t use Leiningen.

seancorfield16:05:11

The difference is that a Boot template can bring in boot.core etc and do whatever Boot-related stuff it wants to (but it can’t bring in Leiningen stuff — some lein-templates call get-leiningen-version etc).

seancorfield16:05:57

And now having Boot-specific templates (which can generate any type of project, BTW), we can enhance boot-new separate to Leiningen to add any functionality that Boot users want.

seancorfield16:05:48

Right now there are very very few Boot templates out there — most folks are using boot-new to create projects based on Leiningen templates (since boot-new supports both) — but I’m hoping that will change and folks working with Boot will start producing Boot-specific templates.

richiardiandrea16:05:57

I am guilty of that...tbh I did not know about the fact that I could bring boot.core

pataprogramming17:05:28

I've got some Boot+CIDER+CLJS Browser REPL issues that I'm trying to work through, any assistance is appreciated. I'm trying to get the Boot setup from the modern-cljs tutorial working in CIDER, and am trying to figure out how to set up the Boot tasks to get this to work. Not sure if here, #C0617A8PQ, or #C03S1L9DN will be the best place to ask, so am starting here today. The dev task looks like (comp (serve) (watch) (reload) (cljs-repl) (cljs) (target :dir #{"target"})) CIDER launches boot with repl -s wait as its parameters, and injects the cider-nrepl and refactor-nrepl middleware. Just adding dev before the other parameters doesn't work...boot doesn't load the middleware. My end goal is to have two REPL buffers, one for CLJ, one for the CLJS browser REPL.

pataprogramming17:05:44

This is the command that CIDER synthesizes: boot -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.13.0-SNAPSHOT dev repl -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware -s wait

micha17:05:39

having both wait and watch in the same pipeline won't work

micha17:05:54

because the wait task will block the pipeline

micha17:05:13

so it will never return, and the watch task will not be able to run the pipeline again

pataprogramming17:05:31

I figure it was something along those lines, but my boot-fu is low. Can you calve off a child task so the rest won't block?

micha17:05:21

can you have cider not add the wait task?

micha17:05:43

not up to date with how cider works, unfortunately

pataprogramming17:05:07

Yeah, there's a lot of magic under various covers.

pataprogramming17:05:44

I ccan definitely remove the wait from the defaults and see what that does.

micha17:05:14

that should fix one problem anyway, and your watch task will then work correctly

micha17:05:47

you can also try putting your dev task after the repl -s

micha17:05:00

that might help, too

seancorfield17:05:24

Is there a Gitter room for Boot?

pataprogramming19:05:15

I think I've figured out a bit of the issue, at least, by running the boot command from the command line...it's starting up two nREPLs, and the first of them isn't getting the middleware added.

pataprogramming19:05:47

Or the second, depending on the order.

pataprogramming19:05:08

Also, am getting Warning: version conflict detected: org.clojure/clojure version changes from 1.2.0 to 1.7.0. boot show -p shows that version is probably coming from tools.nrepl. Not sure why the clojure version of 1.7.0 in boot.properties isn't overriding it?

pataprogramming19:05:38

Adding an extra -d to link in 1.7 fixes that warning, at least.

mobileink21:05:54

boot-mvn? my use case is creating EAR apps. I use uber -j to pull transitive deps from the foo dep and put them in foo/WEB-INF/LIB, then I use a custom task to pull everything else and put it in the right place, since I couldn't figure out how to do that with uber. is it worth the trouble to write a task lib for generally inspecting / extracting maven artifacts? anything out there that already does this?

richiardiandrea21:05:15

Not that I know of, but let's wait for other opinions

mobileink21:05:05

I suspect the EAR use case (which is actually the GAE modules use case) is an outlier. But I often find myself dumping maven jars just to see what's in there, and typing out the ~/.m2/... path gets old. Maybe there's a better way I don't know about.

mobileink21:05:27

sth like $ boot mvn/show -c foo/bar:0.1.0-SNAPSHOT might be handy. maybe also a set of switches like for sift, to extract stuff and put it into the fileset.

mobileink21:05:38

wonder if anybody but us cray-cray types would find that useful.

micha21:05:30

@mobileink: the war task doesn't do what you want?

micha21:05:43

it should do the WEB-INF/lib stuff and all that

micha21:05:31

ah it needs to be in foo/WEB-INF/lib

mobileink21:05:11

for a sec I thought "this is where I find out I've embarrassed myself again". I completely forgot about war. but I suspect it won't do (away from my machine, can't test.) The EAR project ( as I'm calling it) has no code, just some xml config stuff (which could be made EDN). So the build uses the maven jars to populate the war subdirs. that includes copying the transitive dep jars etc. and each maven component must be handled separately; the component wardirs are effectively independent (they could be implemented in other languages!) so it's entirely driven by build.boot and the maven jars

danielsz21:05:48

I published the results of my research around code reloading and thought this might be of interest to some here present: http://danielsz.github.io/2016/05/06/Ghosts-in-the-machine

mobileink21:05:47

I think this will turn out to be great exam of boot. with the build stuff offered bt google the components are subprojects of the modularized webapp. with boot they can be completely independent and so easily reusable across modularized webapps

mobileink21:05:22

the key is to use maven cords rather than relative paths.

micha22:05:58

very interesting

richiardiandrea22:05:04

very cool indeed

micha22:05:38

@danielsz: so where do you stand now iwth respect to code reloading vs restarting?

danielsz22:05:45

@micha: Both are warranted currently. Code reloading is desirable every time you make a change to source code to have the current definitions in memory. Because sometimes Vars can get "trapped" in threads (typical scenario is the handler you passed to the HTTP server), you would need to restart the whole system. This is why the boot-system task allows for both reloading and restarting.

danielsz22:05:55

The new implementation is pretty awesome if I may say. I'll release it next week. If you mark a namespace with :blood-of-spring-lamb, the reloading mechanism passes over it (Passover).

danielsz22:05:54

This whole reloading affair is full of subtleties, that's why I felt the need to write an in-depth blog post about it.

micha23:05:32

i have been using pods instead of reloading as much as possible