All Products
Search
Document Center

Container Service for Kubernetes:Konfigurasikan registri model MLflow

Last Updated:Jun 21, 2026

MLflow adalah platform open source untuk manajemen siklus hidup pembelajaran mesin yang melacak informasi pelatihan model serta mengelola dan men-deploy model pembelajaran mesin. Topik ini menjelaskan cara mengonfigurasi registri model MLflow untuk manajemen model.

Pengenalan registri model MLflow

Untuk informasi lebih lanjut tentang registri model MLflow, lihat MLflow Model Registry — MLflow documentation.

Prasyarat

  • Anda telah membuat kluster ACK Pro dengan versi Kubernetes 1.20 atau yang lebih baru. Untuk informasi selengkapnya, lihat Create an ACK Pro cluster.

  • Anda telah membuat instans RDS PostgreSQL. Untuk informasi selengkapnya, lihat Create an RDS PostgreSQL instance.

    Saat membuat instans RDS PostgreSQL, disarankan memilih VPC tempat kluster ACK Anda dideploy dan menambahkan Blok CIDR VPC tersebut ke daftar putih agar Anda dapat mengakses database menggunakan Titik akhir internal. Jika instans RDS dan kluster ACK berada di VPC yang berbeda, aktifkan akses jaringan publik untuk instans RDS dan tambahkan Blok CIDR VPC kluster ACK ke daftar putih. Untuk informasi selengkapnya, lihat Configure a whitelist.

  • Buat akun standar bernama mlflow di instans RDS PostgreSQL. Untuk informasi selengkapnya, lihat Create an account.

  • Buat database bernama mlflow_store di instans RDS PostgreSQL untuk menyimpan metadata model. Atur Authorized Account ke akun mlflow. Untuk informasi selengkapnya, lihat Create a database.

  • (Opsional) Buat database bernama mlflow_basic_auth di instans RDS PostgreSQL untuk menyimpan informasi otentikasi pengguna MLflow. Atur Authorized Account ke akun mlflow. Untuk informasi selengkapnya, lihat Create a database.

  • Konfigurasikan klien Arena untuk manajemen model. Versi Arena harus 0.9.14 atau yang lebih baru. Untuk informasi selengkapnya, lihat Configure the Arena client.

