1
votes

I have been trying to schedule spring cloud task via PCF scheduler, however I can't create a job from the app/task (following this documentation on the site - http://docs.pivotal.io/pcf-scheduler/1-1/using-jobs.html)

  1. $ cf apps
    name requested state instances memory disk urls
    cloud-task stopped 0/1 750M 1G

  2. $ cf services
    name service plan bound apps last operation
    my-scheduler scheduler-for-pcf standard cloud-task create succeeded

  3. $ cf create-job cloud-task my-task-job ".java-buildpa ck/open_jdk_jre/bin/java org.springframework.boot.loader.JarLauncher"

Creating job ←[33;1mmy-task-job←[0m for ←[33;1mcloud-task←[0m with command ←[33;1m.java-buildpack/open_jdk_jre/bin/java org.springframework.boot.loade r.JarLauncher←[0m in org ←[33;1mglobal-sales-marketing-customer-experience←[0m / space ←[33;1m141349-dev←[0m as ←[33;1mzzh1bb←[0m ←[31;1mFAILED←[0m The requested resource was not found. Not Found You must create an instance of the scheduler service in this space to use the scheduler service.

Not sure why the job creation command is not able to find the instance of scheduler service - Am I missing something here ?

Also, wondering if there is anything in spring-clould-data-flow that can schedule tasks.

1

1 Answers

1
votes

From the output you should be able to create a job in that org/space.

Does the user (zzh1bb?) have SpaceDeveloper privileges? SpaceAdmin should also be sufficient.

Does a cf task execute successfully using:

cf run-task cloud-task ".java-buildpack/open_jdk_jre/bin/java org.springframework.boot.loader.JarLauncher"

And seeing results with:

cf tasks cloud-task

Another diagnostic step might be to check the output of the api calls described here: http://docs.pivotal.io/pcf-scheduler/1-1/api/#create-job

What version of PCF are you using and what version of the Scheduler for PCF are you using? There were significant changes in the cloud controller api between 1.10, 1.11 and 1.12 that prevent the scheduler service from working across all of those versions.

As far as scheduling SCDF, the Scheduler for PCF service can be used in conjunction with SCDF to allow you to call the task execution endpoint from a Schedeler for PCF call (https://docs.pivotal.io/pcf-scheduler/1-1/using-calls.html).

Call SCDF using the execution endpoint

http://...scdf server.../tasks/executions?name=taskA

doc'ed here:

https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#_launching_a_task_2

This is very useful and convenient especially when creating the SCDF service and the Scheduler for PCF service in the same space.