Better HN
topnewbestaskshowjobs
Log inSign up

Fizzadar

1,319 karma · joined Jan 11, 2012 (14y ago) · 402 submissions

Infrastructure & DevOps @ Beeper.

Blog: pointlessramblings.com Email: nick@<username>.com

Submissions

comment 1y ago · link · parent

It’s bullshit like this that makes me realise how lucky we are in countries that have public health care. Sure it has problems but private systems seem to have zero advantage for the average person. Pay more for less effectiveness AND a bunch of people get nothing.

comment 1y ago · link · parent

Oh that’s neat (TIL), am also working on a HS that also does this [1].

Not only does it feel like the most correct (I don’t think there is a perfect) behaviour for the user but also makes implementation much simpler. Synapse has a LOT of ordering foo and magic in the code I still don’t fully understand and I’ve gone fairly deep into synapse at times for work.

[1] https://github.com/Beeper/babbleserv

comment 2y ago · link · parent

VM was a game changer for us, 7x reduction in memory and 3x CPU, plus the scaling flexibility.

comment 2y ago · link · parent

Weird one: a ring doorbell. Started going off randomly between 3-5 in the morning, stuck on until unplugged. Replaced with an analog one, don’t miss it at all.

comment 2y ago · link · parent

Yes. The square mile has been a financial centre since the 16th century (possibly earlier): https://en.m.wikipedia.org/wiki/City_of_London

comment 2y ago · link · parent

I’ve yet to switch to Cursor as my main editor (Sublime still wins on performance by miles, plus no distracting tab anything), but I do hop in when stamping out boilerplate and repetitive code for which it is great, but it’s only a minor performance bump.

I have also used cursor to write Kubernetes client code with great success because the API space is so large it doesn’t fit into my head that well (not often writing such code these days) so that has been incredibly helpful.

So it’s not revolutionising my workflow but certainly a useful tool in some situations.

comment 2y ago · link · parent

We used to use this but prom is too memory heavy, ended up switching to mostly-compatible VictoriaMetrics[0] and reduced memory by a factor 7. In fact by every measurable metric VM outperforms prom/thanos (in our setup).

[0] https://victoriametrics.com/

comment 2y ago · link · parent

> “Pointlessramblings.com”? What a fitting name for a blog no one's reading – just like your stargazer count suggests. The only thing "pointless" here is trying to find any relevance in your GitHub contributions while those lonely stars gather dust.

Amazing, properly savage; I love this.

comment 2y ago · link · parent

Twice! First through who’s hiring fresh out of university in 2013 and more recently via a submission (Kanmail).

comment 2y ago · link · parent

pyinfra supports executing on the local machine (@local connector: https://docs.pyinfra.com/en/2.x/connectors/local.html). If you store the operation files on the machine that’s basically an agent when executed just without a periodic check for other changes. Adding a mode to do that in a loop would be pretty trivial..

comment 2y ago · link · parent

Definitely possible! Not familiar with the ansible Python API so partially guessing but the pyinfra op could yield a callback function that then calls ansible at execution time.

Alternatively you could just yield ansible cli and execute from the local machine using the @local connector.

comment 2y ago · link · parent

Yes! https://docs.pyinfra.com/en/next/performance.html

comment 2y ago · link · parent

Not rude at all :) When I first started (not sure if this is still the case?) Ansible would push Python code to the target machine and execute there, meaning it wasn’t actually agentless. I always thought of pyinfra as copying what a human would do if configuring a server by hand over SSH, so new modules that use only shell commands were needed.

comment 2y ago · link · parent

Heh yeah this is very true, I updated the perf test repo earlier this year to confirm https://docs.pyinfra.com/en/next/performance.html

comment 2y ago · link · parent

I would love to see any macOS facts/operation code if you can/would be willing to share! We also managed a bunch of macs using pyinfra but mostly stuck to shell commands.

comment 2y ago · link · parent

Extremely aware of this (see pyinstaller attempt): https://github.com/pyinfra-dev/pyinfra/pull/768)

I chose Python because it’s what I was writing all day back in 2015. Which makes me realise pyinfra is almost 10!

Edit: I mostly write Go or YAML (k8s) these days but Python still makes an appearance from time to time (outside of pyinfra dev).

comment 2y ago · link · parent

Conceptually I think it’s much nicer to define the state of the system rather than the steps to get there, and tool of choice figures it out.

But there’s always edge cases and situations that doesn’t work which is why pyinfra supports both and they can combine any way you like.

comment 2y ago · link · parent

Interesting, not heard of CDK before! Kind of similar? As long as the language is Python I suppose! Would be possible to integrate with other languages too I guess, not something I’ve ever looked into though.

