The deltatwin drive
is the command line dedicated to handle DeltaTwin® project repository.
It stores all the configuration, resources, models and sources to run a DeltaTwin® component and retrieve data.
The DeltaTwin® component anatomy can be described with the following empty local representation:
my_project
├─── manifest.json
├─── artifacts/
├─── models/
├─── resources/
├─── sources/
└─── workflow.yml/
deltatwin drive init
Create an empty DeltaTwin repository.
The DIRECTORY automatically contains subdirectories and files used to manage a DeltaTwin.
Typically, there are resources, artifacts, sources and models folders. It also contains the manifest file which synchronizes all resources, dependencies and sources used by the DeltaTwin
DIRECTORY : path to the folder containing the DeltaTwin components [MANDATORY]
deltatwin drive init [OPTIONS] DIRECTORY
Options
- -h, --help
Show this message and exit.
Arguments
- DIRECTORY
Required argument
Examples:
For example, you can create a new DeltaTwin® called ndvi with the following command:
deltatwin drive init /home/user/desktop/ndvi
This command will create the basic files of a DeltaTwin® component, in a folder called ndvi.
INFO:Delta:New commit : 076f911d678a97038bf83d873c8d94797341ef65 master
INFO:Delta:Twin has been initialized at /home/user/desktop/ndvi
INFO: DeltaTwin® ndvi created
deltatwin drive build
Build the DeltaTwin image with a (user) provided tag
deltatwin drive build [OPTIONS]
Options
- -t, --tag <tag>
The (build) image tag name. Default value is ‘latest’
- -r, --registry <registry>
The user defined registry. Default value is ‘docker.io’
- -h, --help
Show this message and exit.
Examples:
delta drive build -t <tag name>
This command will build a (Docker) image of your DeltaTwin® component.
deltatwin drive publish
Publish a new version of a DeltaTwin to the platform.
VERSION: identifier of the published DeltaTwin. [MANDATORY]
The canonical public version identifiers MUST comply with the following scheme: [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
To publish a new DeltaTwin, you must download the DeltaTwin, and then execute:
- deltatwin drive publish 1.0.0
–change-log “New version of my DeltaTwin”
To publish a new version of my DeltaTwin, you must download the DeltaTwin, and then execute:
deltatwin drive publish 1.0.0 –change-log “New version of my DeltaTwin” –deltatwin-name my_deltatwin
deltatwin drive publish [OPTIONS] VERSION
Options
- -v, --visibility <visibility>
Set the visibility of the DeltaTwin.
- Options:
public | private
- -t, --topic <topic>
Define each topic of the DeltaTwin (multiple topics can be defined)
- -C, --change-log <change_log>
Describe the change log of the DeltaTwin
- -c, --conf <conf>
Path to the conf file
- -d, --deltatwin-name <deltatwin_name>
Delta component name
- -h, --help
Show this message and exit.
Arguments
- VERSION
Required argument
Examples:
deltatwin drive publish <version name>
deltatwin drive publish -d <DeltaTwin® name> <version name>
This command will publish your DeltaTwin® component to the DeltaTwin® platform. But you can also publish a new version of your DeltaTwin®. Note: If you have already pushed your DeltaTwin®, please use the second command.
Resource
deltatwin drive resource add
Add a resource to the DeltaTwin component resources list, if the download option is present. This command will download the resource and put it in the resources folder, and add an entry in the resources section of the manifest.json file.
PATH: fullpath, url or directory of the resources. [MANDATORY]
FILENAME: by which the resource is referenced. [MANDATORY]
deltatwin drive resource add [OPTIONS] PATH FILENAME
Options
- -h, --help
Show this message and exit.
- -d, --download
If present the resources will be download andput in the resources folder
Arguments
- PATH
Required argument
- FILENAME
Required argument
Examples:
deltatwin drive resource add /path/to/resource Sentinel1.zip
Will add the resource given in argument, to the resources of the working DeltaTwin® component. If given the option –download, it will download the resource and put it in the resources folder. This command will add the entry to manifest.json.
deltatwin drive resource delete
Delete a resource from the DeltaTwin component resources list.
NAME: by which the resource is referenced. [MANDATORY]
deltatwin drive resource delete [OPTIONS] NAME
Options
- -h, --help
Show this message and exit.
Arguments
- NAME
Required argument
Examples:
deltatwin drive resource delete Sentinel1.zip
This command will remove the entry from the manifest.json.
deltatwin drive resource list
List the resources from the working DeltaTwin.
deltatwin drive resource list [OPTIONS]
Options
- -f, --format-output <format_output>
Format of the output json/text default is text
- -h, --help
Show this message and exit.
Examples:
deltatwin drive resource list
List all the resources from the manifest.json of the working DeltaTwin® component.
deltatwin drive resource sync
Reload the manifest file content to refresh project resources section
deltatwin drive resource sync [OPTIONS]
Options
- -h, --help
Show this message and exit.
Examples:
deltatwin drive sync
This command will reload the manifest.json, to update all the resources with the last manifest load.
INFO:Delta:Fetching https://catalogue.dataspace.copernicus.eu/odata/v1/Products(UUID)...
INFO:Delta:https://catalogue.dataspace.copernicus.eu/odata/v1/Products(UUID) has been fetched.
Artifact
DeltaTwin® artifact stores output Data of DeltaTwin® component executions.
deltatwin drive artifact add
Create an artifact from an output of a DeltaTwin component execution.
RUN_ID: Id of the run Execution [MANDATORY]
OUTPUT_NAME: Name of the output [MANDATORY]
Example: deltatwin drive artifact add b8810ff1-16c7-4269-b784-0c5ce392ff25 out –artifact-name artifact_1 –description description –topic topic1 –topic topic2
deltatwin drive artifact add [OPTIONS] RUN_ID OUTPUT_NAME
Options
- -c, --conf <conf>
Path to the conf file
- -a, --artifact-name <artifact_name>
Required Name of the artifact
- -d, --description <description>
Required Description of the artifact
- -t, --topic <topic>
Required Define each topic of the artifact (multiple topics can be defined)
- -h, --help
Show this message and exit.
Arguments
- RUN_ID
Required argument
- OUTPUT_NAME
Required argument
deltatwin drive artifact list
List the artifacts of a DeltaTwin component
Example: deltatwin drive artifact list
deltatwin drive artifact list [OPTIONS]
Options
- -c, --conf <conf>
Path to the conf file
- -s, --short
Shows only the most significant columns in table
- -f, --format-output <format_output>
Format of the output json/text default is text
- -h, --help
Show this message and exit.
deltatwin drive artifact get
Retrieve an artifact and store it in a file.
ARTIFACT_ID: Id of the Artifact [MANDATORY]
Example:
deltatwin drive artifact get b8810ff1-16c7-4269-b784-0c5ce392ff25 –file my_art.jpg –download
deltatwin drive artifact get b8810ff1-16c7-4269-b784-0c5ce392ff25
deltatwin drive artifact get [OPTIONS] ARTIFACT_ID
Options
- -c, --conf <conf>
Path to the conf file
- -d, --download
- -F, --file <file>
Path of the file to save the artifact, by default it is the basename of the artifact in current directory
- -f, --format-output <format_output>
Format of the output json/text default is text
- -h, --help
Show this message and exit.
Arguments
- ARTIFACT_ID
Required argument
deltatwin drive artifact delete
Delete an artifact from user remote storage using its ID. ARTIFACT_ID: Id of the artifact [MANDATORY]
deltatwin drive artifact delete [OPTIONS] ARTIFACT_ID
Options
- -c, --conf <conf>
Path to the conf file
- -h, --help
Show this message and exit.
Arguments
- ARTIFACT_ID
Required argument