Skip to content

Multi-Target Application (MTA) deployment service for Cloud Foundry

License

Notifications You must be signed in to change notification settings

ddonchev/cf-mta-deploy-service

 
 

Repository files navigation

cf-mta-deploy-service Build Status

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.

Components

com.sap.cloud.lm.sl.cf.api

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

com.sap.cloud.lm.sl.cf.core

Contains the domain model, persistence and other core services and utilities.

com.sap.cloud.lm.sl.cf.client

Extends the Java Client Library for Cloud Foundry with additional domain model objects and attributes, OAuth token providers and retrying functionality.

com.sap.cloud.lm.sl.cf.process

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.

com.sap.cloud.lm.sl.cf.web

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.

Configuration

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.

Building

Prerequisites

All components are built with Java 8 and Apache Maven.

Compiling and Packaging

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.

Running

Prerequisites

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 application

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.

Usage via CF MTA plugin

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.

How to obtain support

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.

Further reading

Presentations, documents, and tutorials:

License

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.

About

Multi-Target Application (MTA) deployment service for Cloud Foundry

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.0%
  • Other 1.0%