Fork me on GitHub

What do you nice folks usually use to store logs in JSON format? Nothing fancy, so I'm thinking of making my own timbre appender but I'm wondering if I've missed something even more straightforward? Context: Ops people in my team are forcing me to use a log collector that requires JSON logs. 😛


@pavlos There is this one: But it uses jsonista, so it doesn't work with bb, but you could maybe take it as inspiration


Thanks, I've actually used that in another Clojure project! Babashka offers a lot of stuff out of the box and JSON logs are more or less ubiquitous nowadays, at least in corporate software, so I thought I'd ask in case there was some kind of flag or something that could automatically configure timbre accordingly for me 😛 You've ruined my capability to put effort into making stuff work! Just kidding, I'm just very grateful for bb and all the work you've done for the community 😄

❤️ 1

i mean feel free to add a recipe to the bb wiki once you've made one 🙂

👍 1

i need to do the same for a file-watcher->run-kondo script that i wrote and then accidentally git reset --hard deleted


or publish a library for the appender and make a PR to :)


@U0509NKGK oops :) In this case, I usually just do undo in emacs


my emacs automatically reverts buffers 😖


i was doing a training session so i had done a lot of other shit and closed and reopened etc


but thankfully easy to redo, so i'll just redo it heh

❤️ 1

@U0509NKGK You could also make a script repo like this: And then anyone else can install your script with #babashka-bbin


E.g. your colleagues


But this is more for scripts that are not project specific

Dimitar Uzunov12:09:50

Hey folks, I was wondering if anyone uses babashka or nbb for provisioning servers and workstations; things like using yum or brew, dealing with systemd, templating config files. If so, what has been your experience? This is a rather commodity use I wonder how it compares to more commodity solutions like ansible.


@dimitar.ouzounoff #spire is intending to be this thing / cc @retrogradeorbit

metal 1
Dimitar Uzunov12:09:06

I don’t really need the SSH support, just a way to do idempotent scripts

Dimitar Uzunov12:09:06

more or less only yum or brew, dealing with systemd, templating config files


Maybe @U7ERLH6JX also has some ideas on this.


I actually had tried to do system provisioning with some babashka but honestly making it idempotent and specially with packages is quite verbose and messy. ended up resorting to ansible, made peace with YAML shit. at least the moving parts are written by smarter folks 😅

🆒 1

i could recommend using for this maybe? its simpler for local things and for packages etc


#spire should also work for local systems I think ... @retrogradeorbit


yep it should. was saying dad as its just about packages not much more 😄


but nix is also a popular option

Dimitar Uzunov13:09:26

kinda wishing there were simply libs for some common idempotent tasks like setting up systemd services and wrappers for various package managers; dad seems neat for its MacOS support


yeah i looked at all but managed to do mac and linux in ansible for brew dnf packages, npm etc etc in a few yaml lines. it just works

Dimitar Uzunov13:09:24

we’ve been using ansible for a few years and I’m facing some refactoring; I was just hoping to write some clojure for this task haha


can use bb to generate ansible yamls maybe 😛

Dimitar Uzunov13:09:51

I’ve thought about that! Not sure what the benefit is other than not writing yaml directly. For larger projects sure, but in this case I want to keep things small if possible

Dimitar Uzunov13:09:12

nix is very cool, but I am afraid of dragging other team members into it


my thoughts precisely. went down the killing yaml route with clj/edn only to realise the amount of work needed to be at par with off the shelf things


spire can run locally too


You use the local transport. Which is the default


also supports sudo which can be helpful


at the moment spire is one big uberproject. There's a lot of things wrapped up together. But it can do what you want. It's just become cumbersome to work on spire itself. I am in the process of decomplecting it into its parts. If you did use spire there should be a path forwards to use one of the parts when it is broken out.

👍 1

complementary nix meme

😆 3

sometimes you just have to get all messy...


ansible smeared all over your face


yeah you aint coded well until youve taken down prod due to an indentation error


My nix config: install ansible


