Skip to content

Commit 3695ed7

Browse files
committed
Remove Remote partitioning from docs
Remove remnants of SC-Deployer from poms
1 parent eac3c9f commit 3695ed7

File tree

8 files changed

+1
-267
lines changed

8 files changed

+1
-267
lines changed

docs/modules/ROOT/pages/batch.adoc

Lines changed: 1 addition & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
--
77
This section goes into more detail about Spring Cloud Task's integration with Spring
88
Batch. Tracking the association between a job execution and the task in which it was
9-
executed as well as remote partitioning through Spring Cloud Deployer are covered in
10-
this section.
9+
executed.
1110

1211
--
1312

@@ -53,143 +52,6 @@ NOTE: You can find a sample batch application in the samples module of the Sprin
5352
Task Project,
5453
https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/batch-job[here].
5554

56-
57-
[[batch-partitioning]]
58-
== Remote Partitioning
59-
60-
Spring Cloud Deployer provides facilities for launching Spring Boot-based applications on
61-
most cloud infrastructures. The `DeployerPartitionHandler` and
62-
`DeployerStepExecutionHandler` delegate the launching of worker step executions to Spring
63-
Cloud Deployer.
64-
65-
To configure the `DeployerStepExecutionHandler`, you must provide a `Resource`
66-
representing the Spring Boot Uber-jar to be executed, a `TaskLauncherHandler`, and a
67-
`JobExplorer`. You can configure any environment properties as well as the max number of
68-
workers to be executing at once, the interval to poll for the results (defaults to 10
69-
seconds), and a timeout (defaults to -1 or no timeout). The following example shows how
70-
configuring this `PartitionHandler` might look:
71-
72-
NOTE: This feature is now end-of-life and will be removed in a future release.
73-
74-
[source,java]
75-
----
76-
@Bean
77-
public PartitionHandler partitionHandler(TaskLauncher taskLauncher,
78-
JobExplorer jobExplorer) throws Exception {
79-
80-
MavenProperties mavenProperties = new MavenProperties();
81-
mavenProperties.setRemoteRepositories(new HashMap<>(Collections.singletonMap("springRepo",
82-
new MavenProperties.RemoteRepository(repository))));
83-
84-
Resource resource =
85-
MavenResource.parse(String.format("%s:%s:%s",
86-
"io.spring.cloud",
87-
"partitioned-batch-job",
88-
"1.1.0.RELEASE"), mavenProperties);
89-
90-
DeployerPartitionHandler partitionHandler =
91-
new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, "workerStep");
92-
93-
List<String> commandLineArgs = new ArrayList<>(3);
94-
commandLineArgs.add("--spring.profiles.active=worker");
95-
commandLineArgs.add("--spring.cloud.task.initialize.enable=false");
96-
commandLineArgs.add("--spring.batch.initializer.enabled=false");
97-
98-
partitionHandler.setCommandLineArgsProvider(
99-
new PassThroughCommandLineArgsProvider(commandLineArgs));
100-
partitionHandler.setEnvironmentVariablesProvider(new NoOpEnvironmentVariablesProvider());
101-
partitionHandler.setMaxWorkers(2);
102-
partitionHandler.setApplicationName("PartitionedBatchJobTask");
103-
104-
return partitionHandler;
105-
}
106-
----
107-
108-
NOTE: When passing environment variables to partitions, each partition may
109-
be on a different machine with different environment settings.
110-
Consequently, you should pass only those environment variables that are required.
111-
112-
Notice in the example above that we have set the maximum number of workers to 2.
113-
Setting the maximum of workers establishes the maximum number of
114-
partitions that should be running at one time.
115-
116-
The `Resource` to be executed is expected to be a Spring Boot Uber-jar with a
117-
`DeployerStepExecutionHandler` configured as a `CommandLineRunner` in the current context.
118-
The repository enumerated in the preceding example should be the remote repository in
119-
which the Spring Boot Uber-jar is located. Both the manager and worker are expected to have visibility
120-
into the same data store being used as the job repository and task repository. Once the
121-
underlying infrastructure has bootstrapped the Spring Boot jar and Spring Boot has
122-
launched the `DeployerStepExecutionHandler`, the step handler executes the requested
123-
`Step`. The following example shows how to configure the `DeployerStepExecutionHandler`:
124-
125-
[source,java]
126-
----
127-
@Bean
128-
public DeployerStepExecutionHandler stepExecutionHandler(JobExplorer jobExplorer) {
129-
DeployerStepExecutionHandler handler =
130-
new DeployerStepExecutionHandler(this.context, jobExplorer, this.jobRepository);
131-
132-
return handler;
133-
}
134-
----
135-
136-
NOTE: You can find a sample remote partition application in the samples module of the
137-
Spring Cloud Task project,
138-
https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/partitioned-batch-job[here].
139-
140-
[[asynchronously-launch-remote-batch-partitions]]
141-
=== Asynchronously launch remote batch partitions
142-
143-
By default batch partitions are launched sequentially. However, in some cases this may affect performance as each launch will block until the resource (For example: provisioning a pod in Kubernetes) is provisioned.
144-
In these cases you can provide a `ThreadPoolTaskExecutor` to the `DeployerPartitionHandler`. This will launch the remote batch partitions based on the configuration of the `ThreadPoolTaskExecutor`.
145-
For example:
146-
147-
[source,java]
148-
----
149-
@Bean
150-
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
151-
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
152-
executor.setCorePoolSize(4);
153-
executor.setThreadNamePrefix("default_task_executor_thread");
154-
executor.setWaitForTasksToCompleteOnShutdown(true);
155-
executor.initialize();
156-
return executor;
157-
}
158-
159-
@Bean
160-
public PartitionHandler partitionHandler(TaskLauncher taskLauncher, JobExplorer jobExplorer,
161-
TaskRepository taskRepository, ThreadPoolTaskExecutor executor) throws Exception {
162-
Resource resource = this.resourceLoader
163-
.getResource("maven://io.spring.cloud:partitioned-batch-job:2.2.0.BUILD-SNAPSHOT");
164-
165-
DeployerPartitionHandler partitionHandler =
166-
new DeployerPartitionHandler(taskLauncher, jobExplorer, resource,
167-
"workerStep", taskRepository, executor);
168-
...
169-
}
170-
----
171-
172-
NOTE: We need to close the context since the use of `ThreadPoolTaskExecutor` leaves a thread active thus the app will not terminate. To close the application appropriately, we will need to set `spring.cloud.task.closecontextEnabled` property to `true`.
173-
174-
175-
[[notes-on-developing-a-batch-partitioned-application-for-the-kubernetes-platform]]
176-
=== Notes on Developing a Batch-partitioned application for the Kubernetes Platform
177-
178-
* When deploying partitioned apps on the Kubernetes platform, you must use the following
179-
dependency for the Spring Cloud Kubernetes Deployer:
180-
+
181-
[source,xml]
182-
----
183-
<dependency>
184-
<groupId>org.springframework.cloud</groupId>
185-
<artifactId>spring-cloud-starter-deployer-kubernetes</artifactId>
186-
</dependency>
187-
----
188-
* The application name for the task application and its partitions need to follow
189-
the following regex pattern: `[a-z0-9]([-a-z0-9]*[a-z0-9])`.
190-
Otherwise, an exception is thrown.
191-
192-
19355
[[batch-informational-messages]]
19456
== Batch Informational Messages
19557

