Skip to content

Conditional Deployment Artifacts and Conditional Properties

This document holds a detailed step-by-step guide to deploy the enterprise plan of a web shop application to showcase conditional deployment artifacts and conditional properties, as presented in Figure 1. The motivating scenario is a simple shopping application that consists of a shop component and a database. Thereby, we take the role of a SaaS provider which offers different pricing plans to his customers. Furthermore, there are two different deployment artifacts: the community deployment artifact and the enterprise deployment artifact. The community deployment artifact implements the core functionality of the shop component whereas the enterprise deployment artifact additionally implements analytical reporting functionalities.

There is a free community plan that deploys the community deployment artifact along with SQLite on a small virtual machine. In contrast, the business plan is a paid plan that deploys the enterprise deployment artifact which contains analytical reporting functionalities along with MySQL on Google Cloud Platform (GCP). However, to have full access to all analytical reporting functionalities, the enterprise plan is required. An important aspect of the deployment of the shop component is that the correct SQL dialect must be configured.

Variants

Figure 1: The different deployment variants.

Requirements

We need to fulfill the following requirements to follow this step-by-step guide.

  • Ubuntu 22.04
  • Access to a GCP project
  • GCloud
  • Git
  • Unfurl
  • Terraform

Preparation

First, we install OpenTOSCA Vintner. For more information see Installation.

curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash -

Next, we configure Unfurl as the orchestrator that should be used for the deployment. For more information see Orchestrators.

vintner orchestrators init unfurl
vintner orchestrators enable --orchestrator unfurl

Import the Template

Variability4TOSCA template

Figure 2: The Variability4TOSCA template.

First, we clone the repository.

1
2
3
4
5
6
7
git clone https://github.com/OpenTOSCA/opentosca-vintner.git
cd opentosca-vintner
git lfs install
git lfs pull
./task install
./task tasks:build
./task examples:pull:link

Next, we import the template and initialize an instance.

vintner templates import --template artifacts --path examples/unfurl-artifacts

Next, we initialize an application instance.

vintner instances init --instance artifacts --template artifacts

We can optionally inspect the Variability4TOSCA template. This template contains all possible elements having conditions assigned. For example, the MySQL database has a condition assigned that checks if the enterprise deployment artifact is present. An overview is given in Figure 2.

vintner templates inspect --template artifacts

Resolve Variability

TOSCA Template

Figure 3: The deployment variant.

We intend to deploy the enterprise plan. Furthermore, we want to configure the display language of the shop component to be German. We specify this when resolving variability.

vintner instances resolve --instance artifacts --presets enterprise

We can optionally inspect the generated TOSCA-compliant template. This template contains only the elements required for the enterprise plan. Notably, the enterprise deployment artifacts is present and configured to use the MySQL dialect. An overview is given in Figure 3.

vintner instances inspect --instance artifacts

Deploy the Application

Finally, we deploy the application. Therefore, we need to provide deployment inputs, e.g., credentials to GCP. Possible deployment inputs are specified in topology_template.inputs of the TOSCA-compliant template. The deployment will take around 15-20 minutes.

vintner instances deploy --instance artifacts --inputs ${INPUTS_PATH}

Undeploy the Application

Afterward, we can undeploy the application.

vintner instances undeploy --instance artifacts

Optionally, we can remove the instance and cleanup the filesystem. Cleaning up the filesystem removes any data including, e.g., all imported templates and created instances.

vintner instances delete --instance pruning
vintner setup clean --force

Complexity Analysis

The templates for our complexity analysis can be found here.

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 "Unfurl Artifacts". 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 research paper published at the main track of the CoopIS 2023. Also, this guide is further extended by our demonstration paper which was published at the demo track at the CoopIS 2023. Also check our other publications.


Last update: December 4, 2024