Commit Graph

47 Commits

Author SHA1 Message Date
chris meyers
7c52208627 update done and fail detection for workflow
* Instead of traversing the workflow graph to determine if a workflow is
done or has failed; instead, loop through all the nodes in the graph and
grab only the relevant nodes.
2018-11-16 09:18:06 -05:00
chris meyers
73feeea42b always find and mark dnr nodes 2018-11-16 09:16:41 -05:00
chris meyers
c18bd274c9 support workflow convergence nodes
* remove convergence restriction in API
* change task manager logic to be aware of and support convergence nodes
2018-11-16 09:16:40 -05:00
AlanCoding
758a488aee Add task manager rescheduling hooks, de-duplication, lifecycle tests 2018-11-14 11:31:34 -05:00
AlanCoding
1bed5d4af2 avoid nested on_commit use 2018-11-07 13:22:41 -05:00
AlanCoding
0783d86c6c adjust recursion error text 2018-11-07 13:22:41 -05:00
AlanCoding
01d1470544 workflow variables processing, recursion detection 2018-11-07 13:22:38 -05:00
AlanCoding
475a701f78 Allow use of credential password prompting with split JTs
also
*update test to work with new JT callback call pattern
*fix spelling in template
2018-10-31 11:04:11 -04:00
AlanCoding
20226f8984 Polish split jobs API info & add fields to UI
*clarify help text and squash migrations
*adds new internal_limit field to Job model for faster reference
*if field is non-blank, populate shard params in summary_fields
*add summary information to UI job/wfj details, JT selector
2018-10-31 11:04:10 -04:00
AlanCoding
f9bdb1da15 Job splitting access logic and more feature development
*allow sharding with prompts and schedules
*modify create_unified_job contract to pass class & parent_field name
*make parent field name instance method & set sharded UJT field
*access methods made compatible with job sharding
*move shard job special logic from task manager to workflows
*save sharded job prompts to workflow job exclusively
*allow using sharded jobs in workflows
2018-10-31 11:04:10 -04:00
AlanCoding
dab678c5cc Implement splitting logic in inventory & job task code 2018-10-31 11:04:10 -04:00
Matthew Jones
44ffcf86de Properly take prompted inventory into account
This also will rename shard jobs to add an index to the job name
2018-10-31 11:04:10 -04:00
AlanCoding
e513f8fe31 do 2-pass cancel for workflow jobs 2018-10-26 10:28:30 -04:00
Ryan Petrello
ff1e8cc356 replace celery task decorators with a kombu-based publisher
this commit implements the bulk of `awx-manage run_dispatcher`, a new
command that binds to RabbitMQ via kombu and balances messages across
a pool of workers that are similar to celeryd workers in spirit.
Specifically, this includes:

- a new decorator, `awx.main.dispatch.task`, which can be used to
  decorate functions or classes so that they can be designated as
  "Tasks"
- support for fanout/broadcast tasks (at this point in time, only
  `conf.Setting` memcached flushes use this functionality)
- support for job reaping
- support for success/failure hooks for job runs (i.e.,
  `handle_work_success` and `handle_work_error`)
- support for auto scaling worker pool that scale processes up and down
  on demand
- minimal support for RPC, such as status checks and pool recycle/reload
2018-10-11 10:53:30 -04:00
AlanCoding
786e907e3b put atomic block inside lock block 2018-08-30 12:54:53 -04:00
Yunfan Zhang
5c23c63e6d Prevent implicit project updates from blocking jobs.
Signed-off-by: Yunfan Zhang <yz322@duke.edu>
2018-08-15 11:48:58 -04:00
AlanCoding
7aa7cc1c98 add current workflow job to running list 2018-08-08 07:49:02 -04:00
Ryan Petrello
91c92d57e3 fix a bug in isolated job launches when there are no controllers online
see: https://github.com/ansible/tower/issues/2782
2018-08-07 17:27:23 -04:00
Wayne Witzel III
74ed1c2c40 fetch running workflow jobs once per process 2018-08-02 11:46:38 -04:00
Wayne Witzel III
da603dd3ad use workflow_template_id 2018-08-01 15:55:19 -04:00
Wayne Witzel III
c96cf3cf5d unless allow_simultaneous, do not start workflow jobs that are already running 2018-08-01 14:53:00 -04:00
Ryan Petrello
ef6433c6f9 Revert "fix celery task reaper"
This reverts commit 1359208a99.
2018-06-18 16:18:20 -04:00
chris meyers
1359208a99 fix celery task reaper
* celery workers have internal queue names that are named after the
system hostname. This may differ from what tower knows the host by,
Instance.hostname
This adds a mapping so we can convert internal celery names to Instance
names for purposes of reaping jobs.
2018-06-15 16:56:53 -04:00
chris meyers
b94cf379f6 do not choose offline instances 2018-06-04 10:06:59 -04:00
chris meyers
8d352a4edf conform isolated system to new early node choice
* Randomly chose an instance in the controller instance group for which
to control the isolated node run. Note the chosen instance via a job
controller_node field
2018-06-04 10:06:59 -04:00
chris meyers
e720fe5dd0 decide the node a job will run early
* Deciding the Instance that a Job runs on at celery task run-time makes
it hard to evenly distribute tasks among Instnaces. Instead, the task
manager will look at the world of running jobs and choose an instance
node to run on; applying a deterministic job distribution algo.
2018-06-04 10:06:59 -04:00
chris meyers
4da68564ef do not cache dependency_list
* This is probably causing some bug. Calls to start_task within the same
run of the task manager could result in previous dependency lists being
used.
2018-05-29 10:27:51 -04:00
AlanCoding
84d9273012 add corresponding log for WorkflowJob submission 2018-04-26 09:30:19 -04:00
Matthew Jones
2f3d7b17f6 Fix an issue where missing instance group would cause an error
We'll now default to queue submission to the basic management queue
2018-04-26 09:11:08 -04:00
Matthew Jones
4af8a53232 Remove Instance Group concept/usage from WorkflowJobs
This also relaxes some of the task manager rules on Instance Groups
down the full stack such that workflow jobs tend to shortcut the
processing or omit it altogether.

