Fill the Manifest
Once the structure template initialized, the Manifest and Workflow files can be edited to configure the DeltaTwin®.
Describe the DeltaTwin®
Edit the content of manifest.json as follows (split into multiple parts):
Fill general information
For example, the name and description of your project :
{
"name": "image-rotation",
"description": "Perform a rotation of an image in a defined angle",
"license": {
"name": "LGPLv3",
"url": "https://www.gnu.org/licenses/gpl-3.0.txt",
"copyrights": [
{
"years": [
2023,
2024
],
"company": "GAEL Systems"
}
]
},
"owner": "John Doe"
....Do not use uppercase characters, or underscore (_) for name property.
Furthermore, please note that DeltaTwin® names must be unique within the service. A DeltaTwin® component cannot be published if its name is already in use.
Characters allowed for property name are:
- letters (a-z)
- digits (0-9)
- special (-)
Set the Deltatwin’s inputs (global, exposed to end-user)
This part describes the required input parameters for the DeltaTwin. In our example, we define the two following input parameters:
- the URL of the image to rotate :
image - the rotation angle in degree (clockwise) :
angle
And we set them, in the inputs section of the manifest file:
....
"inputs": {
"image": {
"type": "Data",
"description" : "URL image to rotate"
},
"angle": {
"type": "integer",
"description": "Rotation angle in degree (clockwise)"
}
},The supported input parameter types are:
- boolean: boolean values (True | False)
- integer: integer values (e.g., 1,89, -36)
- number: real number (e.g., -25.36, 846.75, 71)
- string: string (e.g., my-deltatwin)
- secret: sensitive information such as API keys and passwords
- json: structured JSON objects
- data: URL to a file, which can be one of the following :
- DeltaTwin® Drive data: Resources stored in DeltaTwin® Drive
- SesamEO® data: Resources stored in SesamEO® (requires API authentication, see how to use a SesamEO® product)
- Other URL data: URL to any file that does not require authentication
Optional default values
You can specify a default value for most input parameters by adding the “value” field in the input definition. This allows pre-filling an input if the end-user does not provide a value.
Example:
....
"angle": {
"type": "integer",
"description": "Rotation angle in degree (clockwise)",
"value": 90
}
....Warning:
The “value” field can NOT be used for inputs of type Data. Since these inputs represent URLs to files, setting a default value can cause execution errors or unexpected behavior.
Set the Deltatwin’s outputs (global, exposed to end-user)
This section describes what will be produced after executing the DeltaTwin.
This example defines a Data type output for the rotated image.
....
"outputs": {
"rotatedImage": {
"type": "Data",
"description": "Rotated image"
}
},Fill the models section
It describes scripts/processes to be executed/launched, their parameters (python version, requirements, command to execute), inputs and outputs. Currently, we support only Python scripts.
Once you have stored all your models in the models directory, reference them in the Manifest file as follow:
....
"models": {
"rotation": {
"path": "models/rotation",
"type": "python",
We define the model starting by its name: there it is “rotation”. Some properties are described below:
- path: Path to the script to be executed
- type: Type of the script. In this case: python
Then, for each model, add the required parameters to specify the execution environment.
....
"parameters": {
"pythonVersion": "3.11",
// Optional
"pipRequirements": [
{
"name": "Pillow",
"version": "10.1.0"
}
],
"pipRequirementFiles": ["requirements.txt"],
"aptRequirements": [
{ "name": "libxml2", "version": "2.10.3" },
{ "name": "libxslt1.1", "version": "1.1.35" }
],
"hardwareRequirements": {
"cpu": "1000m",
"ram": "3Gi"
},
// End optional
"command": "python rotate.py $(inputs.img) $(inputs.angle)"
},- parameters/pythonVersion : set the required python version, must be greater than or equal to 3.9 (compatible with Debian Trixie).
- parameters/pipRequirements : set the list of install requirements
- parameters/pipRequirementFiles : set the list of requirements files (e.g.
requirements.txt) - parameters/aptRequirements : set the list of system dependencies (Debian Trixie packages only. Names and versions can be found on Debian Packages – Trixie )
- parameters/hardwareRequirements : set of properties to define the hardware components used for the DeltaTwin. Default :
- 500m for CPU
- 2Gi for RAM
For more details, refer to Kubernetes Resources unit .
- parameters/command: enter the command to execute the model. Input arguments are provided like
$(inputs.NAME)(replace NAME with the input key) matching the model’s input.
- Only Python ≥ 3.9 is supported (based on Debian Trixie).
pythonVersionandcommandare the only mandatory parameters. All others are optional.- Using
aptRequirementsandpipRequirementFilesis optional and intended to reproduce your Python environment consistently.
Finally, define the inputs and outputs for each model:
.....
"inputs": {
"img": {
"type": "Data"
},
"angle": {
"type": "integer"
}
},
"outputs": {
"out": {
"type": "Data",
"glob": "R_$(inputs.angle)_$(inputs.img.basename)"
}
}
}- inputs : A set of inputs for the model, each input must have a type. It can optionally have a description and/or a value.
- outputs: A set of outputs for the model, each output must have a type and a glob which is the output name (for example, if the angle value is 70, the output name would be “Result_70”).
The complete example manifest file is available here
To test this tutorial, a simple Python script for performing a rotation can be found here.