Limit number of jobs per workflow

Use this forum to request features. Maybe you'll get lucky!
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Limit number of jobs per workflow

Post by momocampo »

Hi Ghtais,
If you need help to use this script or the webinterface scheduler I can help you, in French :)
;)

B.
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: Limit number of jobs per workflow

Post by Ghtais »

Hi Momocampo, emcodem

I took a brief look today and I have not been able to run the webinterface with your script for my workflow.
It takes the max of available job like as usual. I thing I miss something as It was the first time I run the webinterface.
What I have already done.
  • Decompress webinterface folder in the same folder as FFAstrans
    running Service.exe.
    Open Webinterface with http://localhost:3002/webinterface/ -> it works I see all my workflow.
    Go to schedule Tab and create a new job.
    Set frequency to minute
    Click edit condition and Copy paste your script without forgetting to replace the name of my workflow. Click save
    Check "enable"
now, What I have to do ?
If a click start on my Workflow in FFAstran it starts and takes the 4 job at the same time.

Sorry I'am newbie :)
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Limit number of jobs per workflow

Post by emcodem »

Oh lala @Ghtais, that didnt take a very long time :D thanks for checking out my suggested method.

I just tried (again) and it works for me without a problem. You might probably just have forgotten to "enable" the scheduled job?
As you see, the name of the workflow that i control here is: "Convert Folder".
jobcontrol.png
jobcontrol.png (57.18 KiB) Viewed 7943 times
Also, as you see, the number of running jobs does not decrease (we dont have yet a count for paused jobs, they count as running), but the status line indicates that we have 2 paused and only 1 running job:
jobcontrol2.png
jobcontrol2.png (48.48 KiB) Viewed 7941 times
emcodem, wrapping since 2009 you got the rhyme?
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: Limit number of jobs per workflow

Post by Ghtais »

Hi Emcodem

the job is enable, and the name of the workflow is correct.
I thing that I have only a little part of the code needed.
I have copy/past the line you gave me before in page 1. When I look at your screen just below you have more than 14 lines.
could you please provide the entire code that I have to run ? Or maybe the rest of the code is useless for our purpose :)

bye
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Limit number of jobs per workflow

Post by emcodem »

Oh, thats the problem...
on the first page, i posted a link to an old forum topic with the code that already helped others. Please check again:

viewtopic.php?f=5&t=875&p=5392&hilit=li ... flow#p5387

Sorry that this currently is so complex for you but as said, if this works for you in production, i promise to add an easy to use interface for it in the next webinterface release.
emcodem, wrapping since 2009 you got the rhyme?
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: Limit number of jobs per workflow

Post by Ghtais »

ok, so with the entire code it works, thank you Emcodem :)
FFAstrans continue to take the maximum of job it could but pause all jobs except one.
During the transcode, It gave me some error flashing on the right up corner of the webinterface but I had not enough time to read it. it still finished the workflow anyway.

So thank you Emcodem, it could be a great workaround and I probably will use it with specific workflow. But I still thinking that this feature should be integrated directly in FFAStrans in the same way you can select priority in the workflow parameters tab. It could be very useful en more friendly :)

bye
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Limit number of jobs per workflow

Post by emcodem »

Great that you got it working.
The error that you saw was "error getting queued jobs" or such, a known bug of the current webinterface version. As long as you dont use the webinterface actively you dont have to worry about it but i recommend to upgrade to the next version that comes with along with ffastrans release 1.2...
So again, it might most likely take a very long time until your specific requirement is in ffastrans (multiple years probably). In case you meanwhile use the stuff from webinterface productive, let me know if it works for you and i will most likely quickly come up with an easy to use resource management interface. Sure the final version might be a little smarter than the current one.

Just know that it would be problematic when users interfere and also pause jobs that are controlled by this logic.
emcodem, wrapping since 2009 you got the rhyme?
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: Limit number of jobs per workflow

Post by Ghtais »

you're right I saw "error getting queued jobs" or something like that but as you said the workflow continue without issue :)
For my personal case, I can run the webinterface with the code and I don't need you waste your time to develop an easy to use interface for that purpose.
You said multiple years to see this specific requirement ? For sure I will be there to see that ! :D :D
jerrysub
Posts: 38
Joined: Mon Jun 18, 2018 9:10 am

Re: Limit number of jobs per workflow

Post by jerrysub »

Hi emcodem ,

find below answers:
  • emcodem wrote: Thu Jan 21, 2021 7:02 pm @jerrysub you want to "make sure that at least one job per workflow is running". This seems kind of impossible to do without knowing up in front how much resources each job of the controlled wokflow will require.
    This needs of course to create at least as many slot as workflow if we want 1 job running per workflow. this needs then to be sure that machine is enough powerfull.
  • emcodem wrote: Thu Jan 21, 2021 7:02 pm @jerrysub could you please give us some more insight in what exactly you want to gain?
    my request is to get at least one slot per workflow available in case of urgent needs. even if one slot is not used while other workflow may need one.
    exemple
    "workflow 1" is top priority and needs anytime one slot free
    "workflow 2 to 10" can used rest of slots (obviously we need mini 2 slots).
++
Jerrysub
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Limit number of jobs per workflow

Post by emcodem »

@jerrysub
i think we would work with pause low prio job if a "highest" prio job is coming in... in order to be able to use all available slots at any time.
Anyway, unfortunately it will take some (most likely very long) time until we come up with a sophisticated solution for the different scenarios of prio managemment :D
Thanks for the clarification!
emcodem, wrapping since 2009 you got the rhyme?
Post Reply