ML Application Project Setup
After creating the infrastructure for the sample ML Application, you can use the sample ML Application project as a template to start building, deploying, and operating your own ML Applications.
This project includes development best practices and provides the mlapp
CLI,
a tool that simplifies ML Application development. To create an ML Application, you must use
the mlapp
CLI, Terraform, OCI
SDK, or OCI CLI. You can't create an ML
Application in the Console, but you can view ML Applications
and their details there.
By starting your project with the sample ML Application project, you can progress your ML Application Implementation to production. The project is built using experience gained from helping organizations to successfully deploy their applications to production.
The sample ML Application project is available here: sample-project.
Clone this project to use it as the foundation for your ML Application Implementation.
The project includes documentation in README.md files, where you can find detailed information about the project and its components.
Project Structure
The project consists of two main parts:
- The infrastructure folder automates the creation of resources that the sample ML Application depends on.
- The ML Application folder contains the sample ML Application, including its
configuration, implementation, and the
mlapp
CLI.
Configuring Prerequisite Resources
Before you begin building and deploying the ML Application, you need to create the necessary resources that the sample ML Application depends on (for example, logs, log groups, a Data Science project, and a subnet). This process can be automated by following these steps:
Configuring the ML Application Environment
Configuring and Initializing the mlapp CLI
Building and Deploying the Application
With everything configured, you can now start building and deploying the application.
Learn about
mlapp
CLI commands by running:
mlapp -h
mlapp
CLI command, check the results by
navigating to ML Applications under OCI
Console / Analytics & AI / Machine
Learning.Use Defined and Free-Form Tags
The sample application illustrates how to use both defined and free-form tags to ensure tenant isolation and enable tracking of runtime resources, specifically models.
- Add a defined tag to a bucket
-
resource "oci_objectstorage_bucket" "data_storage_bucket" { compartment_id = var.app_impl.compartment_id namespace = data.oci_objectstorage_namespace.this.namespace name = "ml-app-fetal-risk-bucket-${var.app_instance.id}" access_type = "NoPublicAccess" # To allow Instance (tenant) isolation defined_tags = {"MlApplications.MlApplicationInstanceId" = var.app_instance.id} }
- Add defined and free-form tags to a model
-
model_id = xgb_model.save(display_name='fetal_health_model', # needed for tenant isolation defined_tags={"MlApplications": {"MlApplicationInstanceId": instance_id}}, # needed for ML App to be able to track created model freeform_tags={"MlApplicationInstance": instance_id})