Delivering packets since 2020
Comparing datetimes in Python
You always want to convert datetime objects to UTC before comparing them. Why is that, you ask? I am sure there are plenty of other reasons, but we recently discovered a serious footgun at work: Comparing “timezone-based” datetime objects fails during DST transition! I will explain this using the DST transition from CEST to CET in Germany (the is the transition on the last Sunday in October, from “Sommerzeit” to “Winterzeit”, where wall clocks are turned back one hour), so our timezone is "Europe/Berlin". ...
Error Budget
I recently got a paperback version of “The SRE Book” (because I already spend enough time in front of screens), and I re-read the section “Motivation for Error Budgets” in chapter 3. This is, in my opinion, one of the central elements of devops, because it fundamentally changes the way Dev and Ops view risk and aligns their incentives. How? The “classical” conflict of stability (Ops) vs change velocity (Dev) is solved by acknowledging that a 100% uptime is, in most cases, neither achievable nor desirable. ...
Running a Webservice, Part 3: Using Version Control
Intro Hi! This is part 3 of the mini series about running a webservice. We previously learned how to write a basic app in part 1, and how we can use Docker to containerize it in part 2. Today we will focus on something different: How to use Git to keep track of our project. Overview In any project (not only coding/programming!), there will at some point exist multiple versions of files. We all probably had a folder looking like this at some point in our lives: ...
Running a Webservice, Part 2: Containerizing the App
Intro Welcome to part 2 of the mini series about running a webservice. In part 1, we learned how to use the FastAPI framework to quickly and easily write an application to serve a HTTP REST API in python. In this article, we will learn how to create a Docker container for our app, which will make it much easier to deploy later on. Overview Docker, or container technology in general, allows us to bundle all required dependencies with our app. ...
Running a Webservice, Part 1: Creating the App
Intro This is a mini-series describing how to set up a simple webservice. I’ll try to cover as much as possible from the whole service lifecycle, from developing the app itself to actually running and maintaining it. This contains at least the following steps (not necessarily in that order): Develop the app Write tests Containerize the app Set up CI/CD Run the app This list will probably change as I make progress and shall be updated accordingly. ...