Python, Bash and Go in MLOps
An MLOps engineer on the churn project might write a feature function in the morning, fix a CI script before lunch, and read a Kubernetes error in the afternoon. Those three jobs lean on three different languages. You do not need to master all of them, but you need to know which one each job speaks.
The rule
Python builds the model, Bash glues the tools, Go runs the platform.
Python is where models live. Data loading (pandas), training (scikit-learn, PyTorch), tracking (MLflow) and pipelines (Airflow) all have Python APIs, so feature code, training scripts and small prediction services are written in it.
def skips_per_week(events, user_id):
skips = events[(events.user_id == user_id) & (events.action == "skip")]
return len(skips) / 4 # the table holds four weeks of eventsBash is the glue between command-line tools. CI steps, container entrypoints and "download, then test, then upload" chores are short shell scripts:
#!/usr/bin/env bash
set -euo pipefail # stop at the first failing command
dvc pull
pytest tests/
python train.pyset -euo pipefail is the habit to keep: without it, a failed dvc pull would be ignored and training would run on missing data.
Go is the language much of the platform underneath is written in: Kubernetes, Docker and Prometheus. Most MLOps engineers read Go more than they write it — when debugging a tool, writing a small Kubernetes operator, or building a fast network service.
The shortcut
Ask "Who is the audience of this code?"
- A model or data frame → Python.
- Other command-line tools → Bash.
- The infrastructure itself, where speed and a single binary matter → Go.
Add a feature
Counting playlist creations per user works on a data frame, so it is Python next to the training code.
The common mistake is writing a 300-line Bash script full of data logic. Once a script needs loops over records or real error handling, move it to Python.
Drills
Answer fast — trust the rule.
Where should the code that computes days_since_last_login live?
What does set -euo pipefail at the top of a Bash CI script do?
Why do many MLOps engineers read some Go?
A Bash script has grown to parse CSV rows and compute averages per user. What is the best move?
Remember
- Python builds the model, Bash glues the tools, Go runs the platform.
- Pick the language by the code's audience: data, tools or infrastructure.
- Trap: data logic in long Bash scripts; move it to Python early.
