This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-21
Channels
- # admin-announcements (2)
- # beginners (22)
- # boot (223)
- # cider (161)
- # cljs-dev (19)
- # cljsrn (4)
- # clojure (186)
- # clojure-austin (6)
- # clojure-beijing (1)
- # clojure-boston (3)
- # clojure-china (1)
- # clojure-czech (1)
- # clojure-france (1)
- # clojure-greece (10)
- # clojure-russia (17)
- # clojure-uk (154)
- # clojurebridge (3)
- # clojurescript (82)
- # component (12)
- # cursive (12)
- # datomic (71)
- # dirac (3)
- # editors (2)
- # emacs (29)
- # flambo (31)
- # hoplon (21)
- # immutant (11)
- # instaparse (17)
- # jobs (2)
- # jobs-discuss (2)
- # jobs-rus (1)
- # lein-figwheel (12)
- # leiningen (2)
- # off-topic (44)
- # om (78)
- # onyx (38)
- # parinfer (1)
- # re-frame (34)
- # reagent (32)
- # spacemacs (56)
- # untangled (74)
- # vim (12)
- # yada (2)
@mynomoto: yeah, we do deploys on the web things like that
@mynomoto: on new things though we scale set instance protection on new instances, scale ASG to 2x, and then scale down to 1x which kills the old nodes. so a really easy rolling deploy
@mynomoto: if you are interested maybe micha and i can do a screenshare of our eb replacement tools, we definitely want to share the stuff when it's a little more polished
@seancorfield: hmm maybe inside a pod there sholud be something like a shutdown hook/destructor one can register for? to clean up resources in the pod before it gets reaped
makes sense to me that pods should have this, as tasks do
considering pods are the primary resource used in tasks
so in your case your shutdown handler inside the pod could clear the timers
But how would it know what to do in the general case? @alandipert The symptom is an exception about a class not found in a library I don’t even depend on.
boot show -d
highlighted that Carmine pulls in commons-pool and it took some Googling to make the connection with the missing class.
the library with the timer doesn't expose a way to clear it?
It’s a deep system internal to how connection pooling is handled for Redis inside Carmine, as far as I can tell.
It doesn’t seem right that I would need to know about that transitive dependency and figure out a way to clean up after that library just because I’m running inside a pod…?
I’ve run into this a few times with pods — with Expectations you have to ensure you disable run on shutdown if you require the library in anywhere inside Boot; with Hazelcast I ended up writing a shutdown hook specifically to expose it to Boot to clean up the pod during testing… but that felt hacky.
it is unusual, especially considering code runs like this in servlets all the time... which is the same scenario
Except that Servlets don’t unload classes?
do they not? i was under the impression that's how hot deploys work
@alandipert: that would be cool (replacements for eb). There are so many options. Ecs + docker also looks pretty good
Well, that a) doesn’t happen very often and b) no one really cares about a handful of cleanup exceptions when you do a deploy...
…but reliably getting exceptions to the console while running tests is… annoying as heck
If the recommendation is simply to explicitly shutdown the pool eviction timers in the pod code, sure, I’ll go ahead and figure out how to do it… But I was hoping there was something cleaner and more generic that I was just missing 😞
i would say the underlying problem is downstream, it's just wrong to use resources without providing a means to deallocate/cancel
so anything we can do in boot would be a workaround, which is cool, and some come to mind
maybe the thing registers a jvm shutdown hook?
oh wait, so you do have a way to cancel the timers yourself?
i'm with you it doesn't sound generic, but it does seem clean
also as i haven't seen this before i'm probably missing stuff, so if you have time to post an example on gh that would be super useful. would be interested to poke around
@mynomoto: yeah! it's a jungle. we're settling on our shell scripts and eb
tool with a few conventions, and deploying standalone uberjars that run their own web servers. and a custom AMI
Looking at the Carmine source, it’s because we’re using the default connection mode so it creates the connection pool behind the scenes and just assumes it can live until the end of the program...
maybe it can be configured to not use a connection pool? then you could do that, in testing
Or we’d have to switch our code around to explicitly create the pooled connection ourselves and pass it into Carmine — and then expose a hook to explicitly close it.
(which is essentially what we ended up doing with Hazelcast)
And, yeah, we could use a non-pooled connection during testing… not sure how much that would slow things down… I could certainly try it.
incidentally, are you aware of any JVM implementation of the redis server? i am curious about slaving a JVM directly to a redis so that the cache is in-process
I’m new to Redis so, no, sorry
We’re ultimately moving from Hazelcast to ElastiCache so we’re evaluating Redis as part of that. We’re also starting to look at DynamoDB (so we’ll be playing with Faraday which is another taoensso library!).
So. Many. Freakin’. Options.
dm3: you could also use sift :add-jar
. And depending on what you want to do either might not be needed.
hmm:
(from-webjars :name "font-awesome/css/font-awesome.min.css")
Adding META-INF/resources/webjars/font-awesome/4.6.1/css/font-awesome.min.css to fileset
java.lang.NullPointerException:
io.clj: 404
io.clj: 416
cljsjs.boot-cljsjs/copy-file boot_cljsjs.clj: 20
cljsjs.boot-cljsjs/eval2736/fn/fn/fn boot_cljsjs.clj: 75
@juhoteperi: what's the best way to mark task option as mandatory in boot?
Hi everyone, I'm looking for some documentation on the boot show -p
option, but can't seem to find it...
I'm mostly wondering what the !
means here:
[!] riddley
✔ 0.1.12
manifold
✘ 0.1.10
clj-http
clj-http-fake
clj-webdriver
@eveline: the [!]
there means that the version of that dependency was decided by Aether and not specified by you as a direct dependency
@eveline: like in that case you have four dependncies that depend on riddley, three of them depend on version 0.1.10, and one depends on 0.1.12
aether has a sort of arbitrary way of resolving transitive dependency conflicts like this one
I've never used figwheel/sidecar before. I'm quickly seeing why boot is so superior.
@dominicm: yesterday a coworker started a project using figwheel and the cljs-repl was taking 1s to return (inc 1)
. I converted that to boot and then it returned instantaneously. That's have been my experience on both sides consistently.
Big project, we have custom leiningen plugins and such, so I can't justify switching to boot at this point really. I'd love to at some point.
@dominicm: what are the custom lein plugins (just out of curiosity)
@martinklepsch: We have some kind of docker/beanstalk leiningen plugin. I could probably port to boot, but I don't understand it very well. I think it's just taking a jar, and passing it into a library.
The hardest part of boot, is understanding the leiningen stuff, so you can port it to boot.
I'm sure all docker/eb related things are covered by Alan & Micha already 😄
Yeah, not sure about the docker part but the eb should be fine. But converting large projects is hard...
for me it was easy better to configure beanstalk directly than to make a Java program to do it via the clojure plugin
the plugin had just as much of the magical map configuration but wasn't aws maintained so it had to make assump tons
so, I'm trying to get a clj boot workflow that matched what I had with leiningen in addition to the cool component refresh stuff (a separate task leveraging 'system'), how do I turn off the fileset stuff when building a classpath and use source directories directly? boot.user=> (http://clojure.java.io/resource "/my_app/core.clj") #object[java.net.URL 0x3ddc44a6 "file:/home/gary/.boot/cache/tmp/home/gary/dev/my_app/169/-grrwi1/my_app/core.clj"]
it looks like (get-env :directories) returns the cache dirs and not the source dirs. Perhaps I'm missing a step that copies modified source into the cache.
it seems like some variant of the watch task is needed, really I'm just getting started with the mental model.
the files in your project that you add to the fileset via :source-paths etc are copied into temp dirs
@micha: Interesting. It's possible that we hard-code that stuff, I really couldn't tell you how that plugin works
@dominicm: it's been a year or so since i looked at lein-beanstalk, but the version i used in boot-beanstalk needed to hardcode things internally that don't need to be hardcoded if you use the eb
tool
and there are a lot of things that were not implemented in the plugin that are implemented in the eb tool
I want a server I can hack on, and I don't want to learn something new to be able to use it.
yeah and the worst thing is that they change things in the beanstalk stack all the time
@mynomoto: But they're a complex hierarchy system really right? Easy to have small mistakes cause issues
@dominicm: I actually think it is easier to use security groups as target rules on other security groups. That makes harder to make mistakes imo.
can someone point me to an example of a working cljs-test boot task? I just cannot get mine to work for some reason...
@lwhorton: https://github.com/martinklepsch/tenzing is a template that should setup it for you using +test
option
I have been looking at that, thanks for the ref though @mynomoto. What’s stranger still is that I can get the tests to run as expected without hiccup, but only if I use :advanced optimizations
:none just give me
Running cljs tests...ClojureScript could not load :main, did you forget to specify :asset-path?
ERROR: doo was not loaded from the compiled script.
Make sure you start your tests using doo-tests or doo-all-tests
and that you include that file in your build
@lwhorton: you may open an issue on https://github.com/crisptrutski/boot-cljs-test . You probably could use :simple optimizations or :whitespace that should be faster than :advanced. The test runner is probably not loading the js referenced by main.js.
Being new to boot, I have a rudimentary boot project that I want to i) Dockerize, then ii) start a server in the background, so I can have iii) the option to stop it later
But with my custom task (https://github.com/twashing/beatthemarket/blob/master/build.boot) which uses this code (https://github.com/twashing/beatthemarket/blob/master/src/beatthemarket/shell.clj), if I execute boot run
, I just get this error:
$ boot run
clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@4d32b021
data: {:file
"/var/folders/dv/qph8cnxn5c5fqyxbc60bj16m0000gn/T/boot.user8563596840446670088.clj",
:line 21}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@4d32b021
java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@4d32b021
...
org.httpkit.server/run-server/stop-server server.clj: 26
...
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1938
...
boot run
works if the run task just has (println “Hello World”)
, so there’s something I’m missing when requiring in the beatthemarket.shell namespace.
@twashing: if you do boot repl
and require that ns, does it work?
$ boot cider repl
nREPL server started on port 61756 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
...
boot.user=> (require '[beatthemarket.shell])
nil
$ cat ~/.boot/profile.boot
(deftask cider "CIDER profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.12.0"]
[refactor-nrepl "2.2.0"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
$ cat ~/.boot/boot.properties
#
#Sun Apr 03 19:27:50 PDT 2016
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_VERSION=2.5.5
BOOT_CLOJURE_VERSION=1.8.0
BOOT_EMIT_TARGET=no
@twashing: which version of cider
are you using?
if 0.12
you should not need any cider
task as middlewares are auto-injected
just to be sure 😉
$ ll ~/.boot/
total 16
drwxr-xr-x 5 timothyw staff 170 Apr 21 13:32 .
drwxr-xr-x+ 63 timothyw staff 2142 Apr 21 13:02 ..
-rw-r--r-- 1 timothyw staff 155 Apr 19 16:30 boot.properties
drwxr-xr-x 6 timothyw staff 204 Mar 12 14:35 cache
-rw-r--r-- 1 timothyw staff 430 Apr 19 16:41 profile.boot.1
$ boot run
clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@2997042b
data: {:file
"/var/folders/dv/qph8cnxn5c5fqyxbc60bj16m0000gn/T/boot.user3887614655177056510.clj",
:line 15}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@2997042b
java.lang.IllegalArgumentException: No value supplied for key: boot.core$run_tasks$fn__901@2997042b
...
org.httpkit.server/run-server/stop-server server.clj: 26
...
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1938
(require '[beatthemarket.shell])
(deftask run []
(beatthemarket.shell/start-server))
which calls out to here: https://github.com/twashing/beatthemarket/blob/master/src/beatthemarket/shell.clj#L39-L40
it looks like the culprit is -> org.httpkit.server/run-server/stop-server server.clj: 26
but just guessing 😄
im not experienced enough with boot to understand/construct my own without it taking all day, and I really just want to move on
@richiardiandrea hmm, is there a way in boot, to see the elided stacktraces?
Seems my deftask needed to return a fn, that returns a fn, like here: https://github.com/boot-clj/boot/wiki/Tasks#the-null-task
now I just need to daemonize this, so it serves files… currently it just exits after running.
(require '[beatthemarket.shell])
(deftask run []
(fn [next-task]
(fn [fileset]
(beatthemarket.shell/start-server))))
@twashing: try to append wait
at the end of your task chain
@richiardiandrea boot run -- wait
doesn’t work
Why --
? try to remove them
Uhm...gotta go now but it definitely should, I usually use it with serve
@richiardiandrea ok, thanks for the help
NP sorry I could not help more ;)
(deftask run []
(fn [next-task]
(fn [fileset]
(shell/start-server)
(next-task fileset))))
… looks like docker run beatthemarket run wait
gets me closer there (although I don’t understand how docker knows how to run boot waith said arguments)
see here: https://github.com/adzerk-oss/boot-clj-docker-image/blob/master/Dockerfile
but it doesn’t seem to know about my run
task
clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No such task (run)
data: {:file "/tmp/boot.user1450022986807314043.clj", :line 7}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No such task (run)
java.lang.IllegalArgumentException: No such task (run)
boot.core/construct-tasks core.clj: 754
...
clojure.core/apply core.clj: 630
boot.core/boot/fn core.clj: 805
clojure.core/binding-conveyor-fn/fn core.clj: 1916
hmm, what’s the default app directory. ie, which directory should I copy build.boot to?
FYI, looks like WORKDIR is the relevant command: https://docs.docker.com/engine/reference/builder/#workdir