Fork me on GitHub
#boot
<
2017-07-03
>
cjhowe00:07:01

does anyone have a good tutorial for boot setup?

minikomi03:07:31

Best way to check if a resource has been updated & wether to run a task? Timestamp in an atom?

martinklepsch10:07:55

@minikomi common pattern is to store the fileset of the previous invocation and compare files’ checksums

dominicm10:07:12

@minikomi my mind goes to boot-sass as a potential example of doing this

minikomi10:07:53

thanks, will look it up boot -garden was a good example of tracking when namespaces change, using ns-tracker, but was trying to find a good resources-change example.

dominicm13:07:59

https://github.com/boot-clj/boot/wiki/Running-Boot-on-CI-systems#circleci-v2 mentions that the "inotify watch limits" are solved. However I'm still seeing them occasionally. I'm optimistically hoping I'm doing something wrong I have tweaked the template slightly). Any suggestions?

dominicm13:07:31

@juhoteperi looks like you wrote the v2 info.

juhoteperi13:07:51

I have not seen any inotify problems with that configuration

dominicm13:07:45

Hmm, odd. Something to keep an eye on I guess... it seems to happen sporadically. So it could be something else. j/w, but did you need to add apk update && apk add git openssh to get circleci to quit complaining about checkout?

juhoteperi13:07:07

Cljsjs is using debian base instead of alpine (so no apk)

juhoteperi13:07:43

Cljsjs has already ran at least hundreds of builds with new configuration and previously every 25 build or something like that failed due to inotify limit

dominicm13:07:01

ah, okay. I started from the example verbatim.

juhoteperi13:07:21

You can try clojure:boot-2.7.1 instead of clojure:boot-2.7.1-alpine

juhoteperi13:07:19

I'm running alpine version in Jenkins but Git checkout is running outside of docker container there

dominicm13:07:50

makes sense that the debian image would have git/ssh already, and alpine would definitely not.

dominicm13:07:05

I'll take a look at using the debian image, see if that helps at all.

juhoteperi14:07:13

Hmm yes, perhaps it will be good idea to change the example as in CircleCI one always wants to have git available

dominicm14:07:13

I mean, apk update && apk add git openssh works. Is the lightness worth the extra line in config (and does it offset the cost?)

juhoteperi14:07:49

No, using existing image, even if larger, is probably faster than having to install new software

juhoteperi14:07:01

Debian image is anyway cached at Circle servers

dominicm14:07:13

yeah, I was just checking if they cached the image.

plexus14:07:43

is there a way to run boot tasks in parallel?

dominicm14:07:16

I think there's something called multiboot hanging around somewhere. Might be lying though.

plexus14:07:47

yes, seems runcommands is what I was looking for

juhoteperi14:07:47

That is to commands parallel, not tasks

plexus14:07:33

good enough for what I need I think, we're trying to run two watch tasks without having to start two jvm processes

juhoteperi14:07:39

Or well, tasks, but you have to provide tasks as strings... I don't see what is the reason behind that

plexus14:07:25

apparently because it runs boot-in-boot, i.e. in a separate pod (I'm just saying words here that I read somewhere ;))

juhoteperi14:07:06

I remember writting parallel higher order function, which runs given task functions parallel, but I'm not sure where that is.

dominicm14:07:53

You can always "cheat" and use (future (boot …)) right?

juhoteperi14:07:09

It depends, if you want single fileset and pipeline, then no

dominicm14:07:28

oh neat, runcommands works on the existing fileset. I expected it to run on a new one for some reason.

plexus14:07:29

so apparently somewhere here had already tried runcommands, and it crashed the JVM due to concurrent modifications in boot's tmp directories

plexus14:07:43

giving this a try

plexus14:07:46

(deftask multi-task []
  (let [tasks [(future (boot (...)))
               (future (boot (...)))]]
    (run! deref tasks)))

juhoteperi14:07:31

Tasks should return the middleware function.

juhoteperi14:07:00

But you can just declare multi-task as normal function instead of task

richiardiandrea15:07:50

yes @plexus runcommands is the way to run tasks in parallel, but of course that does not protect from concurrency issues

richiardiandrea15:07:09

so you have to implement your own locking/compare and swap if some resource is shared

danielcompton22:07:09

Is there a way to safely cache ClojureScript compilation results in CI, so that the next time CI runs, it happens faster?