Wednesday, February 28, 2018

PCF Tasks basics


What is a task
A tasks is an app whose code is part of the deployed artifact, but runs independently in its own container.

Characteristics: 
  • Uses minimal resources. 
  • CF destroys the container once it has completed running. 
Sample tasks:
  • Migrating a database. 
  • Running a batch script. 
  • Process images
  • Upload or backup data. 
  • Send mail 

How can you run a task:

Cf run-task APPNAME “TASK”

Life cycle of a task
  • CF cli calls run-task
  • CC creates a container for the task
  • CF runs the task on the container
  • CF destroys the container. 

Listing all the tasks: 
Cf tasks <app-name>

Cancelling a task: 
Cf terminate-task <my-app> 2

1 comment: