Commit Graph
100 Commits
Author SHA1 Message Date
chris meyers 1e10d4323f update docs 2018-11-27 16:12:40 -05:00
chris meyers 4111e53113 correctly name migration to align with 3.4.0 2018-11-27 16:12:40 -05:00
chris meyers 02df0c29e9 merge artifacts deterministically 2018-11-27 16:12:40 -05:00
chris meyers 475c90fd00 prevent job launching twice 2018-11-27 16:12:40 -05:00
chris meyers 2742b00a65 flake8 2018-11-27 16:12:40 -05:00
chris meyers ea29e66a41 fix workflow finish state detector
* Take into account the new do_not_run field when finding if a workflow
is finished. If do_not_run is True then the node is considered finished.
2018-11-27 16:12:40 -05:00
chris meyers 6ef6b649e8 cleaner code 2018-11-27 16:12:40 -05:00
chris meyers 9bf2a49e0f save state 2018-11-27 16:12:40 -05:00
chris meyers 914892c3ac all parents should finish before start child 2018-11-27 16:12:40 -05:00
chris meyers 77661c6032 short circuit performance optimization 2018-11-27 16:12:40 -05:00
chris meyers b4fc585495 stop DNR propogation on always path
* This makes sure DNR propogation stops when a job is successful, down
an always path
2018-11-27 16:12:40 -05:00
chris meyers ff6db37a95 correct stop DNR propogation
* If a child has a parent that is not in the finished state then do not
propogate the DNR to the child in question.
* If a parent is in a finished state; do not propogate the DNR to the
child if the path to the child is traversed (based on the parent job
status).
2018-11-27 16:12:40 -05:00
chris meyers 1a064bdc59 satisfy flake8 2018-11-27 16:12:40 -05:00
chris meyers ebabec0dad always find and mark dnr nodes 2018-11-27 16:12:40 -05:00
chris meyers 3506b9a7d8 Revert "mark dnr field read only"
This reverts commit 3dbc52d91223167683fd01174222bd6c22813dbd.