Totally agree on templating which is why inventories have always been python code just as operations, giving maximum flexibility (with some complexity/type confusion drawbacks).

comment 2y ago · link · parent

Yes... and no. It depends on the operation (the docs explicitly state if an operation is _not_ idempotent "stateless operation"). Operations are either:

- state definitions, "ensure this apt package is installed" (apt.packages: https://docs.pyinfra.com/en/next/operations/apt.html#operati...) - stateless, "run these shell commands" (server.shell: https://docs.pyinfra.com/en/next/operations/server.html#oper...)

Most operations are state definitions and much preferred, the stateless ones exist to satisfy edge cases where either the state-ful version isn't implemented or simply isn't possible.

comment 2y ago · link · parent

I think I tried to shy away from specifically being "Ansible does this bad so pyinfra does this" and instead focus on the features that differentiate like "Instant debugging with realtime stdin/stdout/stderr output (-vvv).". But it seems like that isn't enough and the landing page needs to be more explicit in comparison. Ty for the feedback!

comment 2y ago · link · parent

> Agree with those saying the landing page needs work.

Any & all feedback much appreciated! It's basically just a very rough copy of the README at the moment.

comment 2y ago · link · parent

This alone is the entire reason I started working on pyinfra, loops in YAML is just evil.

comment 2y ago · link · parent

You'd need to create the EC2 instance outside of pyinfra (ie in Terraform). This could be done as part of the inventory itself, but wouldn't self-delete afterwards. If using Terraform there's a connector that allows you to plug Terraform output as a pyinfra inventory: https://docs.pyinfra.com/en/2.x/connectors/terraform.html

comment 2y ago · link · parent

> It is a configuration management tool, like Ansible?

Yes

> Is it meant for running one-off commands across the infrastructure, like Salt?

Also yes.

> It says it integrates with Terraform, so it's not a provisioning tool...

The TF integration is specifically to use TF as an inventory source - ie TF to create resources and pyinfra to then configure them.

> What does it do different (and presumably better) than other tools?

The homepage covers the highlights, I originally created pyinfra because debugging Ansible was complicated (no plain stderr as not "just" commands on the remote side) and slow, but things have evolved significantly since then.

> The Getting Started guide doesn't cover this. The FAQ doesn't cover this, and the Docs doesn't have an Introductory section to cover this.

Hugely appreciate this feedback, this is super helpful and something I will attempt to make clearer.

---

Quick attempt at a better explanation: You write Python code that defines operations (either state "this apt package should be installed" or stateless "run this command"), provide an inventory of targets (SSH, local machine) and pyinfra executes it.

Roughly sits where Ansible does for configuring servers, but also solves the case of "how do I run this command across my server fleet" (which I believe Ansible can also do).

comment 2y ago · link · parent

Hey all, I'm the creator/primary maintainer of pyinfra! Super excited (a little terrified) to see this on the frontpage, happy to answer any questions :)

I also hang out on the Matrix room: https://matrix.to/#/#pyinfra:matrix.org

Another thing: the GH repo points at currently in beta v3 and the docs for this are here: https://docs.pyinfra.com/en/next (highly recommend starting with v3, I just haven't had any time recently to wrap up the release, but it's stable).

comment 2y ago · link · parent

Heh, saw the UK in the headline and expected another leap towards our 1984 inspired future. Nice to see a change that actually benefits us that live here! Small step in the right direction.

117.

Ceph SQLite VFS(docs.ceph.com ↗)

16 points · by Fizzadar · 2y ago · 2 comments

118.

AT&T confirms data breach and resets customer passcodes(theverge.com ↗)

60 points · by Fizzadar · 2y ago · 21 comments

comment 2y ago · link · parent

Both Terraform and Pulumi differ slightly I think provisioning cloud resources - pyinfra can be used alongside to setup instances/etc, I’ve used the pyinfra/Terraform combo with great success.

For ansible/chef, etc the main reasons/benefits boil down to:

- instant feedback esp on errors, get the stdout/stderr of whatever command pyinfra was executing, there’s no agent or abstraction to hide it

- configure in python rather than yaml+jinja2 mess

- integrate with the whole python package ecosystem

- speed and small overhead as inventories scale

comment 2y ago · link · parent

Missed this comment apologies!

- ops are (mostly) declarative, but some (server.shell) will always execute the command given

- inventory is just that, basically a list of hosts to target plus associated data, docs page: https://docs.pyinfra.com/en/2.x/inventory-data.html

- absolutely for syncing files, check out the files.put and files.template operations (and the files ops in general): https://docs.pyinfra.com/en/2.x/operations/files.html

12345
14