From 3c63196a47757a3ff7d38bf76c444b4399b7e9d6 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Fri, 26 Aug 2016 15:15:34 -0400 Subject: [PATCH] Updated Partition doc and added note on Yarn deployment Changed the note to a subsection of partitioning resolves spring-cloud/spring-cloud-task#196 --- .../src/main/asciidoc/batch.adoc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc index 17f48a0c..512e04f6 100644 --- a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc +++ b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc @@ -80,8 +80,10 @@ public PartitionHandler partitionHandler(TaskLauncher taskLauncher, Map environmentProperties = new HashMap<>(); environmentProperties.put("spring.profiles.active", "worker"); + SimpleEnvironmentVariablesProvider environmentVariablesProvider = new SimpleEnvironmentVariablesProvider(this.environment); + environmentVariablesProvider.setEnvironmentProperties(environmentProperties); + partitionHandler.setEnvironmentVariablesProvider(environmentVariablesProvider); - partitionHandler.setEnvironmentProperties(environmentProperties); partitionHandler.setMaxWorkers(2); return partitionHandler; @@ -107,6 +109,20 @@ public DeployerStepExecutionHandler stepExecutionHandler(JobExplorer jobExplorer } ``` +=== Notes on developing a batch partitioned app for the Yarn platform + +* When deploying partitioned apps on the Yarn platform be sure use the following dependency for the +Spring Cloud Yarn Deployer: +``` + + org.springframework.cloud + spring-cloud-starter-deployer-yarn + +``` +* Also add the following property to your application.properties: `spring.yarn.container.keepContextAlive=false`. +* When setting up environment variables for the partitions in the PartitionHandler it is recommended that you do not +copy the current working environment properties. + [[batch-informational-messages]] == Batch Informational Messages