From 99e5397f29ab2183ce62fbde1ed2541c0ec95953 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Thu, 27 Oct 2016 15:52:06 -0400 Subject: [PATCH] Added instructions for launching tasks with partitions resolves #230 --- .../src/main/asciidoc/batch.adoc | 101 +++++++++++++++--- 1 file changed, 84 insertions(+), 17 deletions(-) diff --git a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc index 07ddd9d8..9305a74c 100644 --- a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc +++ b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc @@ -124,46 +124,113 @@ https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task- === 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 (with a version 1.0.2 or higher): +* When deploying partitioned apps on the Yarn platform be sure to use the +following dependency for the Spring Cloud Yarn Deployer +(with a version 1.0.2 or higher): ``` - - org.springframework.cloud - spring-cloud-starter-deployer-yarn - + + org.springframework.cloud + spring-cloud-starter-deployer-yarn + ``` * Add the following dependency to the dependency management for a transient dependency required by Yarn: ``` - - + + ... - - com.google.guava - guava - 18.0 - - + + com.google.guava + guava + 18.0 + + ... - + ``` * 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. === Notes on developing a batch partitioned app for the Kubernetes platform +* When deploying partitioned apps on the Kubernetes platform be sure to use the +following dependency for the Spring Cloud Kubernetes Deployer: +``` + + org.springframework.cloud + spring-cloud-starter-deployer-kubernetes + +``` -Application name for the task application and its partitions need to follow +* Application name for the task application and its partitions need to follow the following regex pattern `[a-z0-9]([-a-z0-9]*[a-z0-9])`. Else an exception will be thrown. === Notes on developing a batch partitioned app for the Mesos platform +* When deploying partitioned apps on the Mesos platform be sure to use the +following dependency for the Spring Cloud Mesos Deployer: +``` + + org.springframework.cloud + spring-cloud-deployer-mesos + +``` -When configuring the partition handler, do not add any command line arguments to +* When configuring the partition handler, do not add any command line arguments to the `CommandLineArgsProvider`. This is due to Chronos adding the command line args to the Mesos ID. Thus when launching the partition on Mesos this can cause the partition to fail to start if command line arg contains characters such as `/` or `:`. +=== Notes on developing a batch partitioned app for the Cloud Foundry platform +* When deploying partitioned apps on the Cloud Foundry platform be sure to use +the following dependencies for the Spring Cloud Cloud Foundry Deployer: +``` + + org.springframework.cloud + spring-cloud-deployer-cloudfoundry + + + io.projectreactor + reactor-core + 3.0.2.RELEASE + + + io.projectreactor.ipc + reactor-netty + 0.5.1.RELEASE + +``` + +* When configuring the partition handler, Cloud Foundry Deployment +environment variables need to be established so that the partition handler +can start the partitions. The following list shows the required environment +variables: +- spring_cloud_deployer_cloudfoundry_url +- spring_cloud_deployer_cloudfoundry_org +- spring_cloud_deployer_cloudfoundry_space +- spring_cloud_deployer_cloudfoundry_domain +- spring_cloud_deployer_cloudfoundry_username +- spring_cloud_deployer_cloudfoundry_password +- spring_cloud_deployer_cloudfoundry_services +- spring_cloud_deployer_cloudfoundry_taskTimeout + +An example set of deployment environment variables for a partitioned task that +uses a `mysql` database service would look something like this: + +``` +spring_cloud_deployer_cloudfoundry_url=https://api.local.pcfdev.io +spring_cloud_deployer_cloudfoundry_org=pcfdev-org +spring_cloud_deployer_cloudfoundry_space=pcfdev-space +spring_cloud_deployer_cloudfoundry_domain=local.pcfdev.io +spring_cloud_deployer_cloudfoundry_username=admin +spring_cloud_deployer_cloudfoundry_password=admin +spring_cloud_deployer_cloudfoundry_services=mysql +spring_cloud_deployer_cloudfoundry_taskTimeout=300 +``` + +NOTE: When using PCF-Dev the following environment variable is also required: +`spring_cloud_deployer_cloudfoundry_skipSslValidation=true` + [[batch-informational-messages]] == Batch Informational Messages