Workflow Job Nodes are read only already
2018-11-27 16:12:40 -05:00
chris meyers cc374ca705 update debug dot graph to output dnr data 2018-11-27 16:12:40 -05:00
chris meyers ad56a27cc0 mark dnr field read only 2018-11-27 16:12:40 -05:00
chris meyers 779e1a34db remove dnr field from jt wf node 2018-11-27 16:12:40 -05:00
chris meyers 447dfbb64d only visit nodes once for dnr 2018-11-27 16:12:40 -05:00
chris meyers a9365a3967 code cleanup 2018-11-27 16:12:40 -05:00
chris meyers f5c10f99b0 support workflow convergence nodes
* remove convergence restriction in API
* change task manager logic to be aware of and support convergence nodes
2018-11-27 16:12:40 -05:00
chris meyers 23e1feba96 fill in summary inv for sched only when needed
* If scheduler inv exists then the inv summary will be filled in with
our generic summary filler inner. Else, if the related unified job has
an inventory, fill in the inv summary with that, explicitly.
2018-11-08 12:43:47 -05:00
chris meyers f37391397e add inventory to schedule summary fields
* Use the same logic that related inventory uses. If there is an
inventory that overrides the inventory on the unified job  template then
summarize that field. Else, use the inventory on the unified job template
being scheduled.
2018-11-08 11:47:31 -05:00
chris meyers 906eb98d8e fixes dispatcher test that inadvertently access db
* Logger inadvertently triggered by dispatcher tests that do not need DB
access. Mock settings to sidestep DB access.
2018-10-16 11:30:04 -04:00
chris meyers 2e98446394 fix issue with ldap queries containing unicode 2018-10-12 10:33:01 -04:00
chris meyers cfb58eb145 fix issue with ldap queries containing unicode 2018-10-10 12:32:27 -04:00
chris meyers 0a0cdc2e21 at migration time, validate ldap group type params
* Previously, we have logic in the API to ensure that ldap group type
params, when changed, align with ldap group type Class init
expectations. However, we did not have this logic in the migrations.
This PR adds the validation check to migrations.
2018-09-27 12:18:39 -04:00
chris meyers f82f4a9993 deprecate fact endpoints and commands 2018-09-07 17:46:33 -04:00
chris meyers c7c9620f03 vary the pk 2018-08-09 17:53:31 -04:00
chris meyers 45f2fe7f90 add test for first net cred ssh password protected wins 2018-08-09 17:53:23 -04:00
chris meyers 3960a72c8a first net password-protected ssh key wins 2018-08-09 17:53:13 -04:00
chris meyers bc2b2214a8 add test for ssh over network ssh key password preference 2018-08-09 17:53:06 -04:00
chris meyers 3c2b18a965 add pexpect test for net cred 2018-08-09 17:52:55 -04:00
chris meyers f5aed74503 fill in network ssh password protected keys 2018-08-09 17:52:45 -04:00
chris meyers 5bfe9bf228 vary the pk 2018-08-09 15:44:59 -04:00
chris meyers 40d6c763b3 add test for first net cred ssh password protected wins 2018-08-09 13:32:42 -04:00
chris meyers 2f49dc774a first net password-protected ssh key wins 2018-08-09 13:25:15 -04:00
chris meyers 8d440acb0f add test for ssh over network ssh key password preference 2018-08-09 12:51:40 -04:00
chris meyers 9a199b99ac add pexpect test for net cred 2018-08-09 12:40:37 -04:00
chris meyers 48a0038f53 fill in network ssh password protected keys 2018-08-09 12:15:27 -04:00
chris meyers 5f85a08325 fix saml_admin_attr 2018-07-23 12:53:18 -04:00
chris meyers 3fcd1575c1 fix saml_admin_attr 2018-07-23 10:08:18 -04:00
chris meyers 7d24566120 more robustness 2018-07-20 15:02:44 -04:00
chris meyers 19e865e9a5 prevent remove iso instance from iso instance groups 2018-07-06 15:34:26 -04:00
chris meyers 2ffc4b256d fix copy paste error 2018-07-06 15:12:57 -04:00
chris meyers aeca21ab5b deny topology changes to iso instances via api 2018-07-06 14:50:17 -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 987063e7fd iso nodes do not have celery. that is ok 2018-06-11 15:38:41 -04:00
chris meyers fb11967114 remove isolated instance group queue listening 2018-06-08 13:46:58 -04:00
chris meyers 1cea20092c remove rampart group queue subscription
* We now target Instances in the task manager when transitioning jobs
from pending to waiting; whereas before we submitted jobs to Instance
Groups to be picked up by Instance's in those Instance Groups.
Subscribing Instances to their Instance Groups is no longer needed. This
change removes the Instance Group queue subscription.
2018-06-08 11:20:54 -04:00
chris meyers 0702692ca9 add controller_node to adhoc command job 2018-06-06 16:28:28 -04:00
chris meyers 74155dfc9d add system jobs to controller_node exceptions 2018-06-06 15:04:41 -04:00
chris meyers 8ee4b9680c remove controller_node field from jobs that don't apply 2018-06-06 11:26:15 -04:00
chris meyers b876c2af62 add total job count for instance + instance group 2018-06-05 12:05:22 -04:00
chris meyers 7b0b4f562d get isolated execution at the point its needed
* Instead of passing around the isolated host that the task is to
execute on; grab the isolated execution host from the instance further
down the call stack. Without passing the isolated hostname around.
2018-06-04 10:06:59 -04:00
chris meyers b94cf379f6 do not choose offline instances 2018-06-04 10:06:59 -04:00
chris meyers 9d732cdbdf update unit and functional tests 2018-06-04 10:06:59 -04:00
chris meyers 9863fe71dc do not require privileged iso container
* The init call w/ privileged was causing my laptop to wig out. This
changeset still functions w/ out requiring privileged access.
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
chris meyers 4031c888de fork process may finish before cancel callback
* The "should we cancel?" callback check is only called while the
subprocess (child) is alive. If the child executes quickly, the cancel
callback has no chance to run.
* call a subprocess that takes longer to run like sleep 2
2018-05-17 14:39:57 -04:00
chris meyers d8615df47f postgres back tests can't do this 2018-05-17 14:39:57 -04:00
chris meyers 88bb98c967 flake8 2018-05-17 13:38:37 -04:00
chris meyers 40ef30a914 reduce chance of collision on cache namespace 2018-05-17 13:37:04 -04:00
chris meyers 04767641af isolate cache 2018-05-17 12:58:11 -04:00
chris meyers 97ab6449b9 parallelize test running 2018-05-16 14:29:15 -04:00
chris meyers ceedc135b2 add variables to inventory mentioned in docs
* Also better error message when openshift cert failure
2018-05-15 14:44:43 -04:00
chris meyers 4761e17566 disabled instance stay subscribed to bcast queue
* A disabled node needs to stay subscribed to the broadcast queue
because the work to re-subscribe the node to queues when the node is
re-enabled is done over the broadcast queue.
2018-05-09 17:03:26 -04:00
chris meyers 5668d215fd better cluster membership policy log messages 2018-05-03 11:44:46 -04:00
chris meyers 9f745dd3b8 control celery routes using celery router
* Each time a route is needed (i.e. when a task is sumitted to celery).
The router will be queried. This is ideal. With the previous method we
had to consider how a change in the routes would propogate to all celery
workers and nodes.

