Can Jug be used at runtime / without the jug shell?

7 views
Skip to first unread message

Vincentius Kevin

unread,
Dec 14, 2018, 3:29:28 AM12/14/18
to jug-users
Hi, I have this question: is it possible to use jug without the jug shell, i.e. add tasks dynamically at runtime on demand?

I couldn't find this in the documentation so far.

I want to have a GUI and whenever a user does something, a new set of tasks should be started or queued and can be executed in a computer cluster.

Thanks!
Kevin

Renato Alves

unread,
Dec 14, 2018, 3:43:27 AM12/14/18
to jug-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Vicentius,

Jug isn't a task daemon nor a task queue, in that sense you question is a little confusing.

Jug evaluates how much work is to be done when it starts (i.e. 'jug execute').
Once executing the task list isn't refreshed until completion.

However, nothing prevents you from running another 'jug execute' on a separate shell.
If at that point additional tasks exist, the new jug process will see this and queue all tasks that have not been completed (old and new).
The older jug process will not update and will continue working until all older tasks are complete (or an error occurs, depending on configuration).

What constitutes a 'task' depends your the contents of your jug/python script.

Hope this helps,
Renato
> --
> You received this message because you are subscribed to the Google Groups "jug-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jug-users+...@googlegroups.com <mailto:jug-users+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEErWzyn8km9Qx1yUkopwPBKi+mXQQFAlwTbSwACgkQpwPBKi+m
XQTWgRAAlscCSWMDh9pgxENzeMZyb/nCX6S8280st+0dXfXa7Nbiv8sAv+/jJzxG
EDuWEuCZl2OJ5DVHmToles+xcFNTne9npfdIM6BDeT7rzoQadMGlWxSk9MrpsoF2
XPr/jPV7gRMtHDL9c+d7hKI0EgUfAnKZODo77zbwXz+SLViQ09B8B860+okUFS1D
8k5i+LE+wuJS0UWFsZJ3tCeLmhWREEL/nV9jUtcssmQHZ7eJTELuWEQn9JD0U6sy
uaEg4IBe1Ay+XVcOonOV7I+2biGbZLkP7aKiMdznP7u4CmkmYgxPEe/QPTIUN2O+
0XtJtxHdVYqLUhelCJnjXyyh3ggVYpfe7lsi1M6tz97fsiRNtxUv9M7MPEh87vHU
t+OHwK0xn2Vbwwd6poah5rijsIcqbSvPvdmyrGqxqzlb6b5lvje/S2+3yJEXCCWh
G7ogbHuji0Nw+Jx9vdpLHg9FwgDD/cG0QjpkJleoJU04o/ceNC+vz2pfSL2s1VFN
L+GN6cR5Kfs7sjdbpuZ8NOWccECBwotUtlfptBPspFO9Av1ecW6yeaEPD4qKfPti
56wOYu7iHmdVCsBvewFIxGz5j13oKnmPdc9JysfeyelOgfuq0BSdvojsXf4uFmAG
GpDDVZwPW2quwa3FvW0Q0yxwO4qjTZ3WeeAbV21CdLbFfZapCUo=
=xrs7
-----END PGP SIGNATURE-----

Nicht Jens

unread,
Dec 16, 2018, 11:34:33 AM12/16/18
to jug-...@googlegroups.com
Hi Kevin,

What you probably want to achieve doesn't seem too hard to implement.

I would basically separate GUI and task creation from the actual jug
code that works on these tasks.

So, for instance:

1) Set up the jug worker script in such a way that it takes some kind of
command line input. This could be a file name or some other set of
parameters that define what should be worked on. You can use argparse
for handling the command line parameters ... (Alternatively, you could
read config files here.)

2) Write your GUI such that the parameters that the jug script takes are
selectable. Generate jug shell commands with the selected parameters.
Run those with subprocess.Popen(). (Alternatively, you could run jug
periodically on all config files that were created using 1) and delete
those that are done.)

Note: The config-file method might be nice since you could always run
the accumulated config files later, for instance, during the night when
your computer is not used anyway. This would be a very simple way to
queue up jobs that are submitted later. I have no idea if that is useful
in your case, though. Maybe you have a queuing system available that
allows you to just submit jobs...

Hope that helps,
Sven



On 12/14/18 9:05 AM, Vincentius Kevin wrote:
Reply all
Reply to author
Forward
0 new messages