0Pricing
MLOps Academy · บทเรียน

ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์

รันโมเดลบน Cloud Run หรือ App Runner

ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์ เป็นบทเรียน MLOps Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน MLOps Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Skip the Servers

A serverless container runtime runs your image without you managing any VMs. You hand over a container, and the platform handles the rest. ☁️

Two Popular Choices

Google offers Cloud Run and AWS offers App Runner. Both pull your image from a registry and expose it behind a managed HTTPS URL.

Deploy from an Image

You point the runtime at your pushed image and it creates a service. With Cloud Run, one deploy command turns an image into a live URL.

gcloud run deploy model-api --image registry.example.com/team/model-api:1.0.0

Listen on the Right Port

The platform sends traffic to a port it chooses, exposed as the PORT environment variable. Your app must bind to that value, not a hardcoded one.

uvicorn main:app --host 0.0.0.0 --port ${PORT}

Bind to All Interfaces

Inside a container, bind the server to 0.0.0.0, not 127.0.0.1. Otherwise the platform cannot route outside traffic into your process.

Stateless Containers Only

Instances start and stop at any time, so anything saved to local disk can vanish. Keep the service stateless and store data externally.

You Pay for What You Serve

Serverless billing is usually per request and per active second. When no one calls your model, idle time can cost almost nothing. 💸

Mind the Cold Start

If an idle service scaled to zero, the next request waits for a container to boot. That delay is a cold start, common with big model files.

Keep a Warm Instance

To dodge cold starts, set a minimum instances floor. The platform keeps that many containers warm and ready to answer instantly.

gcloud run deploy model-api --min-instances 1

Watch the Live Logs

The runtime streams your container output to its logs console. Tail them right after a deploy to confirm the model loaded cleanly.

From Image to Live URL

That is the whole loop: push an image, run one deploy, and the platform returns a public URL serving your model over HTTPS.

Quick Check

Let us check why your first request can feel slow.

Recap

You deployed an image to a serverless runtime, bound to PORT on 0.0.0.0, stayed stateless, and tamed cold starts. Your model is live. 🎉

คำถามที่พบบ่อย

บทเรียน “ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส MLOps Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์”

รันโมเดลบน Cloud Run หรือ App Runner คุณปฏิบัติ MLOps Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน MLOps Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน MLOps Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน MLOps Academy นี้ได้ไหม

ได้ บทเรียน MLOps Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ส่งอิมเมจไปยังรีจิสทรี
  2. ติดตั้งบนรันไทม์คอนเทนเนอร์แบบไร้เซิร์ฟเวอร์
  3. กำหนดการปรับขนาดอัตโนมัติและการทำงานพร้อมกัน
  4. จัดการข้อมูลลับและการตั้งค่าบนคลาวด์
← กลับไปที่ MLOps Academy