Parallel deployment is a feature that allows to speed-up the deployment proces by processing multiple MTA modules in parallel. The feature is applicable for standard and blue-green deployment scenarios.
Parallel deployment feature relates to 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 the need of any additional configuration.
-
SAP Help Portal: Modules
To activate the feature:
-
Use
_schema-version
with major version3
, for instance3.1.0
or3.3.0
-
Set the global parameter
enable-parallel-deployments
totrue
...
_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
|
When parallel deployment is activated, all modules are deployed simultaneously. There are cases when a module is dependent on another - for example 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
...
In the current directory you’ll find an example cf app payload modeled to be deployed in parallel in both:
-
development descriptor: mta.yaml
-
deployment descriptor: mtad.yaml
-
extension descriptors
-
enabling parallelization: hello-world-parallel.mtaext
-
disabling parallelization: hello-world-no-parallel.mtaext
-
The example MTA contains 4 modules: hello-world
, hello-world-first
, hello-world-second
and hello-world-third
. 3 of them do 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 the deployment of hello-world
is completed.
In the current directory of the repository, run the command cf deploy
. It will use the existing mtad.yaml
file to 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"...
...
First run the command mbt assemble
to create the MTAR archive from development descriptor mta.yaml
:
$ 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...
Then deploy the assembled MTAR archive:
$ 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...
First run the command mbt build
to create the MTAR archive:
$ 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...
Then deploy the built MTAR archive:
$ 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...
...
$ 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.