تنسيق إعادة التدريب باستخدام Airflow
أنشئ DAG يعيد تدريب النموذج ويتحقق منه.
تنسيق إعادة التدريب باستخدام Airflow درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Why an Orchestrator
Retraining has many steps that must run in order and recover from failures. An orchestrator like Airflow runs them reliably so you do not babysit scripts.
Airflow in One Line
Apache Airflow schedules and runs workflows defined as code in Python. You describe what to do, and Airflow handles when and in what order.
The DAG
An Airflow workflow is a DAG, a directed acyclic graph of tasks. Acyclic means it never loops back, so the run always has a clear end.
Tasks Are the Nodes
Each step, like ingest, train, or validate, is a task in the DAG. Tasks are the units Airflow runs, retries, and tracks.
Define a DAG in Code
You declare a DAG and its schedule right in Python. Here the @dag decorator sets a daily retraining cadence.
from airflow.decorators import dag
@dag(schedule="@daily", catchup=False)
def retrain_pipeline():
...Wire Up Dependencies
The arrow operator sets order between tasks. This says ingest must finish before train, and train before validate.
ingest() >> train() >> validate()Operators Do the Work
An operator is a template for one kind of task, like running Python or a Bash command. PythonOperator runs your training function.
Retries Built In
Set retries on a task and Airflow re-runs it automatically if it fails. A flaky data fetch no longer breaks the whole pipeline.
train_task = PythonOperator(
task_id="train",
retries=3,
)Watch It in the UI
Airflow ships a web UI showing each run as a colored grid. Green means success, red means failure, so you spot a broken task instantly.
Schedule or Trigger
A DAG can run on its schedule or be kicked off on demand. That lets the same pipeline serve both cron and drift-triggered retraining.
Idempotent Tasks
Design each task to be safe to re-run, producing the same result. Idempotent tasks make retries and backfills painless.
Quick Check
What does the >> operator do between two Airflow tasks?
Recap
You met Airflow: workflows are DAGs of tasks wired with >>, given retries, and watched in the UI. It turns retraining scripts into a reliable pipeline. ✅
الأسئلة الشائعة
هل درس «تنسيق إعادة التدريب باستخدام Airflow» مجاني؟
نعم — نص درس «تنسيق إعادة التدريب باستخدام Airflow» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «تنسيق إعادة التدريب باستخدام Airflow»؟
أنشئ DAG يعيد تدريب النموذج ويتحقق منه. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «تنسيق إعادة التدريب باستخدام Airflow»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- إعادة التدريب وفق جدول أو وفق مشغّل
- تنسيق إعادة التدريب باستخدام Airflow
- الترقية التلقائية فقط عند التفوق على خط الأساس
- أبقِ الإنسان ضمن الحلقة