docs/modules/ROOT/pages/stream.adoc

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,6 @@ be useful for more complex processing and orchestration. This section
88
covers the integration options for Spring Cloud Task with Spring Cloud Stream.
99
--
1010

11-
[[stream-integration-launching-sink]]
12-
== Launching a Task from a Spring Cloud Stream
13-
14-
You can launch tasks from a stream. To do so, create a sink that listens for a message
15-
that contains a `TaskLaunchRequest` as its payload. The `TaskLaunchRequest` contains:
16-
17-
* `uri`: To the task artifact that is to be executed.
18-
* `applicationName`: The name that is associated with the task. If no
19-
applicationName is set, the `TaskLaunchRequest` generates a task name
20-
comprised of the following: `Task-<UUID>`.
21-
* `commandLineArguments`: A list containing the command line arguments for the task.
22-
* `environmentProperties`: A map containing the environment variables to be used by the
23-
task.
24-
* `deploymentProperties`: A map containing the properties that are used by the deployer to
25-
deploy the task.
26-
27-
NOTE: If the payload is of a different type, the sink throws an exception.
28-
29-
For example, a stream can be created that has a processor that takes in data from an
30-
HTTP source and creates a `GenericMessage` that contains the `TaskLaunchRequest` and sends
31-
the message to its output channel. The task sink would then receive the message from its
32-
input channel and then launch the task.
33-
34-
To create a taskSink, you need only create a Spring Boot application that includes the
35-
`EnableTaskLauncher` annotation, as shown in the following example:
36-
37-
[source,java]
38-
----
39-
@SpringBootApplication
40-
@EnableTaskLauncher
41-
public class TaskSinkApplication {
42-
public static void main(String[] args) {
43-
SpringApplication.run(TaskSinkApplication.class, args);
44-
}
45-
}
46-
----
47-
48-
The https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples[samples
49-
module] of the Spring Cloud Task project contains a sample Sink and Processor. To install
50-
these samples into your local maven repository, run a maven build from the
51-
`spring-cloud-task-samples` directory with the `skipInstall` property set to `false`, as
52-
shown in the following example:
53-
54-
`mvn clean install`
55-
56-
NOTE: The `maven.remoteRepositories.springRepo.url` property must be set to the location
57-
of the remote repository in which the Spring Boot Uber-jar is located. If not set, there is no remote
58-
repository, so it relies upon the local repository only.
59-
60-
NOTE: This feature is now end-of-life and will be removed in a future release.
61-
62-
6311
[[stream-integration-events]]
6412
== Spring Cloud Task Events
6513

pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@
6161
<type>pom</type>
6262
<scope>import</scope>
6363
</dependency>
64-
<dependency>
65-
<groupId>org.springframework.cloud</groupId>
66-
<artifactId>spring-cloud-deployer-dependencies</artifactId>
67-
<version>${spring-cloud-deployer.version}</version>
68-
<type>pom</type>
69-
<scope>import</scope>
70-
</dependency>
71-
<dependency>
72-
<groupId>org.springframework.cloud</groupId>
73-
<artifactId>spring-cloud-deployer-local</artifactId>
74-
<version>${spring-cloud-deployer-local.version}</version>
75-
<scope>test</scope>
76-
</dependency>
7764
<dependency>
7865
<groupId>org.springframework.cloud</groupId>
7966
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
@@ -110,9 +97,6 @@
11097
<properties>
11198

11299
<spring-cloud-stream.version>5.0.0-SNAPSHOT</spring-cloud-stream.version>
113-
<spring-cloud-deployer.version>2.9.1</spring-cloud-deployer.version>
114-
<spring-cloud-deployer-local.version>2.9.1
115-
</spring-cloud-deployer-local.version>
116100
<spring-cloud-stream-binder-rabbit.version>${spring-cloud-stream.version}
117101
</spring-cloud-stream-binder-rabbit.version>
118102
<jakarta-ee-api.version>10.0.0</jakarta-ee-api.version>

spring-cloud-task-batch/pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@
2020
<groupId>org.springframework.cloud</groupId>
2121
<artifactId>spring-cloud-task-core</artifactId>
2222
</dependency>
23-
<dependency>
24-
<groupId>org.springframework.cloud</groupId>
25-
<artifactId>spring-cloud-deployer-spi</artifactId>
26-
<optional>true</optional>
27-
<exclusions>
28-
<exclusion>
29-
<artifactId>spring-core</artifactId>
30-
<groupId>org.springframework</groupId>
31-
</exclusion>
32-
</exclusions>
33-
</dependency>
34-
<dependency>
35-
<groupId>org.springframework.cloud</groupId>
36-
<artifactId>spring-cloud-deployer-resource-support</artifactId>
37-
<optional>true</optional>
38-
</dependency>
3923
<dependency>
4024
<groupId>org.springframework.boot</groupId>
4125
<artifactId>spring-boot-batch</artifactId>

spring-cloud-task-core/pom.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@
2323
<groupId>org.springframework.boot</groupId>
2424
<artifactId>spring-boot-sql</artifactId>
2525
</dependency>
26-
<dependency>
27-
<groupId>org.springframework.cloud</groupId>
28-
<artifactId>spring-cloud-deployer-autoconfigure</artifactId>
29-
</dependency>
30-
<dependency>
31-
<groupId>org.springframework.cloud</groupId>
32-
<artifactId>spring-cloud-deployer-resource-support</artifactId>
33-
</dependency>
34-
<dependency>
35-
<groupId>org.springframework.cloud</groupId>
36-
<artifactId>spring-cloud-deployer-resource-maven</artifactId>
37-
<optional>true</optional>
38-
</dependency>
3926
<dependency>
4027
<groupId>org.springframework</groupId>
4128
<artifactId>spring-jdbc</artifactId>

spring-cloud-task-integration-tests/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@
5454
<artifactId>spring-batch-core</artifactId>
5555
<scope>test</scope>
5656
</dependency>
57-
<dependency>
58-
<groupId>org.springframework.cloud</groupId>
59-
<artifactId>spring-cloud-deployer-resource-support</artifactId>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.springframework.cloud</groupId>
63-
<artifactId>spring-cloud-deployer-spi</artifactId>
64-
<scope>test</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>org.springframework.cloud</groupId>
68-
<artifactId>spring-cloud-deployer-local</artifactId>
69-
<scope>test</scope>
70-
</dependency>
7157
<dependency>
7258
<groupId>org.springframework.cloud</groupId>
7359
<artifactId>spring-cloud-task-batch</artifactId>

spring-cloud-task-stream/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@
2929
<artifactId>spring-cloud-stream</artifactId>
3030
<optional>true</optional>
3131
</dependency>
32-
<dependency>
33-
<groupId>org.springframework.cloud</groupId>
34-
<artifactId>spring-cloud-deployer-spi</artifactId>
35-
<exclusions>
36-
<exclusion>
37-
<groupId>org.springframework</groupId>
38-
<artifactId>spring-core</artifactId>
39-
</exclusion>
40-
</exclusions>
41-
</dependency>
4232
<dependency>
4333
<groupId>org.springframework.cloud</groupId>
4434
<artifactId>spring-cloud-task-core</artifactId>
@@ -64,11 +54,6 @@
6454
<artifactId>spring-cloud-task-batch</artifactId>
6555
<scope>test</scope>
6656
</dependency>
67-
<dependency>
68-
<groupId>org.springframework.cloud</groupId>
69-
<artifactId>spring-cloud-deployer-resource-support</artifactId>
70-
<optional>true</optional>
71-
</dependency>
7257
<dependency>
7358
<groupId>com.h2database</groupId>
7459
<artifactId>h2</artifactId>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
org.springframework.cloud.task.listener.TaskEventAutoConfiguration
22
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration
3-
org.springframework.cloud.deployer.autoconfigure.ResourceLoadingAutoConfiguration
4-

0 commit comments

Comments
 (0)