yada

cjsauer 2018-05-16T16:41:19.000162Z

Hello there, I'm testing out yada and stumbled onto the edge project. I'm eager to use it as a base, but am wondering what is the "recommended" approach to extending this? Should I be creating my own app folder, or does it make more sense to carve out my own namespace under the existing src folder?

malcolmsparks 2018-05-16T16:42:24.000453Z

Hello. Start adding namespaces under app

cjsauer 2018-05-16T16:43:54.000055Z

Makes sense. What about configuration? Where would you say is the best place to shift the system over to using a customized config.edn? Is it sufficient to move the existing config to config.edge.edn and start my own config.edn?

malcolmsparks 2018-05-16T16:45:24.000011Z

Our advice is too add to config.edn until you are familiar with the setup, then gradually take away the phonebook and other components.

cjsauer 2018-05-16T16:45:57.000529Z

Cool, that's exactly what I was after. Thanks for the help 🍻

cjsauer 2018-05-16T16:55:37.000695Z

Another quick question: what is the recommended deployment strategy for edge? I'm still pretty new to deps.edn, so I'm unfamiliar with how building/deploying happens with this setup.

cjsauer 2018-05-16T16:56:11.000738Z

I normally lean on Heroku to host my Clojure projects. Would that still make sense here? What does juxt normally lean on?

cjsauer 2018-05-16T16:57:25.000435Z

(Side note: I'm really loving the use of aliases in edge. This is a very promising way to structure projects, so thank you for a great example.)

dominicm 2018-05-16T17:00:26.000352Z

I haven't added it yet, but packaging with pack is something I need to do. Then heroku shouldn't be absolutely terrible. We had to cheat with heroku and a build pack when we used it.

cjsauer 2018-05-16T17:02:24.000092Z

Quick google brought me here: https://github.com/juxt/pack.alpha Lambda is a close second as far as deployment preferences go. Is Lambda a good candidate for running yada/edge, or would a less transient server be required?

dominicm 2018-05-16T17:10:51.000023Z

yada + lambda don't play together. There's not a ring abstraction for lambdas yet to my knowledge, yada would need that as a minimum to start working, and then an async layer on top of that.

cjsauer 2018-05-16T17:13:28.000067Z

Hm I see...maybe "Dockerizing" the app and running on Beanstalk would be a path-of-least-resistance :thinking_face:

dominicm 2018-05-16T17:14:10.000932Z

We've done heroku with edge, but not published it. If you're comfortable with heroku, that's a good way to do it. We generally deploy to EC2.

cjsauer 2018-05-16T17:15:29.000385Z

I'll give it a try. Out of curiosity, what were the "cheats" you made to the buildpack? Were they JVM tweaks?

dominicm 2018-05-16T17:17:32.000067Z

No, no. It's just that the clj cli tool is not yet in any heroku build packs. We had to use a buildpack which runs an arbitrary bash script, which installs clj and then does the build.

dominicm 2018-05-16T17:18:08.000553Z

#!/bin/sh

cd $BUILD_DIR/app

curl -O <https://download.clojure.org/install/linux-install-1.9.0.358.sh>
chmod +x linux-install-1.9.0.358.sh

mkdir cljlocal
./linux-install-1.9.0.358.sh -p cljlocal

./cljlocal/bin/clojure -R:build -m io.dominic.krei.alpha.main production "static"

./cljlocal/bin/clojure -Sdeps '{:deps {pack/pack.alpha {:git/url "<https://github.com/juxt/pack.alpha.git>" :sha "bb2c5a2c78aca9328e023b029c06ba0efdd1e3b7"}}}' -m mach.pack.alpha.capsule deps.edn $BUILD_DIR/foobar.jar static/ foobar 0.0.1
^^ that is the buildpack-run.sh we use.

dominicm 2018-05-16T17:18:36.000631Z

https://github.com/weibeld/heroku-buildpack-run with this I believe (uncertain)

dominicm 2018-05-16T17:18:53.000659Z

But you have to chain this buildpack also with the java one I think.

cjsauer 2018-05-16T17:23:49.000340Z

Ahhh ok that makes sense. Thanks for this!

dominicm 2018-05-16T17:39:05.000451Z

No problem 🙂 We really need to document this stuff.

aengelberg 2018-05-16T22:38:31.000245Z

Does Yada support Transfer-Encoding: chunked requests?

aengelberg 2018-05-16T22:38:57.000137Z

I tried to write a handler that uses :consumer but that consumer never gets called when a request comes in with Transfer-Encoding but no Content-Length

aengelberg 2018-05-16T22:40:44.000398Z

I think I identified at least one bug relating to that here: https://github.com/juxt/yada/blob/master/src/yada/interceptors.clj#L174

aengelberg 2018-05-16T22:41:41.000150Z

but I'm not sure if I can just patch that line to something like (or (get-in request [:headers "transfer-encoding"]) (and content-length (pos? content-length)))

aengelberg 2018-05-16T22:42:09.000349Z

because in that case there would need to be code that actually parses the chunked encoding protocol which I don't see any evidence of in Yada