0Pricing
MLOps Academy · درس

بناء Bento وتحويله إلى حاوية

احزم الشيفرة والنموذج والاعتماديات في Bento قابل للنشر.

بناء Bento وتحويله إلى حاوية درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

What a Bento Is

A Bento is the deployable bundle BentoML builds. It packs your service code, the model, and the exact dependencies into one archive. 📦

The bentofile

You describe the build in a bentofile.yaml. It names the service entry point and lists what to include.

service: "service:svc"

Include Your Files

You tell BentoML which source files to bundle. The include key takes globs so only the code you need ships.

include:
  - "*.py"

Pin Python Packages

Dependencies live right in the bentofile. Under python you list packages so the build resolves them into the bundle.

python:
  packages:
    - scikit-learn

Build the Bento

One command assembles everything. bentoml build reads the bentofile and produces a versioned Bento in your store.

bentoml build

List Your Bentos

Built Bentos show up alongside your models. Run bentoml list to see each one with its name and version tag.

bentoml list

Why Containerize

A Bento still needs a runtime. Turning it into a Docker image makes it run identically on any machine or cloud. 🐳

One Command to an Image

BentoML writes the Dockerfile for you. bentoml containerize takes a Bento tag and builds a ready-to-run image.

bentoml containerize iris_classifier:latest

Run the Container

Now it is a normal image. You start it with docker run, mapping the port so requests reach the service inside.

docker run -p 3000:3000 iris_classifier:latest

Ship It Anywhere

That image is your deployable artifact. Push it to a registry and any cloud runtime or Kubernetes cluster can pull and serve it. 🚀

Set a Docker Base Image

You can control the runtime under your image. The docker section of the bentofile lets you pick a Python version or base.

docker:
  python_version: "3.11"

Quick Check

You ran bentoml build and got a Bento. What does bentoml containerize add on top of that?

Recap

You defined a bentofile, ran bentoml build to bundle code and deps, then containerized it into a Docker image ready to ship to any cloud. End to end! 🙌

الأسئلة الشائعة

هل درس «بناء Bento وتحويله إلى حاوية» مجاني؟

نعم — نص درس «بناء Bento وتحويله إلى حاوية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.

ماذا ستتعلم في «بناء Bento وتحويله إلى حاوية»؟

احزم الشيفرة والنموذج والاعتماديات في Bento قابل للنشر. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟

لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «بناء Bento وتحويله إلى حاوية»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟

نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. حفظ نموذج في Bento Store
  2. تحديد خدمة وواجهة برمجة التطبيقات الخاصة بها
  3. تمكين المعالجة الدفعية التكيفية
  4. بناء Bento وتحويله إلى حاوية
← العودة إلى MLOps Academy