# oracle-samples/oci-data-science-ai-samples architecture

> Architecture diagram of the GitHub repository oracle-samples/oci-data-science-ai-samples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oracle-samples/oci-data-science-ai-samples
- Repository: https://github.com/oracle-samples/oci-data-science-ai-samples

## Overview

##### Project Type and Purpose
– This is a large monorepo of code examples, tutorials, and demos for Oracle Cloud Infrastructure Data Science and AI services.
– It’s not a single running application but a “pattern library” illustrating how to use OCI Data Science: notebooks, jobs, pipelines, model catalog, feature store, distributed training, LLM integration, AI services, container deployments, and ML Applications.

##### File Structure
– Top‐level folders correspond to OCI Data Science service capabilities:
- notebook_examples, conda_environment_notebooks, labs
- LLM (large language models)
- model_catalog_examples, model_deploy_examples
- jobs, distributed_training, pipelines
- feature_store, ml-applications
- ai_services (vision, language, anomaly_detection, document_understanding)
- model-deployment containers (Triton, llama2, misc)
– CI/CD: .github/workflows and GitHub Actions under “actions/”
– Config, license, readmes at root

##### README
– It calls out each capability as a “Topic” mapping to a folder.
– Emphasizes ADS SDK, OCI service APIs, and how examples drive: notebooks → jobs → pipelines → deployments → feature store, model catalog, ML Apps.

##### Main Components
a. Users
– Data Scientists / Developers using JupyterLab, CLI, or ADS SDK
b. Local Example Code
– Notebooks, Python/Java/.NET samples, Terraform manifests, container definitions
c. ADS SDK Layer
– Accelerated Data Science Python library that abstracts OCI service APIs
d. OCI Data Science Services
– Notebook Session Service
– Jobs Service (batch, distributed training)
– Pipelines Service
– Model Catalog Service (models & artifacts storage)
– Feature Store Service
e. OCI ML Applications Service
f. OCI AI Services
– Vision, Language, Document Understanding, Anomaly Detection
g. Container Deployment Targets
– Custom inference containers (Triton, llama2, vLLM, TensorRT, Mistral, RAG)
h. OCI Core Infrastructure
– Compute (VMs, Containers), Object Storage, Networking, IAM, Container Registry
i. CI/CD
– GitHub Actions for README generation, tests, publishing examples

##### Relationships and Data Flows
– User → Local Examples (edit/run)
– Local Examples (notebook or script) call ADS SDK or CLI → OCI Data Science APIs
– Notebook Service / Jobs Service / Pipelines Service orchestrate compute on OCI Compute
– Jobs and Pipelines read/write data from Object Storage and push features to Feature Store
– Training Jobs publish models to Model Catalog
– Model Deployment examples launch containers via OCI ML Applications or custom containers
– AI Services invoked directly by examples for vision, language tasks
– Terraform and OCI SDK scripts under ml-applications and feature_store manage infrastructure provisioning
– CI/CD Actions validate samples, generate docs, enforce code quality

##### Architectural Patterns and Principles
– Modular folder‐per‐capability structure (separation of concerns)
– “Infrastructure as Code” for provisioning (Terraform modules, Helm charts)
– Example‐centric: each folder is a self‐contained demonstration
– Reuse of ADS SDK as a single interface to all services

