Add you model/service to the DEEP marketplace¶
This document describes how to add your trained service or model to the DEEP marketplace.
Creating the Github repositories¶
You model must have a repository to host the code and a repository to host the Dockerfiles. Both these repositories can he hosted under your personal Github account. Naming conventions are that the Docker repo name is the same as the code repo name with the prefix
A typical example of this can be:
- deephdc/image-classification-tf - The Github repo hosting the code of an image classfication model.
- deephdc/DEEP-OC-image-classification-tf - The Github repo hosting the Dockerfiles of the image classification model.
In case you are only developing a service based on an already existing model (like for example developing an animal classifier based on the image-classification-tf module) you only need to create the Docker repo.
The code repo¶
This is the repo containing the code of your model. If you are adding a service (ie. a trained model) the weights of the trained model must be stored in a location accessible over a network connection, so that your container can download them upon creation. A few MUSTs your code has to comply with in order to ensure compatibility and ease of use:
The Docker repo¶
This repo has to contain at least the following files:
This is the file to build a container from your application. If you developed your application from the DEEP cookiecutter template you should have a draft of this file under the
./dockerfolder (although you might need to add additional code depending on the requirements of your model).
If you are adding a service instead of a model, it is good practice to draw inspiration from the Dockerfiles of other services derived from the same model (for example the plant classification Dockerfile derived from the image classification model).
Some steps common to all Dockerfiles include cloning the model code repo, pip installing the DEEPaaS API, installing rclone and downloading the trained weights if you are adding a service. For the details of all these steps please refer to this Dockerfile example.
This is the file that runs the Jenkins pipeline. You can copy this Jenkinsfile example replacing the repo names with your own Docker repo name.
This file contains the information that is going to be displayed in the Marketplace. You can build your own starting from this metadata.json example
Making the Pull Request¶
Once your repos are set it’s time to make a PR to add your model to the marketplace!
For this you have to fork the code of the DEEP marketplace (deephdc/deephdc.github.io) and add your Docker repo name at the end of the
project_apps.yml file in the pelican branch.
git clone -b pelican https://github.com/[my-github-fork] cd [my-github-fork] echo '- module: https://github.com/[my-account-name]/DEEP-OC-[my-app-name]' >> project_apps.yml git commit -a -m "adding new module to the catalogue" git push
Once the changes are done, make a PR of your fork to the original repo (again to the pelican branch) and wait for approval. Check the GitHub Standard Fork & Pull Request Workflow in case of doubt.