Definiowanie potoku za pomocą etapów DVC
Połącz kroki w dvc.yaml wraz z zależnościami
Definiowanie potoku za pomocą etapów DVC to bezpłatna lekcja MLOps Academy na CoddyKit. To lekcja 2 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MLOps Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
Meet dvc.yaml
DVC describes your whole pipeline in one file called dvc.yaml. It lists each stage, the command it runs, and what it depends on. 📄
Add a Stage with dvc stage add
You rarely hand-write the file. The dvc stage add command builds a stage entry for you from flags you pass on the command line.
dvc stage add -n prep \
-d data/raw.parquet -o data/prepared \
python prep.pyThe -d Flag Means Dependency
The -d flag declares a dependency: a file or script the stage reads. DVC watches these to know when the stage needs to re-run.
The -o Flag Means Output
The -o flag declares an output the stage produces. DVC tracks these files so later stages can depend on them in turn.
Wiring Stages Together
You connect stages by making one stage's output the next stage's dependency. That shared file is the link that forms the pipeline graph.
What a Stage Looks Like in YAML
Each stage in dvc.yaml has a cmd plus its deps and outs. This is the readable record of how your model was built.
stages:
prep:
cmd: python prep.py
deps:
- data/raw.parquet
outs:
- data/preparedRun the Pipeline with dvc repro
The dvc repro command executes the pipeline in dependency order, running each stage only if its inputs changed.
dvc reproDVC Builds the DAG for You
From the deps and outs, DVC infers the full DAG automatically. You never specify run order by hand; the graph decides it.
Visualize It with dvc dag
Run dvc dag to print the pipeline as a graph in your terminal. It is a quick way to confirm stages are wired the way you expect.
dvc dagdvc.lock Records What Ran
After a run, DVC writes dvc.lock with the exact hashes of every input and output. Commit it so teammates reproduce the same result.
The Pipeline Lives in Git
dvc.yaml and dvc.lock are plain text, so they live in Git alongside your code. Your whole pipeline becomes versioned and reviewable.
Quick Check
Test your grasp of DVC stage flags.
Recap: Pipelines in dvc.yaml
You wired stages with deps and outs in dvc.yaml, then ran the graph with dvc repro. DVC tracks order and results for you. 🔗
Często zadawane pytania
Czy lekcja „Definiowanie potoku za pomocą etapów DVC” jest bezpłatna?
Tak — pełny tekst „Definiowanie potoku za pomocą etapów DVC” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MLOps Academy, przejdź na CoddyKit PRO. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Definiowanie potoku za pomocą etapów DVC”?
Połącz kroki w dvc.yaml wraz z zależnościami Ćwiczysz MLOps Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć MLOps Academy?
Nie wymagamy żadnego doświadczenia. MLOps Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 2 z 4.
Ile czasu zajmuje lekcja „Definiowanie potoku za pomocą etapów DVC”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji MLOps Academy?
Tak. Każda lekcja MLOps Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Etapy: Ingest, Prep, Train, Eval
- Definiowanie potoku za pomocą etapów DVC
- Buforowanie i pomijanie niezmienionych kroków
- Parametryzowanie uruchomień za pomocą params.yaml