Setting Up Your MLOps Toolchain and Workflow
Set up a reproducible local MLOps development environment by installing and configuring Git, Python with virtual environments, Docker, and supporting tools, then wire them together into a coherent day-to-day workflow.
Loading video…
What you'll be able to do
- Install and verify Git, Python, and Docker on a local workstation
- Create isolated, reproducible Python environments using venv and pip/requirements files
- Configure Git with a sensible .gitignore and commit workflow for ML projects
- Build and run a minimal Docker container for an ML workload
- Describe how the core tools map to stages of the MLOps lifecycle and combine into a daily workflow
Why a Standard Toolchain Matters
MLOps lives at the intersection of data science, software engineering, and operations. Before you can train, version, deploy, or monitor models, you need a reliable, reproducible local environment. A consistent toolchain reduces the classic “it works on my machine” problem and gives every engineer the same baseline.
The four foundations we configure in this lesson are:
- Git — version control for code, configuration, and pipeline definitions.
- Python — the dominant language for ML, managed with isolated environments.
- Docker — containerization so workloads run identically anywhere.
- Supporting CLI tools — package managers, a code editor, and ML utilities.
Installing and Verifying the Core Tools
Start by confirming each tool is present and on a supported version. Run these in a terminal:
git --version # expect 2.30+
python3 --version # expect 3.10+
docker --version # expect 20.10+
docker run hello-world # confirms the Docker daemon works
If any command fails, install via your platform: apt/brew for Git and Python, and Docker Desktop (macOS/Windows) or Docker Engine (Linux). On Linux, add your user to the docker group so you don’t need sudo.
Configuring Git for ML Projects
Set your identity once, globally, then create a project-scoped .gitignore so you never commit large or secret artifacts:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
A good ML .gitignore excludes virtual environments, data, model binaries, and caches:
.venv/
__pycache__/
*.pyc
data/
models/
*.ckpt
.env
.ipynb_checkpoints/
Large datasets and model weights should not live in Git directly — use tools like DVC or object storage and track only pointers/metadata.
Isolated Python Environments
Never install project dependencies into the system Python. Create a per-project virtual environment so dependency versions are pinned and reproducible:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install --upgrade pip
pip install scikit-learn pandas
pip freeze > requirements.txt
Commit requirements.txt (or a lockfile from tools like pip-tools, Poetry, or uv) so teammates and CI install the exact same versions. Reproducibility is the central theme of MLOps.
A Minimal Dockerized ML Workload
Docker packages your code and its environment into an image that runs the same on a laptop, CI runner, or cluster. A simple Dockerfile for a Python ML app:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "train.py"]
Build and run it:
docker build -t my-ml-app:dev .
docker run --rm my-ml-app:dev
Key practices: copy requirements.txt before the rest of the code so Docker caches the dependency layer; use slim base images; and never bake secrets into the image (pass them at runtime with --env or mounted files).
How the Tools Fit the MLOps Lifecycle
| Stage | Primary tools |
|---|---|
| Develop / experiment | Python, venv, Git, editor (VS Code) |
| Version data & models | DVC, object storage |
| Package & ship | Docker |
| Automate | Git + CI/CD |
| Track experiments | MLflow / Weights & Biases |
Your daily loop becomes: branch in Git → develop in an activated venv → test → build a Docker image → push and let CI validate it. Mastering this local foundation makes every later MLOps concept — pipelines, registries, deployment — far easier.
Recap
You now have a verified, reproducible workstation: Git for versioning, a virtual environment for isolated dependencies, and Docker for portable execution. These are the non-negotiable foundations for everything that follows in the course.
Check your understanding
6 questions — answer to see instant feedback.
All three tools exist to make environments and runs reproducible across machines and team members, which is the core goal of MLOps foundations.
MLflow (or Weights & Biases) is commonly used to track experiment parameters, metrics, and artifacts across runs.
Ask the AI tutor about this lessonStuck or curious? Ask a question and get a grounded answer.
The tutor answers from this lesson's material and can make mistakes — verify anything important.