Well now that's what I avoid YAML for ;)


Take a look in #clj-yaml for more hate

Dimitar Uzunov13:09:27

well it could be bash generating yaml


my yaml is one giant json string on a single line


you could make clojure the most popular language in the universe by just converting yaml to edn and having everyone write it in yaml


i would say no to that but not sure if it could be misunderstood


wait wait... hear me out... 😄 /s


We could change s-expressions to YAML too right?


exactly. The worse you make it, the more popular it will be

Dimitar Uzunov13:09:58

that is an Aprils fool joke right there - a Clojure written in yaml syntax


and give the new langauge an acronym for a name... YFC (yaml flavoured clojure)


Python is already kind of YAML to me

Dimitar Uzunov13:09:46

that is actually one of the bad parts of ansible - it is not supposed to be a programming language yet it sneaks some programmy things to lure you in. But you want to run roles in parallel? Tough luck unless you want to do include_role tricks


yep. python and jmespath escaped and templated into strings inside yaml inside of python. sweeeeeet.


Bring back XML


youre forgetting deploy to k8s

Dimitar Uzunov13:09:43

opened a epub file in Emacs and wow it is all xml, how cool is that


xml clojure?


every s-exp is a tag and and end tag


YAMLX - JSX-flavored YAML, aka XML! We can hype this first among the JS people because they like JSX which is close enough to XML


<println>How awesome is xmoljure!</println>


I'll take JSON any time of the day over YAML, but it's unfortunate that they still require comma's and have no comments


I have promised to myself no more YAML rants within the next week on my twitter


it reads like you've been in therapy @U04V15CAJ


there is a plan underway to break the idempotent scripts out of spire. You are not the only one who wants just the idempotent parts. It's not done yet, unfortunately.


I juuuust republished, built with my own hot-reloading (no Javascript) site maker, which is written in (fairly Clojurish) Bash, for <reasons> 🤓. At some point I'm going to write a clone in Babashka. The README describes goals dreams, design details etc. If anyone here is interested in pairing on it, hit me up!

🎉 3

Oooh, this looks like something I'm going to enjoy looking into. My own 💩e is a babashka cli: But it's really asking for a rewrite away from Makefile generation towards pure bb. Interested in pairing, but I'm cronically suffering from "very full calendar syndrome".


> My own e is a babashka cli: Thanks for sharing your project, @U3X7174KS! I skimmed the code and directory layout. I noticed some design choices that you've made that I considered too. Where to keep page metadata? Where to publish html content? Should each page be standalone (e.g. include <style>?)? etc. I went down a different path. > Interested in pairing, but I'm cronically suffering from "very full calendar syndrome". Haha, I've been suffering from "chronically sidetracked" syndrome. I was supposed to blog as I made the project, but then I got totally sucked into making the project and wrote zero posts 😆 So now, on my immediate agenda is to finish the blog post series on shite. I'll do the bb yak shave only after that (I hope after and not in-between 😆).

❤️ 1
🔥 1

> So now, on my immediate agenda is to finish the blog post series on shite. I'll do the bb yak shave only after that (I hope after and not in-between 😆). > I'm very much looking forward to reading those! 👌

🙌 1

Also exists, in case you need more references :)


Very aware, and very intent on stealing liberally :) Code size while maintaining feature parity is going to be one of my hard-line design constraints. Right now the entire "business logic" of my system weighs in at about 350 LoC of FP-style Bash measured crudely, including all the functionality named by these files:

grep -E -v "\s?\#|^$" ./ ./bin/{events,metadata,templating,utils,hotreload}.sh | wc -l

HTML template Heredocs are excluded because they're (mainly) "just data" ./bin/ Note: the full-rebuild performance is shite, but I care about interactive writing, which works acceptably well, so I'll fix the build speed maybe later.

🔥 1

@U3X7174KS the code doesn't really show it, so I updated the README with usage demo GIFs to show how it (frequently) works

❤️ 1

Nice! :star-struck:

gotta_go_fast 1