Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Winery/Addons/Winery Topology Completion

The TOSCA Topology Completion of Winery enables the user to model incomplete TOSCA Topology Templates and complete them automatically.

In the following we will describe how such incomplete topologies can be modeled and how the Topology Completion can be invoked.

Why Topology Completion?

By using the Topology Completion add-on of Winery you are able to minimize your effort when modeling TOSCA topologies. In most TOSCA run time environments it is necessary to model a complete topology containing all necessary details to provision an application. This leads to high costs in the modeling process. Furthermore a lot of know-how is necessary when completing a topology. The modeler has to know about the components he can insert and their connections. In case this know-how is not granted, the Topology Completion can be very helpful.

The Topology Completion can also be used by inexperienced users who haven't modeled any TOSCA topologies yet. The step-by-step function of the completion allows these users to comprehend the completion and to learn how a TOSCA Topology Template is modeled.

Modeling incomplete TOSCA Topology Templates

figure 1:Example of an incomplete Topology using Requirements

To be able to complete a topology you have to model an incomplete topology first, providing a base for the Topology Completion. There are several ways to model incomplete topologies that will be described in the following.

Modeling incomplete TOSCA Topology Templates using TOSCA Requirements

TOSCA Requirements make it possible to define restrictions for the topology completion. By adding TOSCA Requirements to Node Templates you can determine which elements may or may not be added to the topology. E.g. by adding the Requirement "SQLDatabaseRequirement" you can predetermine that a "SQLDatabase" Node Template will be added to the topology. Note that in this case a Node Type with a suitable CapabilityDefinition (e.g. SQLDatabaseCapability) has to exist in the Winery Repository to fulfill the Requirement.

The example topology in figure 1 displays the usage of Requirements:

figure 2:Possible Completion Result

For each Requirement, the Topology Completion will insert Node Templates containing suitable Capabilities. Note that the inserted Node Templates can be attached with further Requirements that will also be fulfilled by the Topology Completion.

A possible completed topology for the example above is displayed in figure 2.

Modeling incomplete TOSCA Topology Templates using Deferred-Relationship Templates and TOSCA Requirements

In case you want to model part of the infrastructure by yourself (e.g. the Cloud Provider) the usage of Requirements isn't enough. We need a means to predefine part of a complete topology that isn't directly connected to the application components (which contain the TOSCA Requirements). To achieve this we introduce a new Relationship Template "deferred", which you will have to create in the Repository as follows:

<tosca:RelationshipType name="deferred" targetNamespace=""/>
figure 3:Incomplete Topologies using Deferred-Relationship Templates

After creating the Relationship Type in the repository you can use it to connect to your modeled infrastructure components. Figure 3 displays an example for the usage of "deferred"-Relationship Templates. The modeled Amazon Instance will be considered by the Topology Completion.

Invoking the TOSCA Topology Completion

To invoke the Topology Completion open an incomplete topology in the topology modeler and select "Complete Topology". In the appearing dialog fill in the save options for the completed topology and if the Topology Completion shall be processed step-by-step. In case the step-by-step approach is selected, the topology completion algorithm will pause in every step giving feedback about the Node and Relationship Templates to be inserted. Figure 4 displays the completion dialog:

figure 4:Completion Dialog

After the form has been completed you can start the completion by selecting "Complete Topology" in the dialog. After the completion the completed topology will be displayed in the topology modeler or in a new browser window dependent on the selected save options.







Topology Completion - Getting started

Note: You should have a look at the Hello World in Winery page before reading this tutorial to get all the basic knowledge about winery.

In this section we will give you a simple example on how to use the topology completion. We will describe the required types in the repository and show you how to complete your first topology.

We will distinguish between two kinds of users, the Topology Modeler and the Repository Designer. If you don't manage your own repository and just want to model and complete topologies based on a provided repository (e.g. by the employer) you can skip Step 3 and go straight to Step 4. If you are a Repository Designer you should focus especially on the third step.

Step 1: Download the example repository available here: File:Tc demo repository.zip

Step 2: Import the repository in Winery (see next figure)

Import Repo.png

Step 3: Inspect the Types (Note: If you are not interested in the demo repository and just want to model and complete topologies, you can skip this step)

Let's have a look at the types modeled in the repository:

Step 3.1:: Node Types

To inspect the Node Types of your Repository just select the tab "Node Types". You can get detailed information about the Node Types by clicking on them. For this example we have created some Node Types you can use for the topology completion. As you can see, we created a WAR Node Type that can be used to deploy a web-based application, some middle-ware components (Apache Tomcat, Windows, Virtual Machine), a Cloud Provider Node Type and a Database with a corresponding Database Management System. For the topology completion, we will only have to model the application specific components (in this example the WAR, SQL Database and SQL DBMS Node Types).

NodeType Overview.png

When selecting the Node Type "WAR" you can see a more detailed view with information provided in tabs. Select the tab "RequirementDefinition" to display the Requirements of this Node Type. As you can see, the WAR Node Type has the Requirement Definition "ContainerRequirement" determining that is has to be deployed in some kind of webserver container. This Requirement Definition will be considered by the Topology Completion. You can add further Requirements by yourself in this view. To do so you will have to create a new Requirement Type in the repository, see 3.2 for more informations. Note that a Node Type containing a suitable Capability Type should exist to satisfy your inserted Requirements.

If you inspect all Node Types of the demo repository you will see that for every Node Type with a Requirement Definition a Node Type with a suitable Capability Definition exists.

Now let's have a look at how Requirements and Capabilities are matched:

Step 3.2:: Requirement and Capability Types

Select the tab "Other Elements" => "Requirement Types" to get to the overview of the contained Requirement Types in the Repository. As you can see we modeled some Requirements in this example repository to be considered by the topology completion.

Requirement Types Overview.png

Now you can click on one of the Requirements to receive some more details. As you can see in the first tab, every Requirement Type contains an attribute "requiredCapabilityType" to determine which Capability Type matches the requirement. You can create Capability Types in the "Other Elements" overview and match them to you created Requirement Types.

Step 4:

Now that we gained an overview over the most important repository content we can start modeling and completing some example topologies:

First we create a TOSCA Service Template by clicking on the "Service Templates" tab and selecting "Add new". There are already provided some namespaces you can choose from. Select a name and click on "Add" to create the Service Template. After that select the created Service Template and click on "Open Editor" in the displayed window.

Open Topology Modeler.png

After that the graphical topology modeler of winery is opened. You should see the Node Types of the repository in the palette. Our goal is modeling only the application specific components and add the other components automatically. In this example we just model the Node Templates "WAR" and "SQLDatabase", do this by drag and dropping the Templates from the palette into the editor area. After that, select the modeled WAR Node Template, choose the SQLConnection and connect it by drag and drop with the SQL Database Node Template. Your modeled topology should look like this:

Example Topology TC 1.png

In the next step select "Requirements & Capabilities" in the toolbar to extend the Node Templates with the Requirement textfield. By clicking into this textfield you are able to add a new Requirement. The Requirement Definition defined in the Node Type of the selected Template is already chosen, you just have to fill in an ID e.g. the requirement definition name. After adding the Requirements to both Node Templates your topology should look like this:

Example Topology TC 2.png

To invoke the topology completion select "Complete Topology" in the toolbar. After that the topology completion dialog is displayed. In this example we want to create a new topology, openening it in a new window. Furthermore we want the topology completion to be displayed step-by-step:

Tc dialog example.png


tbd.

For feedback or questions contact pascalhirmer(a)googlemail.com

Back to the top