This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-27
Channels
- # announcements (1)
- # aws (8)
- # babashka (77)
- # babashka-sci-dev (8)
- # beginners (29)
- # biff (2)
- # calva (13)
- # cljs-dev (1)
- # clojure (42)
- # clojure-europe (205)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (9)
- # data-science (7)
- # datalevin (19)
- # datomic (3)
- # emacs (7)
- # fulcro (15)
- # gratitude (8)
- # lsp (52)
- # meander (3)
- # membrane (92)
- # off-topic (12)
- # re-frame (16)
- # reagent (4)
- # reitit (15)
- # releases (1)
- # sci (30)
- # shadow-cljs (34)
- # tools-deps (5)
- # xtdb (17)
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: https://github.com/viesti/timbre-json-appender/blob/master/src/timbre_json_appender/core.clj 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 😄
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 https://babashka.org/toolbox/ :)
@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
its totally gone
@U0509NKGK You could also make a script repo like this: https://github.com/borkdude/tools And then anyone else can install your script with #babashka-bbin
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.
I don’t really need the SSH support, just a way to do idempotent scripts
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 https://book.babashka.org/#tasks 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 😅
i could recommend using https://github.com/liquidz/dad 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 😄
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 ™
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 😛
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
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
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.
yeah you aint coded well until youve taken down prod due to an indentation error
well it could be bash generating yaml
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
that is an Aprils fool joke right there - a Clojure written in yaml syntax
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.
youre forgetting deploy to k8s
opened a epub file in Emacs and wow it is all xml, how cool is that
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
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
https://twitter.com/search?q=from%3Aborkdude%20yaml&src=typed_query&f=live
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 https://www.evalapply.org/, built with my own hot-reloading (no Javascript) site maker, https://github.com/adityaathalye/shite 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!
Oooh, this looks like something I'm going to enjoy looking into. My own 💩e is a babashka cli: https://github.com/teodorlu/play.teod.eu/blob/master/play.clj 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 😆).
> 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! 👌
Also https://github.com/borkdude/quickblog 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?\#|^$" ./shite.sh ./bin/{events,metadata,templating,utils,hotreload}.sh | wc -l
358
HTML template Heredocs are excluded because they're (mainly) "just data" ./bin/templates.sh
.
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.@U3X7174KS the code doesn't really show it, so I updated the README with usage demo GIFs to show how it (frequently) works https://github.com/adityaathalye/shite#usage-demo