* fully describe the default awx queue
* Our dynamic queue registration would correct awx_private_queue.
However, we don't want celery to even create an "invalid"/extra
queue-exchange-route. This change makes sure we don't create extranious
things in rabbitmq.

* reduce the cluster queue registration output. Only output when the
queue registration list changes.
2018-05-02 12:57:36 -04:00
chris meyers 38885580b4 only require the name field when creating instance group 2018-05-02 12:32:08 -04:00
chris meyers 202ddae813 make tower instance group name field read-only 2018-05-01 13:31:24 -04:00
chris meyers 648d9165ff broadcast queues get a per-node stable queue name
* Using Kombu's default Broadcast() constructor requires only 1
parameter. That parameter defines the exchange name and the queue name
is randomly generated per-node.
* This caused problems if/when celery enters an infinite restart loop
because too many rabbit queues get created and rabbit OOM's
(gracefully).
* To remedy this we tell Broadcast the queue name to use, which is
derived from some constant + the node name so that the per-node queue
name is stable.
2018-05-01 13:09:10 -04:00
chris meyers 14c6265b27 ensure instance policy percentages round up 2018-04-25 10:11:40 -04:00
chris meyers 619ec905b2 policy fields not required
* They were previously not required until a min/max was enforced. This
caused the fields to, unintentionally, be required.
* This fix makes the policy fields not required and provides sane defaults.
2018-04-24 14:05:38 -04:00
chris meyers a56771c8f0 send all tower work to a user-hidden queue
* Before, we had a special group, tower, that ran any async work that
tower needed done. This allowed users fine grain control over which
nodes did background work. However, this granularity was too complicated
for users. So now, all tower system work goes to a special non-user
exposed celery queue. Tower remains the fallback instance group to
execute jobs on. The tower group will be created upon install and
protected from deletion.
2018-04-20 13:04:36 -04:00
chris meyers 09d5645b90 redact project update urls when downloading stdout
* For ProjectUpdate jobs. Redact potentially sensitive urls from the
output.
2018-04-18 16:45:55 -04:00
chris meyers 04693ecb0f remove infinite loop regex
* Fancy url finding regex can result in infinite loop for malformed ipv6
urls so replace it with a more nieve regex that can overmatch.
* regex's that find malformed ipv6 urls will be passed to urlparse. This
can result in a parsing/ValueError. For these cases we redact the entire
found URI.
2018-04-13 15:48:06 -04:00
chris meyers 00cd6cb384 set better defaults for ldap
* LDAP params is a new field. It contains the kwargs that will be passed
to the python class specified by group type. The default for group type
is MemberDNGroupType. The required params are now those in the defaults.
2018-04-10 15:44:08 -04:00
chris meyers bd7d9db1ce correctly cascade set null
* It's problematic to delete an instance that is referenced by a foreign
key; where the referening model is one that has a Polymorphic parent.
* Specifically, when Django goes to nullify the relationship it relies
on the related instances[0] class type to issue a query to decide what
to nullify. So if the foreignkey references multiple different types
(i.e. ProjectUpdate, Job) then only 1 of those class types will get
nullified. The end result is an IntegrityError when delete() is called.
* This changeset ensures that the parent Polymorphic class is queried so
that all the foreignkey entries are nullified
* Also remove old Django "hack" that doesn't work with Django 1.11
2018-04-06 11:10:16 -04:00
chris meyers 88fbb6706f use non-deprecated way of setting many2many 2018-04-03 14:31:37 -04:00
chris meyers c3100afd0e fixed isolated instance query
* Was considering an isolated instance: any instance that has at least 1
group with no controller. This is technically correct since an iso node
can not be a part of a non-iso group.
* The query is now more robust and considers a node an iso node if ALL
groups that a node belong to ALL have a controller.
* Also added better debugging for the special tower instance group
* Added a check for the existance of the special tower group so that
logs are less "messy" during the install process.
2018-04-03 13:50:57 -04:00
chris meyers e5dcfda1fe append registered hostname to policy list
* The Instance Group list of instances was getting over-written with
every call to the register_instance management command.
* This changeset appends --hostnames to the Instance Group policy list.
2018-04-02 16:26:59 -04:00
chris meyers 557637afcb better unicode handling 2018-04-02 12:05:16 -04:00
chris meyers 7e7ff8137d more gracefully account for undefined stdout
* It's possible to have an exception raised in BaseTask.run() before the
stdout handler gets defined. This is problematic when the exception
handler tries to access that undefined var .. causing another exception.
Note that the second exception is caught also but it's not desirable to
lose the first exception.
* This fix checks to see if the stdout handler var is defined before
calling it's methods. Thus, we retain the original error message.
2018-04-02 11:41:30 -04:00
chris meyers 838b723c73 add all instances to special tower instance group
* All instances except isolated instances
* Also, prevent any tower attributes from being modified via the API
2018-03-29 16:47:52 -04:00
chris meyers bf6412ea06 fix api browser endpoint name
* Endpoint exposes all jobs associated with an Instance. This is what we
want. Align the endpoint description with this behavior by removing the
word running.
2018-03-28 16:24:19 -04:00
chris meyers 8438331563 make jobs_running more rich in OPTIONS
* Expose jobs_running as an IntegerField
2018-03-28 16:01:24 -04:00
chris meyers eef6f7ecb0 delay looking up settings SYSTEM_UUID 2018-03-28 09:54:51 -04:00
chris meyers dc46a732bc fix ldap group type params label
* copy pasted ldap group type label and did no previously update. This
updates.
2018-03-28 09:12:06 -04:00
chris meyers 7ce8907b7b reregister node when they come back online
* Nodes are marked offline, then deleted; given enough time. Nodes can
come back for various reasions (i.e. netsplit). When they come back,
have them recreate the node Instance if AWX_AUTO_DEPROVISION_INSTANCES
is True. Otherwise, do nothing. The do nothing case will show up in the
logs as celery job tracebacks as they fail to be self aware.
2018-03-27 14:30:47 -04:00
chris meyers 1503e0505e call celery method with celery context
* Tracebacks are more informative this way.
2018-03-26 12:02:42 -04:00
chris meyers b9b8502738 introspect ldap group types for param validation
* Instead of keeping a hard-coded mapping of valid args for each ldap
group type; introspect the subclass to determine valid/invalid fields
2018-03-26 11:40:49 -04:00
chris meyers cb7e17885f remove uneeded auth ldap settings
* I had thought that setting the settings was required. But carefully
selected defaults for the settings is the correct way to deal with
errors I was seeing early in developing this feature.
2018-03-23 15:41:08 -04:00
chris meyers 305ef6fa7e do not allow tower group delete or name change
* DO allow policy changes and other attribute changes
2018-03-22 08:05:06 -04:00
chris meyers e0803b9f08 use non-unicode queue names
* Use unicode InstanceGroup and queue names up until the point we
actually create the queue
* kombu add_consumers returns a dict with a value that contians the
passed in queue name. Trouble is, the returned dict value is a string
and not a unicode string and this results in an error.
2018-03-21 16:50:07 -04:00
chris meyers 91bfed3d50 handle instance group names unicode 2018-03-21 13:41:48 -04:00
chris meyers 1c578cdd74 validate group type params 2018-03-21 09:13:08 -04:00
chris meyers 17795f82e8 more parameters 2018-03-21 09:13:08 -04:00