Last updated

๐Ÿ“ฆ Dataloop Package Kit Examples

๐Ÿ“œ Complete DPK Manifest Example

Here is an example of a complete DPK manifest.

NOTE: This is not supposed to be a real app, and publishing or installing it will probably result in some errors.

{
  "name": "dpk-name",
  "displayName": "DPK Display Name",
  "version": "0.0.1",
  "scope": "project",
  "description": "Application description",
  "codebase": {
    "type": "git",
    "gitUrl": "repo-url",
    "gitTag": "0.0.1"
  },
  "components": {
    "panels": [
      {
        "name": "PanelName",
        "icon": "",
        "supportedSlots": [
          {
            "type": "pipelineNodeConfig",
            "configuration": {}
          }
        ],
        "conditions": {
          "resources": []
        }
      }
    ],
    "computeConfigs": [
      {
        "name": "compute-configs1",
        "runtime": {
          "podType": "highmem-xs",
          "concurrency": 1,
          "autoscaler": {
            "type": "rabbitmq",
            "minReplicas": 0,
            "maxReplicas": 2
          }
        }
      }
    ],
    "modules": [
      {
        "name": "my-module",
        "entryPoint": "my_entry_point.py",
        "className": "ClassName",
        "computeConfig": "compute-configs1",
        "description": "Module Desciption",
        "initInputs": [
          {
            "type": "DL Entity",
            "name": "param name"
          }
        ],
        "functions": [
          {
            "name": "func1",
            "input": [
              {
                "type": "DL Entity",
                "name": "param name"
              }
            ],
            "output": [
              {
                "type": "DL Entity",
                "name": "param name"
              }
            ],
            "displayName": "Function Display Name",
            "displayIcon": "",
            "description": "Function Description"
          }
        ]
      }
    ],
    "models": [
      {
        "name": "model-name",
        "moduleName": "my-module",
        "scope": "project",
        "status": "trained",
        "configuration": {},
        "description": "Model Description.",
        "labels": []
      }
    ],
    "pipelineNodes": [
      {
        "panel": "PanelName",
        "name": "Node Name",
        "invoke": {
          "type": "function",
          "namespace": "my-service.my-module.func1"
        },
        "categories": [
          "categoryName"
        ],
        "scope": "node"
      }
    ],
    "services": [
      {
        "name": "my-service",
        "panelNames": [
          "PanelName"
        ],
        "runtime": {
          "podType": "regular-xs",
          "concurrency": 10,
          "autoscaler": {
            "type": "rabbitmq",
            "minReplicas": 0,
            "maxReplicas": 2,
            "queueLength": 10
          }
        }
      }
    ],
    "toolbars": [
      {
        "displayName": "Toolbar Display Name",
        "invoke": {
          "type": "function",
          "namespace": "my-service.func1"
        },
        "location": "datasetBrowserApps",
        "icon": ""
      }
    ]
  }
}

๐ŸŽฏ Real-World DPK Examples

Let's explore some production-ready examples from our public repository! Here are some magical DPKs you can use as inspiration:

๐Ÿค– AI Model Adapters

  • Torch Models - Collection of PyTorch model adapters for various tasks
  • NVIDIA Models - Integration with NVIDIA's AI model ecosystem
  • Grounded SAM - Adapter for Segment Anything Model with grounding

๐Ÿ”„ Pipeline & Data Processing

๐Ÿ”Œ Integrations & Utilities

๐Ÿ“Š Dataset Management

๐Ÿ’ก Key Components in Real DPKs

Each of these DPKs demonstrates best practices for:

๐Ÿ“ Documentation

  • Clear README files
  • Installation instructions
  • Usage examples
  • API documentation

๐Ÿ—๏ธ Structure

  • Well-organized code
  • Proper manifest setup
  • Clear dependency management
  • Modular components

โš™๏ธ Configuration

  • Environment settings
  • Runtime configurations
  • Service definitions
  • Panel layouts

๐Ÿงช Testing

  • Test suites
  • Example data
  • Validation scripts
  • Error handling

๐ŸŽฏ Example Use Cases

Here are some specific examples of how these DPKs are used:

1. Model Integration

{
  "name": "yolov8-detector",
  "components": {
    "models": [
      {
        "name": "fasterrcnn",
        "moduleName": "model-adapter",
        "scope": "project",
        "status": "trained",
        "configuration": {
          "weights_url": "best.pt"
        }
      }
    ]
  }
}

2. Pipeline Node

{
  "name": "data-splitter",
  "components": {
    "pipelineNodes": [
      {
        "name": "Split Dataset",
        "invoke": {
          "type": "function",
          "namespace": "data-split.splitter.split_dataset"
        },
        "categories": ["data"]
      }
    ]
  }
}

3. Custom UI Panel

{
  "name": "annotation-viewer",
  "components": {
    "panels": [
      {
        "name": "AnnotationPanel",
        "supportedSlots": [
          {
            "type": "annotationStudio",
            "configuration": {}
          }
        ]
      }
    ]
  }
}

๐Ÿš€ Getting Started with Examples

To use any of these example DPKs:

  1. Clone the Repository
git clone https://github.com/dataloop-ai-apps/<dpk-name>
  1. Install Dependencies
pip install -r requirements.txt
  1. Configure the DPK
import dtlpy as dl
project = dl.projects.get('your-project')
dpk = project.dpks.push(src_path='path/to/dpk')
  1. Install the App
project.apps.install(dpk=dpk)

๐Ÿ’ก Pro Tips

  • ๐Ÿ“š Study multiple examples to understand different patterns
  • ๐Ÿ” Look at the manifest structure of similar apps
  • ๐Ÿงช Test configurations locally before publishing
  • ๐Ÿ“ Document your customizations
  • ๐Ÿ”„ Keep your dependencies up to date

Need more inspiration? Visit our Dataloop Apps Space for the latest examples and updates! โœจ