Writing Rust-style Python

This post by @kobzol highlights some good methodologies for writing Python in a more defensive manner. I learned that typing.assert_never allows one to inform their IDE/type checker about code which should be unreachable. Similarly, simpler Union typing and the existence of the pyserde package make for more powerful access to data - but I’ll have to test serde against the venerable pydantic which has been my go-to for the longest time. [Read More]

Structures Are Not Supported for XSD `simpleType`s

I was trying to parse some XML (well, Atom, but you get it)… and started getting this while using the rust quick-xml crate.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Unsupported("structures are not supported for XSD `simpleType`s")', examples/test_quickxml2.rs:79:42
[Read More]

Convincing Kubernetes to Trust a Backend

I run Kubernetes at home. Yeah, I’ve said it. It’s out there now.

Now we’re past that, here’s how to convince traefik to talk nicely to a HTTPS backend server, in this case a test instance of GoatNS. I use Terraform for my configuration management, k3s to build/control the platform, with its built-in traefik for routing traffic.

[Read More]

Docker, rust, cargo and 137 Errors

I kept getting OOMKilled when trying to build Rust apps in Docker containers on GitHub Actions (and also locally, using buildx). The return code of any cargo command that touched the list of crates would end up with the command killed after 30-90 seconds.

I found two solutions:

[Read More]