Commit Graph

65 Commits (d53d3686b62d27cfbd5fcecdd3b4c71ccb83373d)

Author SHA1 Message Date
docmerlin (j. Emrys Landivar) 6feae8f3ce feat(tasks): fixes for changeover 2019-10-29 10:36:47 -05:00
Alirie Gray 552168d3ae
refactor(tasks): use Go time objects for timestamps on task Runs (#15406) 2019-10-17 17:23:45 -07:00
Lyon Hill 3c6779f011
feat(task): Allow tasks to run more isolated from other task systems (#15384)
* feat(task): Allow tasks to run more isolated from other task systems

To allow the task internal system to be used for user created tasks as well
as checks, notification and other future additions we needed to take 2 actions:

1 - We need to use type as a first class citizen, meaning that task's have a type
and each system that will be creating tasks will set the task type through the api.
This is a change to the previous assumption that any user could set task types. This change
will allow us to have other service's white label the task service for their own purposes and not
have to worry about colissions between the types.

2 - We needed to allow other systems to add data specific to the problem they are trying to solve.
For this purpose adding a `metadata` field to the internal task system which should allow other systems to
use the task service.

These changes will allow us in the future to allow for the current check's and notifications implementations
to create a task with meta data instead of creating a check object and a task object in the database.
By allowing this new behavior checks, notifications, and user task's can all follow the same pattern:

Field an api request in a system specific http endpoint, use a small translation to the `TaskService` function call,
translate the results to what the api expects for this system, and return results.

* fix(task): undo additional check for ownerID because check is not ready
2019-10-11 08:53:38 -06:00
Alirie Gray a9df93b1fd
refactor(tasks): create coordinator for new scheduler/executor (#15268) 2019-09-26 13:55:23 -07:00
docmerlin (j. Emrys Landivar) baaf93dbbc fix(tasks): fixes duration validation for every and offset, so people will get feedback if they are using durations that tasks doesn't currently support 2019-09-18 09:07:43 -05:00
Stuart Carnie e8a220ebe9
fix(task): Ensure Flux parser panics are handled in UpdateFlux
UpdateFlux is called during updates within the K/V store, and may
panic when parsing unexpected Flux scripts, which is undesirable.

We will look for an opportunity to log the panic, so they can be
tracked down and fixed.
2019-09-10 13:04:11 -07:00
Lyon Hill 0b247cce5b
feat(task): Remove token's from task structures (#14712)
* feat(task): Remove token's from task structures

We had previously removed token's from the task api but left the token in place in several locations in the stack.
Now we can cleanly remove the extra tokens.
2019-08-20 08:42:40 -06:00
Alirie Gray 28089fdb59 feat(tasks): add ability to find tasks by name 2019-08-16 12:07:11 -07:00
Lyon Hill a8d7870689
feat(task): impersonate user on task execution (#14675)
* feat(task): impersonate user on task execution

Passing tokens to tasks is cumbersome and we needed a way to more easily create tasks. With this change we no longer need a token on task create. We take the user that created the task and pass that in as the "owner". As far as the task is concerned the owner is the source of permissions.

This is done by adding an additional field on task create that is OwnerID. We will no longer respect the token passed in and it will be deprecated soon.

Things to do still:
Task updates need to allow for owners to be set.
2019-08-15 18:31:52 -06:00
Lyon Hill e922c8a26f
feat(task): add task types (#14567) 2019-08-06 10:27:52 -06:00
Alirie Gray 30abb1b1b0 feat(tasks): add new executor prometheus metrics 2019-07-31 14:29:05 -07:00
Alirie Gray 04a427e99e feat(tasks): add runID to Log struct 2019-06-06 11:24:38 -07:00
Alirie Gray 576da8f9d2 fix(swagger): add log property to task runs endpoint docs 2019-05-17 14:08:10 -07:00
Alirie Gray 77934b01c6 feat(tasks): add description field to tasks 2019-05-08 13:39:09 -07:00
Lyon Hill 726fbefe9a
Integrate the new changes to tasks (#13473)
* Integrat the new changes to tasks
2019-04-19 08:37:59 -06:00
Lyon Hill 9a41cc46e4
Create an analytical storage middleware layer (#13418)
* Create an analytical storage middleware layer
2019-04-17 08:41:05 -06:00
Lyon Hill c29e77e6e4
build kv based TaskService (#13228)
* chore(tasks): task kv

* WIP

* get the kv task service complete and passing test
2019-04-09 16:52:54 -06:00
docmerlin (j. Emrys Landivar) 492d8406aa fix(tasks): make durations visibly show up nicely 2019-03-29 13:50:26 -05:00
Lyon Hill c78344c441
update task schedler to use the new task control service (#12949) 2019-03-28 16:52:25 -06:00
docmerlin (j. Emrys Landivar) ea82893abd feat(tasks): remove removable options 2019-03-19 10:24:42 -05:00
Lyon Hill ad515cbdc5
Update the required fields for task swagger (#12400)
* Update the required fields for task swagger
2019-03-07 15:34:12 -07:00
zhulongcheng b8a9c9595d feat(http): add task paging links 2019-03-06 15:06:35 +08:00
Lyon Hill 17026c2053
change task logs from a string to a struct (#12363)
* change task logs from a string to a struct
2019-03-05 15:58:33 -07:00
docmerlin (j. Emrys Landivar) 80242b3446 fix(tasks): fix task update validation 2019-03-01 09:00:53 -06:00
Jorge Landivar 9e6a2247c0
Merge pull request #12134 from zhulongcheng/validate-task-status
fix(http): validate status for creating and updating a task
2019-02-27 13:08:06 -06:00
Lyon Hill b3f450eca9
Allow the CLI to find tasks by org name (#12202)
* Allow the CLI to find tasks by org name
2019-02-27 08:56:32 -07:00
docmerlin (j. Emrys Landivar) df75f9b9a0 fix(tasks): allow switching between cron and every options 2019-02-26 11:12:56 -06:00
zhulongcheng efadd43886 fix(http): validate status for creating and updating a task 2019-02-24 15:34:32 +08:00
Palak Bhojani e4dc3bfe24 Update task object property to change from latest_completed to latestCompleted 2019-02-19 13:41:57 -08:00
Lyon Hill c7f60271fd
remove task owner from task struct (#11968)
* remove task owner from the payload

* clean user references in store and tests
2019-02-19 11:19:06 -07:00
Mark Rushakoff cbef811c63 refactor(task): remove explicit org from run/log lookup
Task ID is now a required value on run and log filters. It was
effectively required by all implementations before anyway, so now those
types reflect that requirement.

Organization ID was removed from those same fields. The TaskService
looks up the organization ID via the task in cases where we need it at a
lower layer.
2019-02-16 14:34:49 -08:00
Mark Rushakoff caf08b5078 feat(task): store authorization ID with task
Accept token when creating or updating a task, but only report back the
authorization ID.

This means the executor and the platform adapter are now both aware of
an Authorization Service.
2019-02-14 08:53:40 -08:00
Mark Rushakoff 007f5059c7 refactor(task): extract TaskCreate struct
With the ongoing authorization work, creation arguments will differ from
what's returned on reads. More specifically, creation will accept a
token, but reads will report back a token ID.

This refactor facilitates that authorization work, and also brings the
code closer to the swagger definition, for the TaskCreateRequest type in
particular.
2019-02-12 15:10:03 -08:00
Lyon Hill 512af6e4b3
Add createdAt and updatedAt to tasks api (#11794)
fixes #11061
2019-02-12 11:06:23 -07:00
Lorenzo Affetti c0ba465604 fix: multiple compatibility issues with flux@master 2019-02-05 17:46:54 +01:00
Lyon Hill bdf65f5dfe
Remove owner from task json responses (#11504)
* Remove owner from task json responses

* allow for crud to run in parallel with other tests

To be parallel we just cant assume we only have 1 task.
2019-01-24 16:05:24 -07:00
Lyon Hill 523e52d662
Show organization names in task api actions (#11223)
* Show organization names on task actions.

closes #10876
2019-01-18 09:10:14 -07:00
Michael Desa 7c1372cdfc fix(influxdb): rename organizationID to orgID in json struct tags
Note. This may require that users blow away thier existing boltdb
databases to avoid errors.
2019-01-14 18:12:46 -08:00
j. Emrys Landivar (docmerlin) a2674fa03d feat(tasks): update task options from api 2019-01-11 11:55:46 -06:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Andrew Watkins 3429e8d0c6
feat(auth): rewrite authorization service (#2157)
* feat(view-token-overlay): add view token overlay

* test(tokens): update tests

* chore(auths): rename mock data file

* feat(token-view): clicking on description opens token view modal

* feat(token-view): add ability to close overlay

* feat(token-view): display token permissions with updated permissions shape

* feat(token-view): wip update authorization and permission shapes

* feat(auth): wip refactor auth permissions

* fix(auth): generate permissions via functions

* fix(auth): make Id ID

* chore(types): update generated client

* feat(auth): wip add user and org names to auth

* fix(user): didnt save rebase

* feat(auth): WIP refactor auth

* feat(auth): check for user existence during auth creation

* feat(auth): org must exist during auth creation

* fix(auth): pluralize telegrafs resource type

* docs(http): update swagger definition for the Authorization

* test(auth): fix broken tests

* docs(swagger): update cur_swagger Authrorizations

* fix(api): remove trace from cur_swag

* test(ui/token): update components with new generated type definitions

* feat(http): add lookup service adding names for permissions

* fix(http): remove debugging panics

* chore: go tidy

* fix: unsaved rebase

* test(idpe): add ids to Authorizations for log tests
2018-12-28 15:02:19 -08:00
Mark Rushakoff 0e41f240f2 feat(task): support forcing a run with arbitrary timestamp
Also rename RetryAlreadyQueuedError by running:

gorename -from '"github.com/influxdata/platform/task/backend".RetryAlreadyQueuedError' -to RequestStillQueuedError

and some further manual cleanup for comments.
2018-12-21 14:37:53 -05:00
Lyon Hill 678acd5307
feat(task): Allow the most recent run time to be shown in the api. (#1765)
* feat(task): Allow the most recent run time to be shown in the api.

When showing tasks in the api latest_completed will now show in the api if it has been run.

fixes #1705
2018-12-06 16:46:16 -07:00
j. Emrys Landivar (docmerlin) 0cb888afc0 Change delay to offset in tasks to match the flux spec 2018-12-06 11:00:07 -06:00
zhulongcheng 851404fb06 fix(http/task): flatten runs response and links 2018-12-04 15:10:03 -08:00
j. Emrys Landivar (docmerlin) 7ffd18c7b8 remove requestedAt param from retry call and refactor TaskService interface 2018-11-30 13:14:21 -06:00
zhulongcheng d8c80fa50c add limit param to task service 2018-11-30 10:02:41 +08:00
docmerlin (j. Emrys Landivar) 57fe285e56 add run return to rerun 2018-11-27 11:48:32 -06:00
Mark Rushakoff 232fb90edb feat(task): add Delay field to platform.Task
This brings Delay in line with Every and Cron.
2018-11-21 14:37:35 -08:00
Mark Rushakoff cd80e41220 feat(task): add ability to retry runs
This also adjusts the TaskService interface's RetryRun method to accept
a task ID rather than an org ID. Internally, we still look up runs by
organization, and maybe that will change later, but this is a more
natural way for clients to look it up.
2018-10-30 09:20:40 -07:00