microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 401 forks source link

Spin up a service on demand #940

Open gperrego opened 4 years ago

gperrego commented 4 years ago

I've got a stack overflow asking a question, I can duplicate it here if needed:

https://stackoverflow.com/questions/61731313/should-i-use-a-container-service-fabric-guest-executable-for-a-scheduled-daily-w

It seems like its a mix of two highly requested feature requests:

https://feedback.azure.com/forums/293901-service-fabric/suggestions/13714716-support-scheduled-tasks

and

https://feedback.azure.com/forums/293901-service-fabric/suggestions/13714473-ability-to-stop-disable-services-without-removing

I also see that Vaclav has a "Job Creator" project out there, its title sounds similar but I haven't dug into the code.

Can someone take a look at the stackoverflow and give some guidance?

gperrego commented 4 years ago

Seeing this in 7.1 is a step in the right direction but i'm not sure it solves the problem.

https://docs.microsoft.com/en-us/azure/service-fabric/run-to-completion

gperrego commented 4 years ago

Marco...

craftyhouse commented 3 years ago

As you noted this has been a long time feature request, but unfortunately we still do not have plans to natively support scheduled tasks in the runtime yet.

There are a couple of approaches we've seen(@masnider may chime in more). https://www.dajbych.net/azure-service-fabric-scheduled-tasks or stateless service setup with appropriate instance count such as -1 to run everywhere that would just loop with a delay timer such as Task.Delay(TimeSpan.FromDays(n))

Hope that helps

gperrego commented 3 years ago

unfortunately it really doesn't, but thank you for trying. We are stuck using task scheduler to call one line powershell to tickle the rest APIs via invoke rest method. So now we have to manage the applications in two spots instead of one.