You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: using-tasks.html.md.erb
+39-23Lines changed: 39 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ Tasks are used to perform one-off jobs. For example, you can use a task to:
34
34
The life-cycle of a task is:
35
35
36
36
1. A user initiates a task in Cloud Foundry. A user can initiate a task in CF by using one of the following mechanisms:
37
-
* `cf run-task APPNAME TASK` command
38
-
* Cloud Controler v3 API call. See the [Tasks](http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#tasks) API reference page.
39
-
* Cloud Foundry Java Client. See
37
+
* `cf run-task APPNAME TASK` command. See
38
+
* Cloud Controller v3 API call. See the [Tasks](http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#tasks) API reference page.
39
+
* Cloud Foundry Java Client. See [Cloud Foundry Java Client Library](../buildpacks/java/java-client.html) and [Cloud Foundry Java Client](https://github.com/cloudfoundry/cf-java-client).
40
40
41
41
1. Cloud Foundry creates container specifically for the task.
42
42
1. Cloud Foundry runs the task on the container using the value provided to the `cf run-task` command
@@ -56,45 +56,61 @@ The life-cycle of a task is:
56
56
* A syslog drain attached to an app will receive task log output
57
57
* Stdout/stderr from the task will be available on the app’s firehose logs
58
58
59
-
## <aid='run-task'></a> Managing Tasks
59
+
## <aid='manage-tasks'></a> Managing Tasks
60
60
61
-
* Admins can use the CAPI API to view all the tasks that are running in and org or space. (link to API docs)
62
-
* Admins can set memory usage on a global level (link)
63
-
64
-
Tasks have the following states:
61
+
* Admins can use the Cloud Controller v3 API to view all the tasks that are running in an org or space. See http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#list-tasks
65
62
66
-
* RUNNING: the task is currently in progress.
67
-
* FAILED: the task did not complete. This state occurs when a task does not work correctly or a user cancels the task.
68
-
* SUCCEEDED: the task completed successfully.
69
-
70
-
* To re-execute a task, you must create it as a new task.
71
-
* A task is cancellable
63
+
* Admins can set memory usage on a global level (link)
72
64
73
-
### CF CLI Support
65
+
##<aid='run-tasks'></a> Running Tasks
74
66
75
67
You can use the cf CLI to run a task in the context of an application.
76
68
69
+
<pclass="note"><strong>Note</strong>: To run tasks with the cf CLI, you must install the cf CLI v6.23 (?) or later. See the <ahref="../cf-cli/install-go-cli.html">Installing the Cloud Foundry Command Line Interface</a> topic for information about downloading, installing, and uninstalling the cf CLI.</p>
77
70
71
+
To run a task on an application, first push your application. Then use the `cf run-task APPNAME TASK` command on your deployed application. For example:
78
72
73
+
<preclass="terminal">
74
+
$ cf run-task my-app "bin/rails db:migrate"
75
+
Creating task for app my-app in org jdoe-org / space development as [email protected]...
76
+
OK
77
+
Task 1 has been submitted successfully for execution.
78
+
</pre>
79
79
80
+
To re-run a task, you must create it as a new task.
80
81
81
-
To support running and managing tasks, the cf CLI supports the following commands:
82
+
## <aid='list-tasks'></a> Listing Tasks
83
+
84
+
Tasks have the following states:
82
85
83
-
<table>
86
+
<tableclass="nice" border="1">
87
+
<tr>
88
+
<th>State</th>
89
+
<th>Description</th>
90
+
</tr>
84
91
<tr>
85
-
<td>run-task</td>
86
-
<td>Run a one-off task on an app</td>
92
+
<td>RUNNING</td>
93
+
<td>The task is currently in progress.</td>
87
94
</tr>
88
95
<tr>
89
-
<td>tasks</td>
90
-
<td>List tasks of an app</td>
96
+
<td>FAILED</td>
97
+
<td>The task did not complete. This state occurs when a task does not work correctly or a user cancels the task.</td>
91
98
</tr>
92
99
<tr>
93
-
<td>terminate-task</td>
94
-
<td>Terminate a running task of an app</td>
100
+
<td>SUCCEEDED</td>
101
+
<td>The task completed successfully.</td>
95
102
</tr>
96
103
</table>
97
104
105
+
## <aid='cancel-task'></a>
106
+
107
+
* A task is cancellable
108
+
109
+
110
+
To support running and managing tasks, the cf CLI supports the following commands:
111
+
112
+
113
+
98
114
* <strong>Comment</strong> I think it would be nice to include more how tasks are run. Is there a queue? Is the task run in a separate container?
99
115
* provide "architectural" information about how tasks work. For example, are they run in a separate container.
0 commit comments