A TOSCA ServiceTemplate that enables running the attached artifacts must be generated.
Initially, Java and Python3 projects provided as zips shall be supported.
Winery shall be used to generate the deployment model.
Thus, ArtifactTemplates and ServiceTemplates must be generated via Winery's API.
Tasks
[x] Familiarize yourself with the existing OpenTosca utility code
[x] Analyze general requirements of Java and Python3 applications (e.g., requirements files, ...)
[ ] Enable automatic generation of a deployable TOSCA Service Template based on the attached artifacts (for now only one Artifact per service task shall be supported):
[x] Add a drop-down menu to select the artifact type for attached artifacts, e.g., Python3.7 for a zip file containing the Python application or WAR for a packaged Java application
[x] Generate a new ServiceTemplate using Winery`s API (POST @ http://localhost:8080/winery/servicetemplates/) using the activity ID, as well as the activity label, as the ID of the ServiceTemplate. Use a separate service template per service task.
[x] Add a corresponding NodeTemplate representing the artifact within the ServiceTemplate and attach the created ArtifactTemplate as DeploymentArtifact to the NodeTemplate. No Meta Service templates are required, instead add an empty template and add the required node templates. Example Request (click to expand)
The required NodeType can be derived from the type of the artifact, which can be hardcoded as a map in the workflow modeler, e.g., PythonApplication based on the type Python3.7. (Example code)
Example URL derived from generating the ServiceTemplate
[ ] Add URL to service template as property of the activity (Example)
Problem Statement
To enable the deployment of attached files, they need to be prepared for deployment.
Issue Dependencies
Depends on: #1
References
OpenTOSCA Tutorial
Expected Behaviour
A TOSCA ServiceTemplate that enables running the attached artifacts must be generated. Initially, Java and Python3 projects provided as zips shall be supported. Winery shall be used to generate the deployment model. Thus, ArtifactTemplates and ServiceTemplates must be generated via Winery's API.
Tasks
Result Example (click to expand)
[ { "id" : "AMQP-Driver_Java11-w1", "name" : "AMQP-Driver_Java11-w1", "namespace" : "http://opentosca.org/driverinjection/artifacttypes", "qName" : "{http://opentosca.org/driverinjection/artifacttypes}AMQP-Driver_Java11-w1", "version" : { "componentVersion" : "Java11", "wineryVersion" : 1, "workInProgressVersion" : 0, "currentVersion" : false, "latestVersion" : false, "releasable" : false, "editable" : false } }, { "id" : "AMQP-Driver_Python3.8-w1", "name" : "AMQP-Driver_Python3.8-w1", "namespace" : "http://opentosca.org/driverinjection/artifacttypes", "qName" : "{http://opentosca.org/driverinjection/artifacttypes}AMQP-Driver_Python3.8-w1", "version" : { "componentVersion" : "Python3.8", "wineryVersion" : 1, "workInProgressVersion" : 0, "currentVersion" : false, "latestVersion" : false, "releasable" : false, "editable" : false } } ]
Example Request (click to expand)
{"documentation":[],"any":[],"otherAttributes":{},"relationshipTemplates":[],"nodeTemplates":[{"documentation":[],"any":[],"otherAttributes":{"{http://www.opentosca.org/winery/extensions/tosca/2013/02/12}x":325,"{http://www.opentosca.org/winery/extensions/tosca/2013/02/12}y":358},"properties":{"propertyType":"KV","kvproperties":{"volume_id":"","snapshot_id":""},"elementName":"properties","namespace":"http://opentosca.org/nodetypes/propertiesdefinition/winery"},"id":"BlockStorage_0","type":"{http://docs.oasis-open.org/tosca/ToscaNormativeTypes/nodetypes}BlockStorage","name":"BlockStorage","minInstances":1,"maxInstances":1,"x":325,"y":358,"capabilities":[],"requirements":[],"deploymentArtifacts":[{"documentation":[],"any":[],"otherAttributes":{},"name":"trest","artifactType":"{http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}ScriptArtifact","artifactRef":"{http://opentosca.org/artifacttemplates}ApacheApp_install-w1"}],"policies":null}]}