Updating a Model Deployment with a Burstable VM
Follow these steps to update a model deployment with a burstable instance.
Use the oci data-science model-deployment update command and required parameters to edit (update) a model deployment.
For example, update a deployment with:Then use this model deployment JSON configuration file for update:oci data-science model-deployment update \ --model-deployment-id <MODEL_DEPLOYMENT_OCID> --model-deployment-configuration-details file://<MODEL_DEPLOYMENT_CONFIGURATION_FILE>
{ "modelDeploymentConfigurationDetails": { "deploymentType": "SINGLE_MODEL", "modelConfigurationDetails": { "modelId": "ocid1.datasciencemodel.oc1.iad........", "instanceConfiguration": { "instanceShapeName": "VM.Standard.E4.Flex", "modelDeploymentInstanceShapeConfigDetails": { "ocpus": 1, "memoryInGBs": 16, "cpuBaseline": "BASELINE_1_2" } }, "scalingPolicy": { "policyType": "FIXED_SIZE", "instanceCount": 1 }, "bandwidthMbps": 10 }, "environmentConfigurationDetails" : { "environmentConfigurationType": "OCIR_CONTAINER", "image": "iad.ocir.io/testtenancy/image_name:1.0.0", "entrypoint": [ "python", "/opt/entrypoint.py" ], "serverPort": "5000", "healthCheckPort": "5000" }, "streamConfigurationDetails": { "inputStreamIds": null, "outputStreamIds": null } } }
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Use the UpdateModelDeployment operation to edit (update) a model deployment.
For example:endpoint = ( endpoint = "https://datascience.us-ashburn-1.oci.oraclecloud.com/20190101/modelDeployments/ocid1.datasciencemodeldeployment.oc1.iad.amaaaabggsfewffgew/" ) config = oci.config.from_file(profile_name="OC1") config["region"] = "us-ashburn-1" token_file = config.get("security_token_file", None) signer = None if token_file: with open(token_file, "r", encoding="UTF-8") as file: token = file.read() private_key = oci.signer.load_private_key_from_file(config.get("key_file", "")) signer = oci.auth.signers.SecurityTokenSigner(token, private_key) model_deployment_details_payload = { "projectId": "ocid1.datascienceproject.oc1.eu-milan-1.amaaaaaabbbcccccc", "modelDeploymentConfigurationDetails": { "deploymentType": "SINGLE_MODEL", "modelConfigurationDetails": { "modelId": "ocid1.datasciencemodel.oc1.iad.amaaaaaav66vvniatytp7xjhid3inftgo52j55ozlm7hzglvvqni5wxi3bja", "scalingPolicy": { "instanceCount": 1, "policyType": "FIXED_SIZE" }, "instanceConfiguration": { "instanceShapeName": "VM.Standard.E4.Flex", "modelDeploymentInstanceShapeConfigDetails": { "ocpus": 1, "memoryInGBs": 8, "cpuBaseline": "BASELINE_1_2" } } }, "modelId": "ocid1.datasciencemodel.oc1.iad.amaaaabggsfewffgew", "bandwidthMbps": 10, }, }, "compartmentId": "ocid1.compartment.oc1..gegwgsefvrhresafwo", } update_response = requests.put( endpoint, auth=signer, json=model_deployment_details_payload ) print(update_response.text)