This lets the workflow job spawning logic exist outside of the
instance group queues, which it doesn't need to participate in in the
first place.
2018-04-25 08:29:49 -04:00
AlanCoding
4ff2f3e061 remove setting corresponding to removed tests 2018-04-16 14:49:54 -04:00
Ryan Petrello
f59f47435b send job notification templates _after_ all events have been processed
see: https://github.com/ansible/awx/issues/500
2018-03-22 09:30:41 -04:00
chris meyers
91bfed3d50 handle instance group names unicode 2018-03-21 13:41:48 -04:00
Wayne Witzel III
91c6d406c5 Rollback celery 2018-02-22 09:37:14 -05:00
Bill Nottingham
7b288ef98a Tweak celery-related messages. 2018-02-13 10:52:14 -05:00
AlanCoding
1f8cab4171 intentionally forget start_args when job is done 2017-12-10 12:08:54 -05:00
AlanCoding
34a8e0a9b6 Feature: saved launchtime configurations
Consolidate prompts accept/reject logic in unified models
Break out accept/reject logic for variables
Surface new promptable fields on WFJT nodes, schedules

Make schedules and workflows accurately reject variables
  that are not allowed by the prompting
  rules or the survey rules on the template

Validate against unallowed extra_data in system job schedules
Prevent schedule or WFJT node POST/PATCH with unprompted data
Move system job days validation to new mechanism
Add new psuedo-field for WFJT node credential
Add validation for node related credentials
Add related config model to unified job
Use JobLaunchConfig model for launch RBAC check

Support credential overwrite behavior with multi-creds
  change modern manual launch to use merge behavior
Refactor JobLaunchSerializer, self.instance=None
Modularize job launch view to create "modern" data
Auto-create config object with every job
Add create schedule endpoint for jobs
2017-12-08 13:38:54 -05:00
Matthew Jones
9ee77a95c6 Delay instantiation of the celery app for the inspector
This keeps the instance from re-using a pool that might have already
expired and is unusable for the inspector that needs to run as part of
the task manager
2017-11-14 10:33:47 -05:00
Wayne Witzel III
f118e27047 Flake8 fixes and URL updates 2017-11-10 17:04:33 -05:00
Aaron Tan
bcd2a8f211 Merge pull request #382 from jangsutsr/fix-264
Implement workflow job failure
2017-10-12 16:34:08 -04:00
Aaron Tan
5287e5c111 Implement workflow job failure
Relates #264.

This PR proposed and implemented a way of defining workflow failure
state:

A workflow job fails if one of the conditions below satisfies.
* At least one node runs into states `canceled` or `error`.
* At least one leaf node runs into states `failed`, but no child node is
  spawned to run (no error handler).

Signed-off-by: Aaron Tan <jangsutsr@gmail.com>
2017-10-12 11:08:33 -04:00
AlanCoding
f03b40aa50 enforce max line length of 160 characters 2017-10-11 12:38:39 -04:00
Matthew Jones
3e38a0c17d Add unit test for inventory_sources_already_updated 2017-09-27 16:52:05 -04:00
Matthew Jones
f4c9617f95 Check for inventory sources already updated from start args
In the case where the host didn't exist in the inventory source and
was found in the first inventory sync
2017-09-27 16:31:22 -04:00
Matthew Jones
7861cda6fe Remove the logic blocking dependent inventory updates on callbacks 2017-09-27 16:00:05 -04:00
AlanCoding
dba83674a2 fix task manager running task structures
- prevent dual-entry for first item in running jobs due to
   setdefault syntax
 - fix issue where queues (celery tasks) only returned the last
   item in the inspector output due to looping problem
   this caused reaper bugs in production
2017-09-21 14:38:58 -04:00
Wayne Witzel III
439beeab3b Merge pull request #224 from wwitzel3/fix-shared-deps
Fix job shared dependencies.
2017-09-20 14:56:22 -04:00