Commit Graph

88 Commits (d05a79d13d939d36281cb0c53a3873e908eb6884)

Author SHA1 Message Date
Christopher M. Wolff e7cbbaa722
feat: upgrade Flux to v0.83.2 (#19569) 2020-09-16 17:59:15 -07:00
Stuart Carnie 9163edb187
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-26 10:14:42 -07:00
Lyon Hill a8fe07bfc7
chore(task): clean up old maxPermission code (#19432)
Tasks no longer uses the max permission system to pupulate an
authorization. We can safely remove this dead code.
2020-08-26 10:26:32 -06:00
Stuart Carnie 0e0b2a3d87
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-25 09:03:07 -07:00
Brett Buddin f96303bfb2
feat(task): Record last success and failure run times in the Task (#19390)
* feat(task): Record the latest success/failure of a Task.

* chore(task): Fix typo.

* chore(kv): Test the updating of latest success/failure fields.

* fix(kv/task): Copy the latest success/failure fields when unmarshalling.

* chore(changelog): Add 19390 to changelog.
2020-08-25 10:44:37 -04:00
Stuart Carnie 7c972387e2
chore(task): Flux compatibility fixes
This commit temporarily pulls in code from the flux/ast/edit
package ensure builds continue. Once Flux is upgraded to the
latest, the pkg/flux package will be removed.
2020-08-20 11:25:51 -07:00
Brett Buddin 0780232b83
feat(task): Parse Task Options using Flux AST Helpers (#19326)
* feat(task): Extract options using AST-based method.

* feat(task): Use AST-based option APIs for updating task option.

* chore(task): Use the old way of parsing durations.

* fix(task): Ordering changed on us. Fixing tests to reflect the new order.

* fix(task): There's no way for us to know if there are multiples with the current APIs.

* chore(task): Guard against duplicate options. Minor cleanup.

* fix(kit/feature): Break cyclical dependency between influxdb and pkgs that use feature.

* chore(task): Feature flag updating Flux options.

* chore(task): Ensure we are testing both paths of feature flag.

* chore: Remove dead code.

* chore(task/options): Remove unnecessary conditional.

* chore(task/options): Unexport some error helpers.
2020-08-20 11:57:23 -04:00
Jonathan A. Sternberg 5aeca082c8
chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
Jonathan A. Sternberg d3fa60991f
Merge branch 'master' into chore/merge-master 2020-04-06 12:17:47 -05:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Jonathan A. Sternberg 0d6e4e310b
Merge branch 'master' into feat/use-algo-w 2020-03-06 16:46:49 -06:00
Jonathan A. Sternberg 834a8740e0
refactor(task/backend): move the task/backend constants to the global package (#17133)
This moves a few types and constants to the global package so it can be
used without importing the `task/backend` package. These constants are
referenced in non tasks-specific code.

This is needed to break a dependency chain where the task backend will
call into the flux runtime to perform parsing or evaluation of a script
and to prevent the http package from inheriting that dependency.
2020-03-06 16:19:32 -06:00
Jonathan A. Sternberg bcbb9df72e
refactor(task): tasks will now use the flux language service (#17104)
The tasks subsystem will now use the flux language service to parse and
evaluate flux instead of directly interacting with the parser or
runtime. This helps break the dependency on the libflux parser for the
base influxdb package.

This includes the task notification packages which were changed at the
same time.
2020-03-05 14:36:58 -06:00
docmerlin (j. Emrys Landivar) 2ae0234995 fix(tasks): add more tests for duration parsing 2020-02-24 09:20:05 -06:00
docmerlin (j. Emrys Landivar) aae9b58338 fix(tasks): use flux's parser.ParseDuration instead of time.Duration
for TaskUpdate.Validate
2020-02-24 09:20:05 -06:00
Johnny Steenbergen 13ac83e0c4 chore: refactor bits of checks and its dependencies for readability 2019-12-18 11:07:19 -08:00
Alirie Gray b5ccad3c07
feat(metrics): add run latency to executor metrics (#16190) 2019-12-11 14:50:32 -08:00
Alirie Gray 9417936069
feat(tasks): add ability to filter by active tasks (#15893) 2019-12-02 14:16:10 -08:00
Lyon Hill 5c7787743e
fix(task): add hinting to allow us to skip task auth lookup (#15973) 2019-11-19 11:06:04 -07:00
Alirie Gray f0ecc0e89d
refactor(tasks): use go Time for Task CreatedAt, UpdatedAt, LatestCompleted, Offset (#15672) 2019-11-12 17:13:56 -08:00
docmerlin (j. Emrys Landivar) 56d406afe8 fix(tasks): fix every parsing 2019-11-12 14:46:19 -06:00
Lyon Hill bb6aa1df3b
feat(task): Add a latestScheduled field for tasks (#15785)
Previously we overwrote the tasks existing latestCompleted to be used for latestCompleted as well as latestScheduled.
For obvious reasons this is confusing and missleading. I believe by seperating the two fields we can have a clear seperation
of concerns.
2019-11-06 15:10:52 -07:00
Gavin Cabbage 75147d014c
feat(tasks): expose lastRunStatus and lastRunError in task API 2019-10-30 14:00:22 -04:00
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