Pruning Modes¶
This document holds a detailed step-by-step guide to deploy the medium-sized static deployment variant of a webshop application to showcase the Consistent-Loose Pruning Mode. The webshop application can be deployed in the following deployment variants.
- static with medium resources on a single virtual machine on a local OpenStack (OS) instance
- static with large resources on a single virtual machine on a local OpenStack (OS) instance
- elastic with high availability and backups on Google Cloud Platform (GCP)
Requirements¶
We need to fulfill the following requirements to follow this step-by-step guide.
- Linux machine, e.g., Ubuntu 22.04
- Access to an OpenStack instance
Preparation¶
First, we install OpenTOSCA Vintner. For more information see Installation.
Next, install xOpera.
Next, we configure xOpera as the orchestrator that should be used for the deployment.
Import the Template¶
First, we import the Variability4TOSCA template.
Then, we initialize an application instance.
We can optionally inspect the Variability4TOSCA model. This model contains all possible elements having conditions assigned. However, due to pruning, only a handful of condition must be modeled, e.g., the condition checking if a medium or large virtual machine is required. This is shown in Figure 1.
Resolve Variability¶
We want to deploy the medium-sized static variant of the webshop application using GCP. We specify this when resolving variability as follows.
You can optionally inspect the generated TOSCA-compliant model. This template contains only the elements required for the elastic variant, e.g., the MySQL database. This is shown in Figure 2.
Deploy the Application¶
Finally, we can deploy the elastic variant.
Therefore, we need to provide deployment inputs, e.g., credentials to OpenStack.
These inputs are specified in topology_template.inputs
of the TOSCA-compliant model.
The following inputs must be defined.
Next, start the deployment. The deployment will take around 5 minutes.
Test the Application¶
Next, we can test that the application is correctly working. Therefore, find out the hostname of the provisioned virtual machine.
If no hostname has been assigned, then use the IPv4 address.
This should return the following.
We can observe the following.
- according to
MESSAGE
, the query has been successful - according to
DB_DIALECT
, the SQLite has been used as dialect - according to
DB_ADDRESS
, a local SQLite database has been used
Thus, we conclude that the application has been deployed as desired.
Undeploy the Application¶
Afterward, we can undeploy the application.
We can also optionally remove the instance or cleanup the filesystem. Note, cleaning up the filesystem removes any vintner data including, e.g., all imported templates and created instances.
Logs¶
This deployment is also executed in our integration pipeline, which is executed once a week. The logs of the corresponding GitHub action can be accessed here. Relevant jobs start with "xOpera Pruning Mode". Note, a GitHub account is required to access these logs. The raw logs are available without requiring an GitHub account.
Zenodo¶
The assets of this guide can be also found on Zenodo.
Publication¶
This guide is part of our paper published at the CLOSER 2024. Also check our other publications.