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.
-
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 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
...
In the current directory you’ll find example cf app payload modelled 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
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.
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"...
...
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...
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...
...
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.