2023-09-11

Soliloquy

11/09/2023

I have recovered from the worst hangover ever. So here’s the update post the nonsense of Saturday.

I was completely wrong about the whole grafana thing. I even raised an issue on the faasd repo. The issue turned about to be that I was trying to make grafana persistent. But the instructions provided wasn’t. They we’re trying to provision the grafana instance which is a completely different thing, and something I completely missed (in my defence it’s not well documented). Provisioning is a set of files that grafana reads on boot to initialise itself with some files. In a way a kind of persistence provided you’re not adding any new configuration on the web app. What I needed was persistence of /var/lib/grafana which is where grafana stores all of it’s runtime files and folders. So that’s that. I wasted a full day on that. Didn’t even think for a second I got the wrong folder. I spend the whole time playing with folder permissions convinced it was that.

I about wrote the issue here

Once I set up grafana, Loki and promtail were fairly straight forward. Still had to play around with permissions, but I had a lot of practice doing that. Now I can do some pretty cool stuff with grafana and loki, reading SSH logs, getting log error rates. Next I’ll look into getting ctr metrics to get container usage, as arguably this will be the most important thing, especially once I get minio, redis, and postgres set up (or MySQL).

Today I’ve been looking back at my workerd progress from before and shit I wish I wrote stuff down back then. It has taken me hours this evening to get back up to speed with what I had from May, but I think I understand it enough. The steps I need to follow to implement my functions service are as follows:

  • get all repos to be added
    • where will this be stored?
  • Send to bob (the builder), and get zip file back with dist folder
  • Dynamically generate Workerd.Config message. which is appended onto the capnp file that starts with the import and the definition (needed for workerd.) with confiqurator
    • need to explore if workerd can use the bin format message somehow
      • UPDATE IT CAN! npx workerd serve bin --binary
    • Also note: this
    • This needs the router that
      • routes requests to the right place based on some mapping
        • Where will this be stored?
      • serves static assets
        • Where will these be stored?
        • Also need to work out how to parse these in the configurator step
      • rate limits
        • Globally? Optionally?
        • Uses durable objects
  • This file is then given to workerd to watch and serve.
    • How?

I’ll take a look into getting more of this done soon.

I spent today trying to make a macos Menu bar app that manages SSH tunnels for you, so I don’t have to have a load of empty terminal windows open to connect to the server. Maybe I just need some sort of internal reverse proxy. I wonder if I can do this in Caddy. Probably worth a look. But Swift is so far out of my comfort zone. I spent a long time trying to get chatgpt to do everything for me. The hard part finally became actually opening the tunnels, and I just didn’t know how to do it. I was trying to use a wrapper around swift-nio-ssh called citadel, but it wasn’t working and I think I’d need to know a hell of a lot more about swift before I work out how to use it. I think I’ll just use the terminal for now.

menubar app

I’m leaving this here as a reminder but I’ve always wanted to look at weather correlation with the stock market so if I find time I’m going to add that to the list.

I still haven’t painted yet but I’m going to go to the shop and get blue paint tomorrow. I had an idea for a painting I want to exist. It will be blue with flecks of white.

I feel there is a correlation between thinking less abstractly and not reading. I’ve dropped On The Road a little, and I feel I’ve been thinking less interesting stuff, so I need to get back on that.

All I really have thought about today other than work and my stuff is how our relationship with the time has changed. How we don’t need to pay as much attention to the time. Not that we don’t care but we aren’t guided by it. We have instant communication now, and we can do what we want pretty much whenever. Before, people must have had to arrange things in advance, live their lives by a clock. Now our schedules are more freeform, and we can work around things. This may have led to an isolation, caused by everyone’s schedules being out of sync.