Skip to content

Latest commit

 

History

History
128 lines (102 loc) · 5.61 KB

README.adoc

File metadata and controls

128 lines (102 loc) · 5.61 KB

Parallel deployment

Parallel deployment is a feature that allows to speed-up the deploy proces by processing multiple MTA modules in parallel. The feature is applicable either for standard and blue-green deployment scenarios.

Parallel deployment feature concerns SAP Business Technology Platform entities that are represented by MTA modules - applications and application contents.

The feature does not relate to entities represented by MTA resources, for instance Cloud Foundry services. By default Cloud Foundry servicecs are processed in parallel without need of any additional configuration.

Official Documentation

Activation

To activate the feature:

  • Use _schema-version with major version 3, for instance 3.1.0 or 3.3.0

  • Set the global parameter enable-parallel-deployments to true

...
_schema-version: 3.3.0
ID: hello-world
version: 1.0.0
parameters:
  enable-parallel-deployments: true
...
Note
Setting up the value of enable-parallel-deployments can be done in the mta.yaml, mtad.yaml or via an additional extension descriptor (*.mtaext) passed during deployment

Deployment order

When parallel deployment is activated, all modules are deployed simultaineously. There are cases when a module has a dependency to another - e.g. the module initializing the database should be deployed before the others consuming that same database.

The module element deployed-after should be used to declare that dependency and influence the order of behavior:

...
modules:
...
- name: hello-world
...

- name: hello-world-third
  deployed-after:
      - hello-world
...

Try it out

In the current directory you’ll find example cf app payload modelled to be deployed in parallel in both

The example MTA contains 4 modules hello-world, hello-world-first, hello-world-second and hello-world-third where 3 of them does not have any dependency order and will be processed in parallel accordingly. Only hello-world-third depends on hello-world, so it will be processed after hello-world is completed.

Deploy directly from directory

In the current directory of the repository, run cf deploy that will use mtad.yaml. This will automatically assemble an MTA archive and deploy it

$cf deploy
Deploying multi-target app archive ~/mta-examples/hello-world.mtar in org ****** / space ****** as ******...
...
Updating application "hello-world-second"...
Updating application "hello-world"...
Uploading application "hello-world-second"...
...

Assemble MTA archive via mtad.yaml and deploy

First use mbt assemble to create the *.mtar from development descritpror mta.yaml and than deploy it with cf deploy.

$ mbt assemble
  INFO assembling the MTA project...
  INFO copying the MTA content...
  INFO generating the metadata...
  INFO generating the MTA archive...
  INFO the MTA archive generated at: /mta_examples/parallel-deployment/mta_archives/hello-world_1.0.0.mtar
  INFO cleaning temporary files...

$ cf deploy mta_archives/hello-world_1.0.0.mtar
  Deploying multi-target app archive mta_archives/hello-world_1.0.0.mtar in org ****** / space ****** as ******...
  Uploading 1 files...

Build MTA archive via mta.yaml and deploy

First use mbt build to create the *.mtar and than deploy it with cf deploy.

$ mbt build
  INFO generating the "Makefile_20191029153016.mta" file...
  INFO done
  INFO executing the "make -f Makefile_20191029153016.mta p=cf mtar= strict=true mode=" command...
  INFO validating the MTA project
  INFO validating the MTA project
  INFO building the "hello-world" module...
  INFO the build results of the "hello-world" module will be packed and saved in the "/mta_examples/parallel-deployment/.parallel-deployment_mta_build_tmp/hello-world" folder
  INFO building the "hello-world-first" module...
  INFO the build results of the "hello-world-first" module will be packed and saved in the "/mta_examples/parallel-deployment/.parallel-deployment_mta_build_tmp/hello-world-first" folder
  INFO building the "hello-world-second" module...
  INFO the build results of the "hello-world-second" module will be packed and saved in the "/mta_examples/parallel-deployment/.parallel-deployment_mta_build_tmp/hello-world-second" folder
  INFO building the "hello-world-third" module...
  INFO the build results of the "hello-world-third" module will be packed and saved in the "mta_examples/parallel-deployment/.parallel-deployment_mta_build_tmp/hello-world-third" folder
  INFO generating the metadata...
  INFO generating the MTA archive...
  INFO the MTA archive generated at: /mta_examples/parallel-deployment/mta_archives/hello-world_1.0.0.mtar
  INFO cleaning temporary files...

$ cf deploy mta_archives/hello-world_1.0.0.mtar
  Deploying multi-target app archive mta_archives/hello-world_1.0.0.mtar in org ***** / space ****** as ******...
  Uploading 1 files...
  ...

Enable/disable parallel deployments with extension descriptors using created *.mtar file

cf deploy mta_archives/hello-world_1.0.0.mtar -e hello-world-parallel.mtaext
cf deploy mta_archives/hello-world_1.0.0.mtar -e hello-world-no-parallel.mtaext

Note the processing of the MTA in the command output of both commands.