Terapkan ke Runtime Kontainer Tanpa Server
Jalankan model di Cloud Run atau App Runner.
Terapkan ke Runtime Kontainer Tanpa Server adalah pelajaran MLOps Academy gratis di CoddyKit. Ini adalah pelajaran 2 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar MLOps Academy, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus MLOps Academy mencakup 4 pelajaran total.
Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.
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.0Listen 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 1Watch 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. 🎉
Pertanyaan yang Sering Diajukan
Apakah pelajaran “Terapkan ke Runtime Kontainer Tanpa Server” gratis?
Ya — teks lengkap “Terapkan ke Runtime Kontainer Tanpa Server” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus MLOps Academy, upgrade ke CoddyKit PRO. Kursus MLOps Academy mencakup 4 pelajaran total.
Apa yang akan aku pelajari di “Terapkan ke Runtime Kontainer Tanpa Server”?
Jalankan model di Cloud Run atau App Runner. Kamu berlatih MLOps Academy dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.
Apakah aku perlu pengalaman untuk memulai MLOps Academy?
Tidak diperlukan pengalaman sebelumnya. MLOps Academy di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 2 dari 4.
Berapa lama pelajaran “Terapkan ke Runtime Kontainer Tanpa Server” memakan waktu?
Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.
Bisakah aku menulis dan menjalankan kode dalam pelajaran MLOps Academy ini?
Ya. Setiap pelajaran MLOps Academy menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.
Semua pelajaran dalam kursus ini
- Kirim Image ke Registry
- Terapkan ke Runtime Kontainer Tanpa Server
- Konfigurasikan Penskalaan Otomatis dan Konkurensi
- Kelola Rahasia dan Konfigurasi di Cloud