babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
borkdude 2021-03-27T09:59:15.207100Z

@bozhidar So maybe it's best if @brdloush exposed his new op as both info and lookup? Are they drop-in replacements?

borkdude 2021-03-27T11:25:33.207600Z

Some improvements to babashka/process 0.0.2: Tokenization: https://github.com/babashka/process#tokenization Example: (sh "ls -la") Note: automatic parsing of arg strings :extra-env option: https://github.com/babashka/process#add-environment

bozhidar 2021-03-27T12:10:36.208100Z

The API is the same and I think it's fine to expose both as aliases. Eventually I'll rename cider-nrepl's op cider/info to it's clearer that it's not built-in, but I don't have any concrete roadmap for this. Not sure how many client have been updates to support lookup by now, as it's still pretty new.

borkdude 2021-03-27T12:25:09.208300Z

ok cool. copy that @brdloush? :)

coolj 2021-03-27T13:12:43.214700Z

@nha one quick way to get started with kubernetes is to wrap kubectl doing something like

(require '[clojure.java.shell :refer [sh]])
(-> (sh "kubectl" "get" "pod" "--all-namespaces" "-o" "json")
    :out
    (json/parse-string true)
    :items
    )

2021-03-28T07:37:44.228300Z

Thanks everyone, interesting feedback and pointers here πŸ˜„

borkdude 2021-03-27T13:40:24.215300Z

Made some updates to the bb task runner (WIP). Documentation updated: https://github.com/babashka/babashka/issues/756 Discuss: https://github.com/babashka/babashka/issues/757 Play around: #babashka-circleci-builds (bb.edn branch binaries)

2021-03-27T15:46:24.215900Z

right, I know that’s an option, I was hoping to avoid shell wrapping but maybe that’s the easiest πŸ˜„

nate 2021-03-27T15:54:52.217600Z

Yup, I have a wrapper around kubectl that helps cut down the verbosity of it. Works very well.

nate 2021-03-27T15:55:46.219200Z

I've also wanted to generate k8s yaml via bb code, but that hasn't materialized yet.

2021-03-27T16:19:08.219400Z

right, there is verbosity but also potential state that’s in there too right? Like, login/which cluster is the default at the moment etc.

2021-03-27T16:22:34.219600Z

Better than plain bash for sure though I am considering bb + bash vs going with the java client

Tomas Brejla 2021-03-27T17:19:52.219800Z

@borkdude copy @pez I have some issue with calva not showing the docs on code completion. At some point, I managed to see the completion options in that way, that both the argument list and documentation reside in their own popup window (first screenshot). But now I'm always getting just a single-window code completion popup, where the parameters are included in that single window. (second screenshot)

Tomas Brejla 2021-03-27T17:21:11.220400Z

And I just don't see why the code completion is now getting rendered in that single-window form instead of two-window form. Any hint appreciated πŸ™‚

Tomas Brejla 2021-03-27T17:23:02.220600Z

aaaaah, I am soooo stupid πŸ˜„. All I had to do was to CLICK that area with params πŸ˜„

pez 2021-03-27T17:24:18.220800Z

Is that a babashka repl?

Tomas Brejla 2021-03-27T17:31:02.221Z

yes

Tomas Brejla 2021-03-27T17:41:18.221200Z

aaah, the shortcut to switch between the single-window and multi-window code completion is ctrl+space. Now I understand how it happened that I accidently switched between the two modes πŸ™‚

Tomas Brejla 2021-03-27T18:08:11.221400Z

After a few fixes, It's starting to behave as I'd like. https://www.youtube.com/watch?v=BxR5oE9pKAI I'll do some more testing in the evening and hopefully file a PR.

coolj 2021-03-27T18:13:55.221700Z

There is https://github.com/nubank/k8s-api but it has some deps that are not part of babashka so you would need to create a babashka pod for it or just use a full clojure repl. It's also possible to use curl to interact with the api. btw, you can use kubectl to switch contexts in your script. Lots of choice here. But l agree with nate that bb with kubectl is surprisingly usable so it may be all you'll need for quick scripts.

1πŸ‘
pez 2021-03-27T18:17:22.222400Z

So beautiful. You are a hero!

borkdude 2021-03-27T18:30:02.222600Z

awesome :)

borkdude 2021-03-27T20:41:28.223900Z

I was able to port antq's Makefile to bb.edn's new task runner: https://github.com/borkdude/antq/blob/bb.edn/bb.edn https://github.com/borkdude/antq/blob/bb.edn/Makefile

1πŸ’―1πŸ‘1πŸ‘Œ