The easiest way to add a new template to MLT is to make a copy of one of the existing templates and then modify it. The following instructions will go through those steps:
-
Start by making a copy of one of the folders in the
mlt-templates
directory. Either start with something simple like thehello-world
template, or pick a template that is similar to the one that you are going to add. -
Rename the new folder with the name for your template.
-
Update the
README.md
file with a short description of your template. Note that this is the description that will be displayed withmlt templates list
-
Other files that typically need to be modified for new templates are:
*.py
filesrequirements.txt
with any libraries that your app usesDockerfile
if the name of the python file to execute is different, etc.k8s-templates/job.yaml
for the kubernetes job may need to be modified depending on if a CRD is used, if multiple replicas are needed, if environment variables need to be set, etc. Note that all files in thek8s-templates
directory can have variables like$app
,$run
, and$image
that will be subbed into the template when the app is deployed.parameters.json
(optional) to define any additional parameters specific to your template. These parameters are added to the app'smlt.json
file when it's initialized. The parameter values are subbed in to thek8s-templates
directory when the app is deployed.
- To test your template, you need to use the
--template-repo
parameter withmlt templates list
andmlt templates init
in order to specify the git url for template repo (otherwise, this defaults to[email protected]:IntelAI/mlt.git
).