Langkah 1: Deploy MLflow di kluster ACK

  1. Masuk ke ACK console. Di panel navigasi kiri, klik Clusters.

  2. Di halaman Clusters, klik nama kluster Anda. Di panel navigasi kiri, klik Applications > Helm.

  3. Klik Deploy. Di halaman Deploy, atur Application Name menjadi mlflow dan Namespace menjadi kube-ai. Di bagian Chart, cari dan pilih mlflow. Klik Next. Di kotak dialog yang muncul, konfirmasi apakah akan menggunakan mlflow sebagai namespace default untuk Chart tersebut.

    • Untuk mengelola model menggunakan Konsol pengembangan AI Suite, deploy MLflow di namespace kube-ai dan pertahankan nama rilis sebagai nilai default mlflow.

    • Untuk mengelola model menggunakan Arena, Anda dapat mendeploy MLflow di namespace apa pun, tetapi pertahankan nama rilis sebagai nilai default mlflow.

  4. Di halaman Create, konfigurasikan parameter Chart.

    1. Konfigurasikan parameter defaultArtifactRoot dan backendStore. Contoh berikut menunjukkan konfigurasi sampel.

      trackingServer:
        # -- Specifies which mode mlflow tracking server run with, available options are `serve-artifacts`, `no-serve-artifacts` and `artifacts-only`
        mode: no-serve-artifacts
        # -- Specifies a default artifact location for logging, data will be logged to `mlflow-artifacts/:` if artifact serving is enabled, otherwise `./mlruns`
        defaultArtifactRoot: "./mlruns"
      # For more information about how to configure backend store, please visit https://mlflow.org/docs/latest/tracking/backend-stores.html
      backendStore:
        # -- Backend store uri e.g. `<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>`
        backendStoreUri: postgresql+psycopg2://mlflow:<password>@pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com/mlflow_store

      Ganti backendStore.backendStoreUri dengan titik akhir database mlflow_store yang telah Anda buat pada prasyarat. Misalnya, gunakan postgresql+psycopg2://mlflow:<password>@pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com/mlflow_store.

      Penting

      Jika instans RDS dan kluster ACK berada di VPC yang sama, gunakan Titik akhir internal instans RDS. Jika tidak, gunakan Titik akhir publik dan pastikan kluster ACK dapat mengaksesnya.

      Masuk ke RDS PostgreSQL console. Klik Instance ID > Database Connection > Internal/External Endpoint untuk mendapatkan titik akhir database, seperti pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com.

      Untuk informasi selengkapnya, lihat Connect to a database.

    2. (Opsional) Untuk mengaktifkan BasicAuth, konfigurasikan parameter berikut.

      trackingServer:
        # -- Specifies which mode mlflow tracking server run with, available options are `serve-artifacts`, `no-serve-artifacts` and `artifacts-only`
        mode: no-serve-artifacts
        # -- Specifies a default artifact location for logging, data will be logged to `mlflow-artifacts/:` if artifact serving is enabled, otherwise `./mlruns`
        defaultArtifactRoot: "./mlruns"
        # Basic authentication configuration,
        # for more information, please visit https://mlflow.org/docs/latest/auth/index.html#configuration
        basicAuth:
          # -- Specifies whether to enable basic authentication
          enabled: true
          # -- Default permission on all resources, available options are `READ`, `EDIT`, `MANAGE` and `NO_PERMISSIONS`
          defaultPermission: NO_PERMISSIONS
          # -- Database location to store permissions and user data e.g. `<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>`
          databaseUri: postgresql+psycopg2://<username>:<password>@pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com/mlflow_basic_auth
          # -- Default admin username if the admin is not already created
          adminUsername: admin
          # -- Default admin password if the admin is not already created
          adminPassword: password
          # -- Function to authenticate requests
          authorizationFunction: mlflow.server.auth:authenticate_request_basic_auth
      # For more information about how to configure backend store, please visit https://mlflow.org/docs/latest/tracking/backend-stores.html
      backendStore:
        # -- Backend store uri e.g. `<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>`
        backendStoreUri: postgresql+psycopg2://mlflow:<password>@pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com/mlflow_store
      • Ganti trackingServer.basicAuth.databaseUri dengan titik akhir database mlflow_basic_auth yang telah Anda buat pada prasyarat. Misalnya, gunakan postgresql+psycopg2://<username>:<password>@pgm-xxxxxxxxxxxxxx.pg.rds.aliyuncs.com/mlflow_basic_auth.

      • Ubah parameter trackingServer.basicAuth.adminUsername dan trackingServer.basicAuth.adminPassword untuk mengonfigurasi username dan password awal administrator MLflow. Akun administrator baru hanya dibuat jika belum ada sebelumnya.

    Untuk daftar lengkap parameter MLflow, lihat MLflow.

Langkah 2: Akses UI Web MLflow yang dideploy di Kubernetes

  1. Jalankan perintah berikut untuk meneruskan layanan UI Web MLflow ke port 5000 di mesin lokal Anda.

    kubectl port-forward -n kube-ai services/mlflow 5000

    Output yang diharapkan:

    Forwarding from 127.0.0.1:5000 -> 5000
    Forwarding from [::1]:5000 -> 5000
    Handling connection for 5000
    Handling connection for 5000
    ...
  2. Buka browser Anda dan kunjungi http://127.0.0.1:5000 untuk melihat UI Web MLflow.

    Setelah berhasil diakses, halaman eksperimen Default dari UI Web MLflow akan muncul. Pesan "No runs logged" menunjukkan bahwa belum ada run yang dicatat. Hal ini mengonfirmasi bahwa layanan MLflow telah berhasil dideploy dan berjalan normal di Kubernetes.

Langkah selanjutnya: Manajemen model

Suite AI cloud-native mendukung pengelolaan model di registri model MLflow. Untuk informasi selengkapnya tentang cara mengelola model menggunakan Konsol pengembangan suite AI cloud-native dan antarmuka baris perintah Arena, lihat Manage MLflow registry models using Arena.