Fork me on GitHub
#boot
<
2016-04-20
>
alandipert01:04:25

@hlolli: you can do boot -V > boot.properties in your project directory and and add the jvm option to BOOT_JVM_OPTIONS

alandipert01:04:48

(that's also how you'd pin boot/clojure versions and other boot env vars on a per-project basis)

alandipert01:04:35

@hlolli: another decent option is to make a pom for that jar and install it to local mvn cache

jethroksy02:04:33

@tolitius: i'm getting errors loading boot with boot-check

jethroksy03:04:03

I get a lot of these:

Caused by: java.io.FileNotFoundException: Could not locate boot/core__init.class or boot/core.clj on classpath.
	at clojure.lang.RT.load(RT.java:456)
	at clojure.lang.RT.load(RT.java:419)
	at clojure.core$load$fn__5677.invoke(core.clj:5893)
	at clojure.core$load.invokeStatic(core.clj:5892)
	at clojure.core$load.doInvoke(core.clj:5876)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5697)
	at clojure.core$load_one.invoke(core.clj:5692)
	at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
	at clojure.core$load_lib.invokeStatic(core.clj:5736)
	at clojure.core$load_lib.doInvoke(core.clj:5717)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:648)
	at clojure.core$load_libs.invokeStatic(core.clj:5774)
	at clojure.core$load_libs.doInvoke(core.clj:5758)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:648)
	at clojure.core$require.invokeStatic(core.clj:5796)
	at clojure.core$require.doInvoke(core.clj:5796)
	at clojure.lang.RestFn.invoke(RestFn.java:551)
	at user$eval3$loading__5569__auto____4.invoke(user.clj:1)
	at user$eval3.invokeStatic(user.clj:1)
	at user$eval3.invoke(user.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:6927)
	at clojure.lang.Compiler.eval(Compiler.java:6916)
	at clojure.lang.Compiler.load(Compiler.java:7379)
	... 14 more

jethroksy03:04:20

do the tests run in another namespace where boot.core is not found?

jethroksy03:04:57

@tolitius: found that I needed to add boot to the dependencies vector as per your example project

hlolli08:04:26

@alandipert: thanks for pointing out making a POM. I've had no success so far using BOOT_JVM_OPTIONS (or jvm options in lein for same problem for that matter).

slotkenov11:04:22

Anybody seen this message before when compiling ClojureScript: WARNING: Unknown compiler option ':warning-handlers’.

micha11:04:53

@slotkenov: it's just a harmless warning introduced recently in the cljs compiler

nberger11:04:28

It was introduced in 1.8.34 and fixed in 1.8.40

slotkenov11:04:01

ah ok, thanks @nberger and @micha

tolitius13:04:24

@jethroksy: boot-check 0.1.2-SNAPSHOT already have that dep. I understand this might be not a desired approach: https://github.com/tolitius/boot-check/issues/2 but it would require quite a rework of the lib ( pull request is very welcome :) )

jethroksy15:04:22

@tolitius: cool! I'll take a look

kahlin19:04:02

