MTA deploy service for Cloud Foundry is based on the Multi-Target Application (MTA) model in which CF applications are modelled as modules, while CF services as resources. The MTA model enables the delivery of packaged applications, where any target specific configuration could be specified on deployment time without changing application code. CF MTA deploy service provides the possibility to operate (deploy, update, undeploy) MTA modeled applications via a single command, while ensuring the consistency and completeness of the different application components.
Contains the swagger-generated definitions of the REST API models and endpoints. The complete swagger definitions can be found at: https://app.swaggerhub.com/apis/SAP53/mtarest/1.0.0
Contains the domain model, persistence and other core services and utilities.
Extends the Java Client Library for Cloud Foundry with additional domain model objects and attributes, OAuth token providers and retrying functionality.
Contains the concrete workflow definitions for MTA operations like deploy, undeploy, blue-green deploy, etc. These are modelled via Activiti BPMN process definitions. The process definitions have steps, where each step logic uses the com.sap.cloud.lm.sl.cf.client
to call the Cloud Controller API from Cloud Foundry.
Contains REST API implementations for:
- performing MTA applications - executing deploy, undeploy, blue-green deploy
- listing deployed MTA applications
- listing MTA operations - both on-going and historic ones
- reading and writing cross MTA configurations
The result from the build of this component is a WAR file which is the deployable assembly of the CF deploy service.
The CF MTA deploy service is run as a standard application in Cloud Foundry. Thus, it uses the widely adopted environment-based configuration mechanism. The configuration file for the application is located at manifest.yml. There could be configured the following:
Env Variable Name | Sample Value | Description |
---|---|---|
XS_TARGET_URL | http://api.bosh-lite.com | Cloud Foundry API URL. |
PLATFORMS_V2 | see manifest.yml | Contains the configuration of the MTA module and resource types. MTA module types are mapped to Cloud Foundry buildpacks and default application parameters, whereas MTA resource types are usually mapped to Cloud Foundry services with concrete service plans and parameters. This is for MTA spec v2. |
PLATFORMS_V3 | see manifest.yml | Same as PLATFORMS_V2, but this is for MTA spec v3. |
DB_TYPE | POSTGRESQL | The used persistence type. Currently only PostgreSQL is supported. |
SKIP_SSL_VALIDATION | true | Skips SSL certificate validation. |
All components are built with Java 8 and Apache Maven.
To build all components, run the following command from the root directory:
$ mvn clean install
The deployable result from building components is a WAR file, located at com.sap.cloud.lm.sl.cf.web/target/com.sap.cloud.lm.sl.cf.web-<version>.war
. Additionally, there is certain preprocessing of the manifest.yml and the build result is located at com.sap.cloud.lm.sl.cf.web/target/manifests/manifest.yml
.
The CF MTA deploy service is deployed as a standard application in Cloud Foundry. So first you have to get access to a Cloud Foundry instance, then login to the CF API and target a org and space, where the CF deploy service applicaiton is to be deployed.
In order to function the CF MTA deploy service requires a PostgreSQL service instance for persistence (TODO: add resource requirements for the PostgreSQL instance). So, this should first be created by running the following command:
$ cf cs <postgresql-service> <postgresql-service-plan> deploy-service-database
Push the CF MTA deploy service application to Cloud Foundry by running the following command from the com.sap.cloud.lm.sl.cf.web
directory:
$ cf push -f target/manifests/manifest.yml
After the push operation completes then the CF MTA deploy service should be up and running.
In order to use the CF MTA deploy service you should install the CF MTA plugin, so follow the instructions in the Download and installation section there. For the set of supported operations and examples refer to the Usage section. You could use a modified spring-music application, which is extended and adapted to the MTA model.
If you need any support, have any question or have found a bug, please report it in the GitHub bug tracking system. We shall get back to you.
Presentations, documents, and tutorials:
- Managing Distributed Cloud Native Applications Made Easy (CF Summit EU 2017 slides)
- Managing Distributed Cloud Native Applications Made Easy (CF Summit EU 2017 video)
Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.