Deploying models from MLFlow¶
The registered models in the Models page in MLFlow in DKubeX can be deployed.
On the DKubeX Workspace, click on the terminal application to open the DKubeX CLI on a new tab.
Type the following command while replacing with the appropriate details enclosed in hashes.
d3x serve create -n <deployment name> -r mlflow --model <model name> --model_version <model version number> --repo_name <name of repo containing serving script> --repo_org <username of repo owner> --is_private_repo --access_token <your github personal access token> --branch_name <name of the branch containing the serving script> --depfilepath <deployment file path> --ngpus <number of gpu> --min_cpu <min number of cpus for cluster creation> --max_cpu <max number of cpus for cluster creation> --min_memory <min memory for cluster creation> --max_memory <max memory for cluster creation> --min_replicas <min number of deployment replicas> --max_replicas <max number of deployment replicas>
d3x serve create -n fmnistdeploy -r mlflow --model fmnistmodel --model_version 1 --repo_name dkubex-examples --repo_org dkubeio --branch_name serve --depfilepath fashion_mnist.deploy
Note
In the serving command, if the values of hardware type, cpu, gpu, memory and replica are not provided, it automatically accepts the default values for them.
Use –is_private_repo and –access_token flags if the repository containing the serving script is private. Also make sure that you have access to the repository containing the serving script.
To find the model name and version number, use the following steps-
After entering all necessary details, press Enter. The deployment creation will start automatically.
On the DKubeX UI, go to the Deployments tab. The list on the screen should show your deployment, along with it’s status, the name of the serve cluster and the serve endpoint.