Hey, I’m trying to use the boot-beanstalk task (https://github.com/adzerk-oss/boot-beanstalk) but I keep running into errors. Has anyone had any success using that task or am I wasting my time? I’m new to boot so I’m having a hard time deciphering the errors...

martinklepsch19:04:00

@kahlin: not using it myself but maybe people have ideas if you paste the error simple_smile

alandipert19:04:03

@kahlin: what kind of errors are you getting?

alandipert19:04:19

also i can share working build.boots for our beanstalk apps if that would be helpful

kahlin19:04:23

I get this:

clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
    data: {:file
           "/var/folders/8k/x4zdr9916416yjv7_b9z9rwh0000gn/T/boot.user5014082652765978733.clj",
           :line 53}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
     java.lang.IllegalArgumentException: No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
Yes, working build.boots would be very helpful!

alandipert19:04:49

can you paste your build.boot?

alandipert19:04:55

also what kind of beanstalk is it, docker or war?

kahlin19:04:16

It’s a war. Hold on, I’ll try to extract the relevant bits from build.boot.

kahlin19:04:59

This is more or less copied from the readme:

(deftask build-prod
 []
 (comp (aot) (web) (uber) (war) (target)))

(deftask deploy-tomcat
  "Deploy application to AWS Tomcat environment"
  []
  (task-options!
    beanstalk {:stack-name "64bit Amazon Linux 2016.03 v2.1.0 running Tomcat 8 Java 8"})
  identity)

(task-options!
  pom {:project 'wisall
       :version "0.1.0"}
  jar {:main 'wisall.core
       :file "wisall.jar"}
  aot {:all true}
  web {:serve 'wisall.core/app}
  serve {:port 3000
         :handler 'wisall.core/app}
  beanstalk {:name           "wisall"
             :version        "0.1.0-SNAPSHOT"
             :description    "wisall"
             :access-key     (System/getenv "AWS_ACCESS_KEY")
             :secret-key     (System/getenv "AWS_SECRET_KEY")
             :beanstalk-envs [{:name "wisall-prod"  :cname-prefix "wisall"}
                              {:name "wisall-stage" :cname-prefix "wisall-stage"}]})

kahlin19:04:02

(I’m running with boot build-prod beanstalk --deploy --file target/project.war)

alandipert19:04:45

hm nothing sticks out

alandipert19:04:53

although it looks like maybe you need the :env key?

kahlin19:04:03

Hmm, same error with :env.

alandipert19:04:04

there we use the eb-war task which handles .ebextensions appropriately by putting them in the root of the jar (instead of at WEB-inf/classes)

alandipert19:04:12

there's a lot of extra nonsense in for local dev and sending to slack, the tasks of interest are build and deploy

alandipert19:04:58

ooh i think i see

alandipert19:04:06

i believe the :file argument to war is a fileset-relative path

alandipert19:04:15

it gets the war to deploy from the fileset, not the target directory

alandipert19:04:28

where the fileset is that anonymous git-repo like object that is passed between tasks

alandipert19:04:02

maybe try boot build-prod beanstalk --deploy --file project.war

alandipert19:04:33

and then you don't need (target) in build-prod

kahlin19:04:44

Hmm, I see. I’ve tried it with just project.war rather than target/project.war but that didn’t help.

alandipert19:04:53

same exact error?

alandipert19:04:31

also, after boot build-prod do you indeed see a target/project.war?

kahlin19:04:36

I can’t recall if it was the same exact error, but it was similar. Right now I’ve done something to make things not work at all unfortunately. 😕 I think it was the exact same error.

kahlin19:04:41

Yup, target/project.war is there. If I upload it manually to beanstalk everything works, so the build part is working as expected.

kahlin19:04:24

How come I don’t need (target) if I do —file project.war? I’m still trying to wrap my head around the filesets.

kahlin19:04:55

Do I need (target) only if I’m interested in using the artifacts outside of boot?

alandipert19:04:01

that's exactly right

kahlin19:04:33

Ah, I see. So the boot tasks operates on the filesets which is an abstraction of the filesystem?

alandipert19:04:39

also correct

alandipert19:04:52

a java object is passed between tasks that represents an anonymous filesystem

alandipert19:04:05

under the hood it does content-based addressing and structural sharing via hardlinks to be efficient

alandipert19:04:48

one of the main ideas with boot is that build tools get tricky when parts of a build need to coordinate around a single mutable place, such as a known directory on disk

alandipert19:04:05

which usually necessitates a clean operation

alandipert19:04:23

so to be able to program builds, we need the filesystem to be first class and anonymous

alandipert19:04:29

which is the fileset thing

kahlin19:04:10

I see. I’m starting to understand (I think). Still, no luck with my beanstalk task. At least now I know it should be working. I’ll investigate your build.boot more closely and try to understand the differences.

alandipert19:04:05

cool. yeah you might try incrementally moving parts from it to your own

alandipert19:04:40

we are currently moving away from beanstalk

alandipert19:04:13

but we'll continue to maintain the task

alandipert19:04:55

mostly because it's really hard to debug... eb apps are supported by tons of auto-generated resources that are hard to find and understand as a whole, which you need to do if you have problems

alandipert19:04:20

also you can't make any changes during deploys, so if the deploy goes bad there's nothing you can do to mitigate downtime

alandipert19:04:48

and then for worker tier, your workers have lots of problems if jobs take more than a few minutes, since you hit all the hardcoded timeouts in the worker tier web stack

alandipert19:04:12

micha invented an alternative that's built from simpler parts and has most of the same affordances

alandipert19:04:24

basically we use a few shell scripts and orient around ASGs

alandipert19:04:16

i think it's still a great choice for many things though, especially if you only have a handful of eb apps

alandipert19:04:33

but we're approaching a dozen and it's worth it to us to start building out our own infrastructure for these kinds of things

kahlin19:04:43

I see. I’m building a fairly simple webapp so I don’t anticipate running into “hard” problems like that. And some downtime won’t be critical either so I think it’ll be a good fit for what I’m doing.

kahlin19:04:33

With sift —include project.war I get another error (it now complains about missing environment which makes sense).

kahlin19:04:34

I’ll keep on trying. Thank you for your help Alan!

alandipert19:04:53

no problem! happy computing 💻 boot-clj clj

kahlin20:04:53

My problems seems to be solved, sift was the magic that was needed. Thanks again!

symbit20:04:15

Anyone know how to get rid of what looks like unix colorizing escape characters from boot output on Windows? ←[m←[1mò I tried BOOT_COLOR=no. That turns some lines off, but others persist.

symbit20:04:05

This might have something to do with Hoplon. When BOOT_COLOR=no only Hoplon related compiler output has the escape chars.

alandipert20:04:08

@symbit: not sure why that would happen, maybe look around boot-hoplon

symbit20:04:15

@alandipert: Will take a look. with BOOT_COLOR=no ←[1mCompiling Hoplon pages... with BOOT_COLOR=yes ←[m←[1mCompiling Hoplon pages...

alandipert20:04:04

definitely weird

symbit21:04:26

Likewise BOOT_COLOR=yes ←[m←[1mò index.html.js and BOOT_COLOR=no ò index.html.js

mynomoto22:04:19

@alandipert: about beanstalk have you seen http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.CNAMESwap.html ? They just announced blue/green deploys.

seancorfield23:04:54

Something I keep running into with Boot’s pods: if I run a process in a pod, that does some sort of scheduled cleanup, it often ends up running in the pod after the classloader has been cleared out — so you get these bizarre NoClassDefFound exceptions after a task has completed but when Boot is running other tasks.

seancorfield23:04:38

A concrete example: I’m using Carmine to talk to Redis. It sets up cache eviction tasks that run on a Java Timer… and the task finishes and the pod is cleaned up … and then the timer fires and the eviction task fails because the Apache Commons Pool library got unloaded / cleaned up.

seancorfield23:04:17

Any thoughts on how to avoid this sort of thing? It seems at least potentially a little dangerous...