babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
robert-stuttaford 2020-09-22T05:40:22.001500Z

@borkdude is there a special trick to make #!/usr/bin/env bb style scripts run within emacs? on a project where a .git/hooks/pre-commit uses bb but it doesn't work when used from magit

env: bb: No such file or directory
edit: found https://github.com/purcell/exec-path-from-shell

2020-09-22T06:39:18.006300Z

fwiw, if you start your emacs from a terminal and things work it may mean that env var settings for certain dot files could use being elsewhere. i have this issue from time to time when using different distributions of linux as the proper location can vary. for example, currently i place some things in ~/.profile, but depending on one's shell and other factors, it may be better to put such settings in other files. if you're using macos there may be a relatively common answer to this issue (though if you've decided to use a shell other than the default possibly it may differ).

borkdude 2020-09-22T07:33:42.006900Z

@robert-stuttaford yes, that's also in my init.el:

exec-path-from-shell ;; fix path in Emacs by reading from .zshenv
along with this:
(when (memq window-system '(mac ns))
  (setenv "SHELL" "/bin/zsh")
  (exec-path-from-shell-initialize)
  (exec-path-from-shell-copy-envs
   '("PATH")))

2020-09-22T10:28:28.007400Z

anyone used babashka for high level k8s configuration?

borkdude 2020-09-22T10:29:21.008100Z

@danieltanfh95 Does k8 use yaml? I do use it for CircleCI config generation. Not so familiar with k8s myself.

2020-09-22T10:29:29.008300Z

yeah it does

2020-09-22T10:30:34.010200Z

there’s a bunch of repeated stuff that i’m wondering if it’s worth to semi automate it away with a configuration-for-configuration kinda setup

borkdude 2020-09-22T10:31:49.010500Z

I forgot for which project I'm doing this.. argh

2020-09-22T10:36:52.011300Z

i’ll take a look when i get home

2020-09-22T10:36:54.011500Z

thanks!

2020-09-22T13:34:18.012300Z

Are people already using Babashka to write linux services?

2020-09-22T13:34:26.012400Z

I’m considering porting aws-codedeploy-agent to Babashka https://github.com/aws/aws-codedeploy-agent/blob/master/init.d/codedeploy-agent

borkdude 2020-09-22T13:55:10.012700Z

Is there anything bb can't do that's needed for this?

2020-09-22T14:31:14.012900Z

Don't think so. Just wondering, might be quicker to see an example in case there are pitfalls

borkdude 2020-09-22T14:45:42.013100Z

I'll make a release at the end of the week that includes httpkit client and server (the server is marked experimental, until I'm convinced this is a good choice :))

borkdude 2020-09-22T15:24:54.013400Z

The next babashka will include httpkit client and server and many improvements! Pre-release binaries: - macOS https://11871-201467090-gh.circle-artifacts.com/0/release/babashka-0.2.1-SNAPSHOT-macos-amd64.zip - linux https://11869-201467090-gh.circle-artifacts.com/0/release/babashka-0.2.1-SNAPSHOT-linux-amd64.zip - Windows https://ci.appveyor.com/api/buildjobs/5a76yn0fnh78nrgp/artifacts/babashka-0.2.1-SNAPSHOT-windows-amd64.zip Consider testing! Official release will follow within a few days.

dharrigan 2020-09-22T15:26:27.013600Z

Looking forward to testing that out.

tzzh 2020-09-22T15:47:11.017200Z

Hey I have hacked a super basic pod to interact with dynamodb using the go aws sdk https://github.com/tzzh/pod-tzzh-aws, I have only added a few dynamodb functions for now but it should be really easy to add other dynamodb functions (and AWS components). I don’t write go very often so the code might not be great at the moment but if I end up using it a lot I’ll try and make it better so it can be useful for other people as well

❤️ 1
🎉 1
borkdude 2020-09-22T15:48:15.018100Z

Awesome. This is exactly how I envisioned something around AWS (either go, python or clj graal-native)

nate 2020-09-22T15:48:50.018700Z

this looks like a great start

tzzh 2020-09-22T15:49:18.019200Z

yeah you mentioned it ~10 days ago then I was on holidays for a week but that’s the first thing I did on my day back 😂

borkdude 2020-09-22T15:54:26.020100Z

added it here: https://github.com/borkdude/babashka/blob/master/doc/libraries.md#pods

👍 1
borkdude 2020-09-22T15:58:15.021300Z

one small note: maybe call pod.dynamodb pod.tzzh.dynamodb, to avoid potential clashes (although it would be unlikely, this is what I've done in most pods)

tzzh 2020-09-22T15:59:16.021700Z

ah yes good point :thumbsup:

2020-09-22T21:48:39.021800Z

Makes sense. I don't think they are needed for this particular case if that's what you mean, I'm guessing babashka.curl is enough for this one