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

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

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

## Overview

##### Project type and purpose
- This repository is not a single-running application but a comprehensive “examples and tutorials” codebase for Oracle Cloud Infrastructure (OCI) Data Science and AI services.
- Its purpose is to demonstrate usage patterns for OCI Data Science (notebooks, jobs, pipelines), OCI AI Services (anomaly detection, vision, language, document understanding), model catalog and deployment, data labeling, and associated CI/CD workflows.

##### High-level architecture and main components
A. Code Repository (GitHub)
- Source folders:
– ai_services (sub-folders for anomaly_detection, document_understanding, language, vision)
– notebook_examples, conda_environment_notebooks, labs, use_cases
– data_labeling_examples, model_catalog_examples, model_deploy_examples, model_deploy_examples
– jobs (Python, Java, Shell, TS+JS, custom actions), pipelines, distributed_training
- Config and metadata: README.md, LICENSE, GitHub Actions workflows

B. Developer/User Environment
- Local workstation or OCI Data Science notebook environment
- Clone or pull this repo from GitHub
- JupyterLab/VS Code UI for notebooks and code examples

C. OCI Cloud Services (the targets of the examples)
1. OCI Data Science Service
– Notebook Sessions running Jupyter notebooks
– Jobs: managed container jobs (Python, Java, TS+JS, Shell)
– Pipelines: orchestrated ML pipelines with multiple steps
2. OCI AI Services
– Anomaly Detection
– Vision (image/video analysis)
– Language (translation, classification, NER)
– Document Understanding (text, tables, key-value)
3. Model Catalog & Deployment
– OCI Model Catalog: model artifacts, runtime.yaml, score.py
– OCI Function or container‐based model deployment
– Autoscaling alarms (CPU/memory)
4. OCI Data Labeling Service
– Bulk labeling via Python and Java scripts
5. OCI Object Storage
– Store datasets, model artifacts, logs, sample data

##### Relationships and data flows
- The developer pulls the repo → runs notebooks or scripts locally / in Notebook Sessions
- Notebooks and scripts interact with OCI SDK or REST API → invoke AI Services or Data Science Service
- Data flows: sample data (local / Object Storage) → processed in notebooks/jobs → models registered in Model Catalog → deployed via Functions or containers → inference requests
- CI/CD: GitHub Actions kick off workflows (e.g., make_readme, create_pr_action)

##### Architectural patterns and principles
- Modular folder-per-feature organization: each service or use-case isolated in its own subfolder
- Sample-driven learning: each component shows minimal end-to-end pipeline
- Reuse of common patterns: score.py + runtime.yaml for model deployment
- Infrastructure as code: jobrunner.py + Dockerfiles illustrate containerization

