Talk

Writing Beautiful, Simple, and Safe Operations Scripts with Python

Friday, May 24

12:35 - 13:05
RoomPizza
LanguageEnglish
Audience levelIntermediate
Elevator pitch

Every software project is only as good as it’s weakest piece of code. Often that happens to be a crucial yet unreadable CI bash script, that is impossible to maintain. In this talk we’ll show how to write beautiful, safe and sane Bash-Python hybrid scripts to supercharge your operations scripts!

Abstract

Every software project is only as good as it’s weakest piece of code. In many projects, the core codebase is often developed with high standards, utilizing powerful tooling like linters, formatters and testing frameworks. On the other hand, utility scripts, used for simple, yet crucial, operations like building docker images, deploying the code or running some maintenance tasks, often fall short of the same standards. These scripts, typically written in Bash, are often very flaky and challenging to debug – especially when running on remote CI machines. Python comes with the great (yet relatively low level) “subprocess” module, which provides an API for executing Bash commands via Python and interacting with the shell. In this talk, we’ll show how a small utility library, which wraps the subprocess module and exposes an even simpler and more robust API, can be used to write beautiful, safe and sane Bash-Python hybrid scripts. These scripts retain the raw power of Bash commands, and at the same time leverage the best of the Python ecosystem. The result is a much more flexible and reliable solution for project operations.

TagsLinux, Tooling, Unix, DevOps
Participant

Yossi Rozantsev

Hey, my name is Yossi and I’m from Iceland!

I’ve been using Python for almost 10 years now, building everything from small personal utility tools to huge mass distributed projects. Right now I’m leading the backend development at Smitten, where we are building the most fun dating app in the world!

I am passionate about developer experience, and love to implement and discover better, more efficient ways to be a developer and solve problems. I always try to simplify workflows for me and my team so that we can focus on algorithms and business logic, and not on stuff that can be automated/abstraced.

In my free time I like to go hiking, drink overpriced beer and argue on just about anything.