Commit Graph

63 Commits

Author SHA1 Message Date
Johannes Zellner aae79db27a Mention that we use task types also in the dashboard 2020-09-02 17:06:25 +02:00
Johannes Zellner 6a781c62ec Improve task progress values
0: not yet handled
1: queued
2: started
100: finished
2020-08-19 16:58:53 +02:00
Girish Ramakrishnan 3507269321 Allow mail server name to be configurable
Fixes #721
2020-08-17 21:49:59 -07:00
Girish Ramakrishnan c4101a62ed rename function to setupDnsAndCert
this way, we can reuse this logic for the mail domain as well
2020-08-17 16:18:48 -07:00
Girish Ramakrishnan d1e14ed691 rename function to setupDashboarDnsAndCert 2020-08-17 15:42:15 -07:00
Girish Ramakrishnan 7039108438 pass memory limit as argument to starttask.sh 2020-08-10 21:53:07 -07:00
Girish Ramakrishnan b1b6f70118 Kill all tasks on shutdown and startup
BindsTo will kill all the tasks when systemctl stop box is executed.
But when restarted, it keeps the tasks running. Because of this behavior,
we kill the tasks on startup and stop of the box code.
2020-08-06 23:47:40 -07:00
Girish Ramakrishnan 2112c7d096 sudo: remove the nice support 2020-08-06 16:44:35 -07:00
Girish Ramakrishnan ac63d00c93 run tasks as separate cgroup via systemd
this allows us to adjust the nice value and memory settings per task

part of #691
2020-08-06 16:43:14 -07:00
Girish Ramakrishnan e04871f79f pass log file as argument to task worker
initially, i thought i can hardcode the log file into taskworker.js
depending on the task type but for apptask, it's not easy to get the
appId from the taskId unless we introspect task arguments as well.
it's easier for now to pass it as an argument.
2020-08-05 00:46:34 -07:00
Girish Ramakrishnan 887cbb0b22 make percent non-zero 2019-12-18 09:33:44 -08:00
Girish Ramakrishnan ffeb484a10 No need to return args as part of task.get
This reverts commit 831e22b4ff.
This reverts commit 6774514bd2.
2019-12-06 08:42:49 -08:00
Girish Ramakrishnan 30eccfb54b Use BoxError instead of Error in all places
This moves everything other than the addon code and some 'done' logic
2019-12-04 11:02:54 -08:00
Girish Ramakrishnan 6774514bd2 Return args as part of task.get
the ui needs this to repair any failed app task
2019-11-23 18:06:33 -08:00
Johannes Zellner 2e94600afe Don't set 'Starting ...' as initial task progress message
This is confusing for tasks like "stop" as it will say "Starting ..."
2019-11-22 13:54:43 +01:00
Girish Ramakrishnan 9b4d43075e Fix some typos 2019-10-24 14:34:10 -07:00
Girish Ramakrishnan a017af41c5 Start moving db code to use BoxError as well 2019-10-24 14:09:53 -07:00
Girish Ramakrishnan df142994a8 Move TaskError into BoxError 2019-10-22 21:03:47 -07:00
Girish Ramakrishnan be5290c5ca Add error code for timeout 2019-10-11 19:54:15 -07:00
Girish Ramakrishnan 34c53694a0 Add timeout option when starting task
Part of #649
2019-10-11 19:13:39 -07:00
Girish Ramakrishnan 4d6d768be1 Append apptask logs 2019-10-03 12:20:15 -07:00
Girish Ramakrishnan bd1fbc4a05 typo 2019-09-05 11:42:32 -07:00
Girish Ramakrishnan 0843f78ec8 Add tasks.setCompleted
this lets us easily grep the code on where the task is completed
2019-09-05 11:29:48 -07:00
Girish Ramakrishnan 9769fbfcf2 Better message 2019-09-05 11:22:29 -07:00
Girish Ramakrishnan bd23abd265 tasks: make error a json
also, handle case where we never got to handle task exit cleanly
2019-08-30 14:49:45 -07:00
Johannes Zellner b9efa8f445 Use tasks api for external ldap syncer 2019-08-30 10:20:04 +02:00
Girish Ramakrishnan 9f1210202a port taskmanager to use tasks 2019-08-28 15:17:53 -07:00
Girish Ramakrishnan fef9e0a5c1 Handle app task crashes 2019-08-28 13:19:47 -07:00
Girish Ramakrishnan b30ff1f55a rework task API to be two-phase
this lets us avoid this EE based API. we now add and then start
explicitly.
2019-08-28 10:39:40 -07:00
Girish Ramakrishnan 33cfd7a629 Add 'success' virtual field to the tasks 2019-08-27 21:36:52 -07:00
Girish Ramakrishnan f535b3de2f Add logFile option to startTask 2019-08-27 15:26:26 -07:00
Girish Ramakrishnan 9242f7095a Migrate apptask to use tasks framework 2019-08-27 12:31:59 -07:00
Girish Ramakrishnan c9ed8543c8 Capitalize the error 2019-03-25 15:15:39 -07:00
Girish Ramakrishnan 1bcc2d544a link to logs instead of spatch'ed error 2019-03-04 18:03:51 -08:00
Girish Ramakrishnan f05bed594b remove redundant assert 2019-01-13 16:06:54 -08:00
Girish Ramakrishnan ea3cc9b153 Fix error message 2019-01-11 10:58:51 -08:00
Girish Ramakrishnan 79f9180f6b run backup cleanup as a task 2019-01-10 16:07:06 -08:00
Girish Ramakrishnan 810f5e7409 Fix line param parsing
lines is a positive integer or -1 to disable line limiting. The
default value is 10 if no argument is given.

Fixes #604
2019-01-08 13:23:29 -08:00
Girish Ramakrishnan a961407379 Fix setup and restore to have a task style API 2018-12-16 11:02:49 -08:00
Girish Ramakrishnan e79d963802 do not append to task log file 2018-12-14 22:22:57 -08:00
Girish Ramakrishnan bdf9671280 Split dashboard dns setup and db operations
The dns setup is now a task that we can wait on. Once that task
is done, we can do db operations to switch the domain in a separate
route
2018-12-14 09:57:28 -08:00
Girish Ramakrishnan ff550e897a caas: remove box plan change routes 2018-12-13 09:41:52 -08:00
Girish Ramakrishnan 935a8258a6 task API: remove arg from response
it can contain sensitive information
2018-12-11 16:22:53 -08:00
Girish Ramakrishnan fa483e5806 rename to listByTypePaged 2018-12-11 16:14:07 -08:00
Girish Ramakrishnan c7da090882 tasks: remove auditSource from start/stop 2018-12-11 09:22:13 -08:00
Girish Ramakrishnan f9add21899 Add task route tests 2018-12-10 21:42:03 -08:00
Girish Ramakrishnan 1277da8bfe Add tasks test 2018-12-10 21:17:30 -08:00
Girish Ramakrishnan 55650fb734 Fix crash when db got cleared 2018-12-10 20:56:38 -08:00
Girish Ramakrishnan d2f4b68c9f Make certificate renewal a task 2018-12-10 20:48:10 -08:00
Girish Ramakrishnan d43106b0af Add taskworker that runs funcs out of process 2018-12-09 10:06:22 -08:00