##### Be Detailed, Not Overly Complex
– Capture every major folder‐to‐service mapping as a component.
– Represent both control flow (API calls) and data flow (model, data, artifacts).
– Emphasize how tutorials and samples map to real OCI services and features.
– Avoid unnecessary internal sub‐folder detail—focus on service boundaries and integration points.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    subgraph "User Tools"
        direction TB
        User["Data Scientist / Developer"]:::user
        CLI["OCI CLI"]:::user
        Jupyter["JupyterLab"]:::user
    end

    %% Local Examples & ADS SDK Layer
    subgraph "Local Examples & ADS SDK"
        direction TB
        NB["Notebooks & Scripts"]:::examples
        Conda["Conda Environment Definitions"]:::examples
        Labs["Tutorials & Lab Exercises"]:::examples
        JobsEx["Job Service Examples"]:::examples
        ADS["ADS SDK"]:::sdk
        DistTrain["Distributed Training Examples"]:::examples
        Pipelines["Pipeline Service Examples"]:::examples
        FS["Feature Store Examples & IaC"]:::examples
        ModelCatEx["Model Catalog Examples"]:::examples
        ModelDepEx["Model Deployment Examples"]:::examples
        MLAppEx["ML Applications Examples"]:::examples
        LLMEx["LLM Integration & Deployment Patterns"]:::examples
        AISvcEx["OCI AI Services Examples"]:::examples
        CustomCont["Custom Inference Containers"]:::examples
    end

    %% OCI Services Layer
    subgraph "OCI Data Science & AI Services"
        direction TB
        NotebookSvc["Notebook Service"]:::service
        JobsSvc["Jobs Service"]:::service
        PipelinesSvc["Pipelines Service"]:::service
        ModelCatalogSvc["Model Catalog Service"]:::service
        FeatureStoreSvc["Feature Store Service"]:::service
        MLAppSvc["ML Applications Service"]:::service
        VisionAI["Vision Service"]:::ai
        LanguageAI["Language Service"]:::ai
        DocAI["Document Understanding Service"]:::ai
        AnomAI["Anomaly Detection Service"]:::ai
    end

    %% Infrastructure Layer
    subgraph "OCI Core Infrastructure"
        direction TB
        Compute["Compute (VMs & Containers)"]:::infra
        ObjectStore["Object Storage"]:::datastore
        Networking["Networking"]:::infra
        IAM["IAM"]:::infra
        ContainerReg["Container Registry"]:::infra
    end

    %% CI/CD Layer
    subgraph "CI/CD"
        direction TB
        GHWF["GitHub Workflows"]:::cicd
        Actions["Custom GitHub Actions"]:::cicd
    end

    %% Relationships
    User -->|edits/runs| NB
    User -->|edits/runs| Conda
    User -->|edits/runs| Labs
    CLI -->|invokes examples| JobsEx
    Jupyter -->|runs notebooks| NB

    NB -->|calls| ADS
    Conda -->|supports| NB
    Labs -->|uses| ADS
    JobsEx -->|calls| ADS
    DistTrain -->|calls| ADS
    Pipelines -->|calls| ADS
    FS -->|calls| ADS
    ModelCatEx -->|calls| ADS
    ModelDepEx -->|calls| ADS
    MLAppEx -->|provisions| ADS
    LLMEx -->|calls| ADS
    AISvcEx -->|calls| ADS
    CustomCont -->|deployed by| MLAppSvc

    ADS -->|submit session| NotebookSvc
    ADS -->|submit job| JobsSvc
    ADS -->|start pipeline| PipelinesSvc
    ADS -->|publish model| ModelCatalogSvc
    ADS -->|push features| FeatureStoreSvc
    ADS -->|manage apps| MLAppSvc

    NotebookSvc -->|runs on| Compute
    JobsSvc -->|runs on| Compute
    PipelinesSvc -->|runs on| Compute
    VisionAI -->|runs on| Compute
    LanguageAI -->|runs on| Compute
    DocAI -->|runs on| Compute
    AnomAI -->|runs on| Compute

    JobsSvc -->|read/write data| ObjectStore
    JobsSvc -->|write features| FeatureStoreSvc
    PipelinesSvc -->|read/write data| ObjectStore
    PipelinesSvc -->|write features| FeatureStoreSvc
    JobsSvc -->|store model| ModelCatalogSvc

    ModelCatalogSvc -->|serve model| MLAppSvc
    MLAppSvc -->|deploy container| Compute
    MLAppSvc -->|pull image| ContainerReg

    %% CI/CD Connections
    GHWF -->|validates samples| NB
    GHWF -->|validates samples| Labs
    GHWF -->|validates samples| JobsEx
    GHWF -->|validates samples| Pipelines
    GHWF -->|validates samples| FS
    GHWF -->|validates samples| MLAppEx
    Actions -->|runs custom workflows| GHWF

    %% Click Events
    click NB "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/notebook_examples/"
    click Conda "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/notebook_examples/_artifacts/conda/"
    click Labs "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/labs/"
    click JobsEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/jobs/"
    click ADS "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/jobs/python/sdk/"
    click DistTrain "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/distributed_training/"
    click Pipelines "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/pipelines/"
    click FS "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/feature_store/"
    click ModelCatEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/model_catalog_examples/"
    click ModelDepEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/model_deploy_examples/"
    click MLAppEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/ml-applications/"
    click LLMEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/LLM/"
    click AISvcEx "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/ai_services/"
    click CustomCont "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/model-deployment/containers/"
    click GHWF "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/.github/workflows/"
    click Actions "https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/actions/"

    %% Styles
    classDef user fill:#D0EFFF,stroke:#BBBBBB
    classDef examples fill:#B3D9FF,stroke:#8888CC
    classDef sdk fill:#99CCFF,stroke:#6688CC
    classDef service fill:#D4EFD4,stroke:#88AA88
    classDef ai fill:#FFE5B4,stroke:#DDAA77
    classDef datastore fill:#D8BFD8,stroke:#AA88AA
    classDef infra fill:#E0E0E0,stroke:#AAAAAA
    classDef cicd fill:#FFF2CC,stroke:#CCCC88
```
