Refer users to SCDF to launch tasks
This commit is contained in:
committed by
Mark Pollack
parent
f8fd74e616
commit
1406fa986c
@@ -2,33 +2,11 @@
|
|||||||
[[appendix-cloud-foundry]]
|
[[appendix-cloud-foundry]]
|
||||||
== Running a Task App on Cloud Foundry
|
== Running a Task App on Cloud Foundry
|
||||||
|
|
||||||
This section will discuss how to deploy a Spring Cloud Task application onto
|
The simplest way to launch a Spring Cloud Task application as a task on Cloud Foundry
|
||||||
the Cloud Foundry platform.
|
is to use Spring Cloud Data Flow. Via Spring Cloud Data Flow you can register your task application,
|
||||||
|
create a definition for it and then launch it. You then can track the task execution(s)
|
||||||
|
via a RESTful API, the Spring Cloud Data Flow Shell, or the UI. To learn out to get started installing Data Flow
|
||||||
|
follow the instructions in the
|
||||||
|
https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started[Getting Started]
|
||||||
|
section of the reference documentation. For info on how to register and launch tasks, see the https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#_the_lifecycle_of_a_task[Lifecycle of a Task] documentation.
|
||||||
|
|
||||||
There are 3 steps to deploying your Spring Cloud Task application:
|
|
||||||
|
|
||||||
. We must push your application to the platform using the `cf push command`.
|
|
||||||
This command pushes your jar to the Cloud Foundry platform.
|
|
||||||
|
|
||||||
. We need to stop the application from running once the push is complete.
|
|
||||||
Cloud Foundry has to run the application to stage it. But when Cloud Foundry
|
|
||||||
runs the application at this time it is treating the application as a LRP (Long Running Process)
|
|
||||||
which means once the task is complete it will restart it. This is not the desired
|
|
||||||
behavior for our task, thus we must stop it from running. To stop the LRP execution,
|
|
||||||
we will use the `cf stop` command.
|
|
||||||
|
|
||||||
. We now need to launch our application as a task to do this we will use
|
|
||||||
the `cf run-task` command.
|
|
||||||
|
|
||||||
NOTE: When using the run-task command you have to specify build pack to be used
|
|
||||||
and that is specified in the `command string` enumerated below.
|
|
||||||
|
|
||||||
[source,bash]
|
|
||||||
```
|
|
||||||
$ cf push --health-check-type none -p <location of your jar> <name of your app> --no-route
|
|
||||||
$ cf stop <name of your app>
|
|
||||||
$ cf run-task <name of your app> <command string>
|
|
||||||
```
|
|
||||||
|
|
||||||
For further examples and how to's on using the Cloud Foundry CLI click
|
|
||||||
https://docs.cloudfoundry.org/cf-cli/getting-started.html[here].
|
|
||||||
Reference in New Issue
Block a user