##### Essential elements
- Clear labeled components: GitHub Repo, Developer Notebook, OCI Data Science Service, AI Services, Object Storage, Model Catalog, Deployment

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Zone
    subgraph "Developer / Notebook Zone"
        Dev["Developer Notebook"]:::dev
    end

    %% Code Repository Zone
    subgraph "Code Repository (GitHub)" 
        Repo["GitHub Repo"]:::code
        subgraph "Examples & Tutorials"
            NotebookExamples["Notebook Examples"]:::data
            CondaEnv["Conda-Env Notebooks"]:::data
            UseCases["Use-case Notebooks"]:::code
            Labs["Labs & Tutorials"]:::code
            DataWrangle["Parquet from OSS"]:::data
            AIExamples["AI Services Examples"]:::code
            subgraph "AI Services Examples"
                anomalyDet["Anomaly Detection"]:::ai
                docUnder["Document Understanding"]:::ai
                language["Language"]:::ai
                vision["Vision"]:::ai
            end
            subgraph "Data Science Examples"
                Jobs["Jobs (Python/Java/Shell/TS+JS/Custom)"]:::data
                Pipelines["Pipelines"]:::data
                DistTrain["Distributed Training"]:::data
            end
            subgraph "Data Labeling Examples"
                DLJava["Bulk Labeling Java"]:::data
                DLPython["Bulk Labeling Python"]:::data
            end
            subgraph "Model Examples"
                MCExamples["Model Catalog Examples"]:::storage
                MDExamples["Model Deployment Examples"]:::deploy
                Autoscale["Autoscaling Deployment"]:::deploy
                Containers["Container Deployment"]:::deploy
            end
        end
        subgraph "CI/CD Workflows"
            MakeReadmeWorkflow["make_readme.yml"]:::cicd
            CreatePRAction["create_pr_action"]:::cicd
            MakeReadmeAction["make_readme"]:::cicd
        end
        Docs["README.md & LICENSE"]:::doc
    end

    %% OCI Cloud Services Zone
    subgraph "OCI Cloud Services"
        subgraph "OCI Data Science Service"
            NotebookSessions["Notebook Sessions"]:::ds
            JobsService["Jobs Service"]:::ds
            PipelinesSvc["Pipelines Service"]:::ds
        end
        subgraph "OCI AI Services"
            AD["Anomaly Detection"]:::ai
            DU["Document Understanding"]:::ai
            LG["Language"]:::ai
            VS["Vision"]:::ai
        end
        subgraph "Storage & Catalog"
            ObjectStorage["Object Storage"]:::storage
            ModelCatalog["Model Catalog"]:::storage
        end
        subgraph "Model Deployment"
            Functions["Functions"]:::deploy
            ContainerSvc["Container Instances"]:::deploy
        end
    end

    %% Connections
    Repo -->|"git clone/pull"| Dev
    Dev -->|"OCI Python SDK / REST API"| NotebookSessions
    Dev -->|"OCI Python SDK / REST API"| JobsService
    Dev -->|"OCI Python SDK / REST API"| PipelinesSvc
    Dev -->|"OCI Python SDK / REST API"| AD
    Dev -->|"OCI Python SDK / REST API"| DU
    Dev -->|"OCI Python SDK / REST API"| LG
    Dev -->|"OCI Python SDK / REST API"| VS

    NotebookSessions -->|"read/write data"| ObjectStorage
    JobsService -->|"read/write data"| ObjectStorage
    PipelinesSvc -->|"read/write data"| ObjectStorage

    ObjectStorage -->|"stores sample data & artifacts"| AD
    ObjectStorage -->|"stores sample data & artifacts"| DU
    ObjectStorage -->|"stores sample data & artifacts"| LG
    ObjectStorage -->|"stores sample data & artifacts"| VS

    AD -->|"output model artifacts"| ModelCatalog
    DU -->|"output model artifacts"| ModelCatalog
    LG -->|"output model artifacts"| ModelCatalog
    VS -->|"output model artifacts"| ModelCatalog

    ModelCatalog -->|"register/deploy"| Functions
    ModelCatalog -->|"register/deploy"| ContainerSvc
    Functions -->|"store logs & metrics"| ObjectStorage
    ContainerSvc -->|"store logs & metrics"| ObjectStorage

    Repo --> MakeReadmeWorkflow
    Repo --> CreatePRAction
    Repo --> MakeReadmeAction
    MakeReadmeWorkflow -->|"trigger CI"| NotebookSessions
    CreatePRAction -->|"trigger CI"| JobsService
    MakeReadmeAction -->|"trigger CI"| PipelinesSvc

    %% Click Events
    click MakeReadmeWorkflow "https://github.com/behnambina/oci-data-science-ai-samples/blob/master/.github/workflows/make_readme.yml"
    click CreatePRAction "https://github.com/behnambina/oci-data-science-ai-samples/blob/master/actions/create_pr_action/action.yaml"
    click MakeReadmeAction "https://github.com/behnambina/oci-data-science-ai-samples/blob/master/actions/make_readme/action.yaml"
    click anomalyDet "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/ai_services/anomaly_detection"
    click docUnder "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/ai_services/document_understanding/python"
    click language "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/ai_services/language"
    click vision "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/ai_services/vision/python"
    click NotebookExamples "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/notebook_examples"
    click CondaEnv "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/conda_environment_notebooks"
    click Jobs "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/jobs"
    click Pipelines "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/pipelines"
    click DistTrain "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/distributed_training"
    click DLJava "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/data_labeling_examples/bulk_labeling_java"
    click DLPython "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/data_labeling_examples/bulk_labeling_python"
    click MCExamples "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/model_catalog_examples"
    click MDExamples "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/model_deploy_examples"
    click Autoscale "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/model-deployment/autoscaling-model-deployment"
    click Containers "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/model-deployment/containers"
    click UseCases "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/use_cases"
    click Labs "https://github.com/behnambina/oci-data-science-ai-samples/tree/master/labs"
    click DataWrangle "https://github.com/behnambina/oci-data-science-ai-samples/blob/master/data-wrangling/parquet-from-oss.ipynb"
    click Docs "https://github.com/behnambina/oci-data-science-ai-samples/blob/master/README.md"

    %% Styles
    classDef dev fill:#f9f,stroke:#333,stroke-width:1px
    classDef code fill:#eef,stroke:#333,stroke-width:1px
    classDef data fill:#ddf,stroke:#333,stroke-width:1px
    classDef ds fill:#cce,stroke:#333,stroke-width:1px
    classDef ai fill:#cfc,stroke:#333,stroke-width:1px
    classDef storage fill:#fcf,stroke:#333,stroke-width:1px
    classDef deploy fill:#ffc,stroke:#333,stroke-width:1px
    classDef cicd fill:#ccc,stroke:#333,stroke-width:1px
    classDef doc fill:#efe,stroke:#333,stroke-width:1px
```
