2

I am using the latest Pivotal Cloud Foundry, i.e version 1.8.

Running cf feature-flags indicates that tasks creation is indeed enabled.

My Spring app is using the latest Spring Cloud Tasks library, i.e. version 1.1.0.RELEASE, and tasks are enabled by @EnableTask annotation.

However, when I cf push the app, it is restarted as if it were treated as a LRP (Long Running Process) and not as a task...

Can someone please help? What I am missing?

edit: The latest version of PWS Cloud Foundry is now: 1.9 but my question remains relevant.

balteo
  • 23,602
  • 63
  • 219
  • 412
  • My question remains... The latest CLI can now run tasks on PWS but the documentation does not state how to `cf push` a task app without it being picked up as a web process... Can someone please help? – balteo Dec 24 '16 at 12:39

2 Answers2

2

Tasks can be created using the API (http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#the-task-object) and from mid-Dec with the cf CLI (cf run-task).

Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
dkoper
  • 1,485
  • 9
  • 10
  • Thanks a lot for the reply. The mid-December `cf run-task` is excellent news! I am still wondering though what the whole process looks like: how do I `cf push` an task app (to be run later on with `cf run-task`) without it being picked up as a LRP? Can you point to the documentation about the `cf run-task`? – balteo Dec 11 '16 at 08:06
  • OK. Regarding the documentation, it seems it is currently being worked by the Pivotal team and will soon be available. – balteo Dec 13 '16 at 11:25
  • **Update:** here is the link to the documentation about running tasks: http://docs.pivotal.io/pivotalcf/1-9/devguide/using-tasks.html – balteo Dec 16 '16 at 12:07
  • **Update**: the latest CLI now allows for task running with `cf run-task APP_NAME COMMAND [--name TASK_NAME]`. However the documentation does not state what command to pass in order to run the java executable (for a batch app for example). I have opened a another question here: http://stackoverflow.com/questions/41313079/ – balteo Dec 24 '16 at 12:09
1

In order to cf push an application without it being picked up as a web/LRP process, one has to pass in the --no-route argument to cf push.

There is a no-route: true equivalent if one uses a manifest.yml.

balteo
  • 23,602
  • 63
  • 219
  • 412