This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-13
Channels
- # announcements (2)
- # beginners (29)
- # boot (122)
- # cider (9)
- # clara (6)
- # cljs-dev (9)
- # clojure (27)
- # clojure-art (3)
- # clojure-dusseldorf (5)
- # clojure-europe (1)
- # clojure-india (2)
- # clojure-losangeles (1)
- # clojure-spec (29)
- # clojure-uk (2)
- # clojurescript (56)
- # cursive (11)
- # datomic (9)
- # fulcro (8)
- # liberator (1)
- # off-topic (2)
- # other-lisps (1)
- # quil (37)
- # re-frame (2)
- # reitit (1)
- # ring (4)
- # test-check (4)
- # tools-deps (3)
oooo micha thats a good idea, we should include a lein->boot task by default
i’ll look into it, seems like it would be fairly simple to slurp it up either way
i don't think there is a simple single place in the project.clj to look to find dependencies
ok, then the task would either need to replicate some of the lein config or utilize lein to parse the project file
that seems rather doable, the boot-shadow task works the same way, we use shadow-cljs as a library
a few other items on my radar are the dependency loading in general, i’d like to provide options for people who also use tools/deps.edn
the next version of the boot-shadow task will exclusively pull deps from the shadow-cljs.edn file
yeah the nice thing with pods is that we can mix and match
like the shadow task only pulls deps into the pod it uses for compiling, it leaves all the runtime deps to npm
What is the process for creating a custom clean task deletes all files in a folder except for .git?
boot isn't really designed for that kind of task, it's designed to leverage immutability in builds
so managing a mutable tree of files is not really someting you probably want to use boot for
Oh, the use case is when I run build it outputs to the target/public directory and cleans it. But now I want to make the public/target a submodule to a github pages repo so cleaning is fine, I just don’t want it to delete the .git folder if possible.
the only place where boot intersects with your project files is when it writes to the target dir
you can look at the target task, i bet it would be easy to copy and paste that with a slight modification to do what you need
Ah ok, that’s what I’ve been looking through currently but was curious if that was the best way.
Yeah, I saw the no clean but cleaning is still a good idea. The blacklist option sounds like what I’m after.
@micha I do know docker!
i'm mapping in /var/run/docker.sock in my container so i can run another container inception style
but when i map volumes it looks like i can't map a volume from level1 docker into the level2 docker
hm, I know there are volume mapping issues with docker-in-docker
this isn't technically docker in docker, i'm just making /var/run/docker.sock available in the level1 container
yeah it’s not technically docker-in-docker, but I think the symlink might work for you
yeah, I am always weary of doing stuff between host/docker, I generally opt for either in docker or out of docker
yeah my situation is i have some automation around deployment, cloudformation, and so on
so for managing the infrastructure stuff i like having a docker container with the right versions of everythying, like npm for aws lambda functions, etc
yeah I like the solution you have tho, it makes much more sense instead of a random symlink
omg, so much dockerception
but it does achieve the goal of not maintaining a "how to prepare your system to build this service" for every service and every OS
I like this, we use a “boot is the environment” thing so it’s our only hard dependency
I have never needed anything but the latest version
# Node Build
FROM node:alpine AS node
# App Workdir
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Node Dependencies
COPY ./package.json /usr/src/app
RUN npm install
# Boot Build
FROM AS boot
# Boot ENV
ENV BOOT_JVM_OPTIONS=-Xmx2g
# Boot Cache Dependencies
RUN boot repl -e '(System/exit 0)'
# App Workdir
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# App Files
COPY --from=node /usr/src/app .
COPY . /usr/src/app
# App Build
RUN boot build
# Node Runtime
FROM node:alpine AS app
# App Workdir
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# App Files
COPY --from=boot /usr/src/app/target .
CMD ["node", "nodejs"]
EXPOSE 8080
This is the build we copy-paste everywhere
so first we prep and cache as much as we can, then we download all the npm deps, then build with boot, and finally move the app to a fresh node image
If only there was a build tool in clojure you could wire this up with 🙊
haha one of the best reasons to use docker is because you can then write bash scripts without needing to work around OSX braindead bash and coreutils
yeah, thats why I want to get boot running as a native image, so I can just Lisp all the things™️
@flyboarder +1 🙂 I think there is some common interest between this and clojure shell project closh. We've also looked into GraalVM. There are also some features in boot that closh is interested in (e.g. boot pods) (https://github.com/dundalek/closh/issues/119).
I believe there could be some synergy between the projects
Awesome! Once I start work on splitting the pods into their own library maybe you can help me test it out
yes, cool
without the performance hit of jvm
it works but it’s highly alpha, Im going to try and get my containers moved over to the native-image and see what kind of performance issue arise
hm, I think I saw something about that, but the thing about graal is that it’s closed world, so you need everything at build time
I would imagine the aws sdk is loaded on demand
since it’s so huge
yeah that might work
easiest way to find out is use the graal docker image and try building your app
bahahaha
if it doesnt compile then it’s not worth investigating, with boot it compiled fine and I only had to sort out dynamic loading issues
but it seems most projects get stopped at the compile step
and never get to runtime issues 😛
also graal isnt even v1 yet
so I dont plan on releasing the boot version until that happens
well it’s fairly simple, you delay all the dynamic stuff to the spawned jvm
then it’s business as usual
really we just shift all the static stuff to graal and compile that to native
so it’s really fast
but we do drop 1 level of classloader shims which is nice
nice!
If anyone else is interested in the experimental work on boot:
@flyboarder huge kudos for taking over 🙌 Consider applying for the next ClojuristsTogether batch, I think boot would be a great candidate and there's definitely some stuff to do 🙂

@martinklepsch I have put my hat in for that! Any funding would help go along way!
@flyboarder +1 🙂 I think there is some common interest between this and clojure shell project closh. We've also looked into GraalVM. There are also some features in boot that closh is interested in (e.g. boot pods) (https://github.com/dundalek/closh/issues/119).