Fork me on GitHub
#babashka
<
2020-12-08
>
cmdrdats09:12:35

Good morning - I'm trying to figure out how to use https://github.com/AdGoji/aws-api with babashka, but I'm afraid I can't figure out how to actually reference the code? Do I need to checkout the project and provide a classpath a la -cp somehow?

jeroenvandijk10:12:32

@U050CLJ53 I’ve only tested it with leiningen . No with babashka

jeroenvandijk10:12:49

I’m doing some quick tests now with babashka but I see it goes wrong with loading the dependencies

cmdrdats10:12:35

ah, ok - for interest sake, how does one load dependencies in babashka?

cmdrdats10:12:07

thanks for testing this for me 🙂

jeroenvandijk10:12:15

Ah wait, I forgot an important detail.. You need the jvm to generate the requests maps. Once you have that you can probably call it from babashka (never tested that). So not ideal

jeroenvandijk10:12:40

So it uses the com.cognitect.aws library (currently only works on jvm) to generate the template request maps and with those templates you can call it in a GraalVM project and maybe babashka

cmdrdats10:12:53

ah, ye - not ideal :rolling_on_the_floor_laughing: I'll just handle it in plain old clj for now then - would have liked to run this in babashka, but no trainsmash

jeroenvandijk10:12:05

I understand 🙂

jeroenvandijk10:12:16

sorry for the disappointment

cmdrdats10:12:34

not at all! thanks for the effort, I appreciate it

borkdude10:12:51

@U050CLJ53 Many people just shell out to the aws CLI from babashka. Also there is an AWS pod: https://github.com/tzzh/pod-tzzh-aws

cmdrdats10:12:02

@U04V15CAJ ah, I see - makes sense - thank you 🙂

borkdude10:12:15

That aws pod is Go code generated from a specification (I believe) using Clojure (babashka itself). Pretty nifty :)

borkdude10:12:11

@UJADF897F can maybe tell you more about it if you're interested. Right now you can't send blobs to s3 with it, this needs some special attention.

borkdude11:12:49

A WIP under consideration thing:

(require '[babashka.deps :as deps])

(deps/add-deps '{medley/medley {:mvn/version "1.3.0"}})
;; or should we support passing in `{:deps ...}` so we can also have :paths ["src" "test"]?
;; and what about aliases?

(require '[medley.core :as m])

(m/index-by :id [{:id 1} {:id 2}]) ;; works
This now works in the branch babashka-deps (see #babashka_circleci_builds). It shells out to java for resolving deps but just like clojure it is fast once the classpath is cached.

👍 1
🎉 1
borkdude21:12:19

Awesome, the babashka repo now has a place for discussions, Q/A, etc. https://github.com/borkdude/babashka/discussions

borkdude21:12:51

I assume it's possible to open a new topic there for others than me?

lukasz21:12:07

Yep, I can see a big green "New discussion" button