31306 Commits

Author SHA1 Message Date
Shane McDonald
7de86fc4b4
Merge pull request #11747 from AlanCoding/loop_label
Add loop label with docker-compose playbook
2022-02-17 09:45:03 -05:00
Shane McDonald
963948b5c8
Merge pull request #11767 from simaishi/rekey_existing
Allow rekey with an existing key
2022-02-17 09:39:05 -05:00
Shane McDonald
d9749e8975
Merge pull request #11734 from shanemcd/fix-image-push
Fix image push when overriding awx_image_tag
2022-02-17 07:21:29 -05:00
Julen Landa Alustiza
f6e4e53728
Merge pull request #11766 from Zokormazo/collection-pep8
pep8 E231 fix for awx_collection
2022-02-17 13:21:23 +01:00
Julen Landa Alustiza
98adb196ea
pep8 E231 fix for awx_collection
Signed-off-by: Julen Landa Alustiza <jlanda@redhat.com>
2022-02-17 09:34:48 +01:00
Satoe Imaishi
9d6de42f48 Allow rekey with an existing key
(cherry picked from commit 0c6440b46756f02a669d87e461faa4abc5bab8e6)
2022-02-16 17:58:22 -05:00
Tiago Góes
a94a602ccd
Merge pull request #11746 from AlexSCorey/11744-fixValidatorBug
Fixes validator console error, and routing issue in Instance Groups Branch
2022-02-16 12:28:43 -03:00
Elijah DeLee
799968460d
Fixup conversion of memory and cpu settings to support k8s resource request format (#11725)
fix memory and cpu settings to suport k8s resource request format

* fix conversion of memory setting to bytes

This setting has not been getting set by default, and needed some fixing
up to be compatible with setting the memory in the same way as we set it
in the operator, as well as with other changes from last year which
assume that ansible runner is returning memory in bytes.

This way we can start setting this setting in the operator, and get a
more accurate reflection of how much memory is available to the control
pod in k8s.

On platforms where services are all sharing memory, we deduct a
penalty from the memory available. On k8s we don't need to do this
because the web, redis, and task containers each have memory
allocated to them.

* Support CPU setting expressed in units used by k8s

This setting has not been getting set by default, and needed some fixing
up to be compatible with setting the CPU resource request/limits in the
same way as we set it in the resource requests/limits.

This way we can start setting this setting in the
operator, and get a more accurate reflection of how much cpu is
available to the control pod in k8s.

Because cpu on k8s can be partial cores, migrate cpu field to decimal.

k8s does not allow granularity of less than 100m (equivalent to 0.1 cores), so only
store up to 1 decimal place.

fix analytics to deal with decimal cpu

need to use DjangoJSONEncoder when Decimal fields in data passed to
json.dumps
2022-02-15 14:08:24 -05:00
Alex Corey
170d95aa3c Fixes validator console error, and routing issue in Instance Groups branch 2022-02-15 13:07:36 -05:00
Alan Rominger
fe7a2fe229
Add loop label with docker-compose playbook 2022-02-15 13:05:59 -05:00
Amol Gautam
3f08e26881
Merge pull request #11571 from amolgautam25/tasks-refactor-2
Added new class for  Ansible Runner Callbacks
2022-02-15 10:31:32 -05:00
Alex Corey
9af2c92795
Merge pull request #11691 from AlexSCorey/11634-ContaineGroupNameFix
Fixes erroneous disabling of name input field on container and instance group forms
2022-02-14 16:14:32 -05:00
Alex Corey
dabae456d9
Merge pull request #11653 from AlexSCorey/11588-TopLevelInstances
Adds top level instances list
2022-02-14 16:06:55 -05:00
Alex Corey
c40785b6eb Fixes erroneous disabling of name input field on container and instance group forms 2022-02-14 15:47:50 -05:00
Alex Corey
e2e80313ac Refactor the health check button 2022-02-14 15:35:25 -05:00
Alex Corey
14a99a7b9e resolves advanced search button 2022-02-14 15:35:24 -05:00
Alex Corey
50e8c299c6 Adds top level instances list 2022-02-14 15:35:24 -05:00
Alex Corey
326d12382f
Adds Inventory labels (#11558)
* Adds inventory labels end point

* Adds label field to inventory form
2022-02-14 15:14:08 -05:00
Kersom
1de9dddd21
Merge pull request #11724 from nixocio/ui_issue_11708
Bump node to LTS version
2022-02-14 13:11:57 -05:00
nixocio
87b1f0d0de Bump node to LTS version
Bump node to LTS version
2022-02-14 12:41:11 -05:00
Kersom
f085afd92f
Merge pull request #11592 from nixocio/ui_issue_11017_utils
Modify usage of ansible_facts on advanced search
2022-02-14 10:30:45 -05:00
Elijah DeLee
604cbc1737
Consume control capacity (#11665)
* Select control node before start task

Consume capacity on control nodes for controlling tasks and consider
remainging capacity on control nodes before selecting them.

This depends on the requirement that control and hybrid nodes should all
be in the instance group named 'controlplane'. Many tests do not satisfy that
requirement. I'll update the tests in another commit.

* update tests to use controlplane

We don't start any tasks if we don't have a controlplane instance group

Due to updates to fixtures, update tests to set node type and capacity
explicitly so they get expected result.

* Fixes for accounting of control capacity consumed

Update method is used to account for currently consumed capacity for
instance groups in the in-memory capacity tracking data structure we initialize in
after_lock_init and then update via calculate_capacity_consumed (both in
task_manager.py)

Also update fit_task_to_instance to consider control impact on instances

Trust that these functions do the right thing looking for a
node with capacity, and cut out redundant check for the whole group's
capacity per Alan's reccomendation.

* Refactor now redundant code

Deal with control type tasks before we loop over the preferred instance
groups, which cuts out the need for some redundant logic.

Also, fix a bug where I was missing assigning the execution node in one case!

* set job explanation on tasks that need capacity

move the job explanation for jobs that need capacity to a function
so we can re-use it in the three places we need it.

* project updates always run on the controlplane

Instance group ordering makes no sense on project updates because they
always need to run on the control plane.

Also, since hybrid nodes should always run the control processes for the
jobs running on them as execution nodes, account for this when looking for a
execution node.

* fix misleading message

the variables and wording were both misleading, fix to be more accurate
description in the two different cases where this log may be emitted.

* use settings correctly

use settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME instead of a hardcoded
name
cache the controlplane_ig object during the after lock init to avoid
an uneccesary query
eliminate mistakenly duplicated AWX_CONTROL_PLANE_TASK_IMPACT and use
only AWX_CONTROL_NODE_TASK_IMPACT

* add test for control capacity consumption

add test to verify that when there are 2 jobs and only capacity for one
that one will move into waiting and the other stays in pending

* add test for hybrid node capacity consumption

assert that the hybrid node is used for both control and execution and
capacity is deducted correctly

* add test for task.capacity_type = control

Test that control type tasks have the right capacity consumed and
get assigned to the right instance group

Also fix lint in the tests

* jobs_running not accurate for control nodes

We can either NOT use "idle instances" for control nodes, or we need
to update the jobs_running property on the Instance model to count
jobs where the node is the controller_node.

I didn't do that because it may be an expensive query, and it would be
hard to make it match with jobs_running on the InstanceGroup which
filters on tasks assigned to the instance group.

This change chooses to stop considering "idle" control nodes an option,
since we can't acurrately identify them.

The way things are without any change, is we are continuing to over consume capacity on control nodes
because this method sees all control nodes as "idle" at the beginning
of the task manager run, and then only counts jobs started in that run
in the in-memory tracking. So jobs which last over a number of task
manager runs build up consuming capacity, which is accurately reported
via Instance.consumed_capacity

* Reduce default task impact for control nodes

This is something we can experiment with as far as what users
want at install time, but start with just 1 for now.

* update capacity docs

Describe usage of the new setting and the concept of control impact.

Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Rebeccah <rhunter@redhat.com>
2022-02-14 10:13:22 -05:00
Shane McDonald
60b6faff19
Merge pull request #11655 from ivarmu/devel
Let an organization admin to add new users to it's tower organization
2022-02-12 19:35:51 -05:00
Shane McDonald
e70059ed6b Fix image push when overriding awx_image_tag 2022-02-12 13:34:46 -05:00
Rebeccah Hunter
b26c1c16b9
Merge pull request #11728 from ansible/node_state_unhealthy_to_error
[mesh viz] change the term unhealthy to error
2022-02-11 16:02:43 -05:00
Rebeccah
c2bf9d94be
change the term unhealthy to error 2022-02-11 15:42:33 -05:00
Brandon Sharp
ea09adbbf3
Add await to handleLaunch (#11649)
* Add async to handleLaunch

* Fix package-lock

Co-authored-by: Wambugu  Kironji <wkironji@redhat.com>
2022-02-11 13:40:20 -05:00
Seth Foster
9d0de57fae
Merge pull request #11717 from fosterseth/emit_event_detail_metrics
Add metric for number of events emitted over websocket broadcast
2022-02-11 12:52:16 -05:00
nixocio
da733538c4 Modify usage of ansible_facts on advanced search
Modify usage of ansible_facts on advanced search, once `ansible_facts`
key is selected render a text input allowing the user to type special
query expected for ansible_facts.

This change will add more flexibility to the usage of ansible_facts when
creating a smart inventory.

See: https://github.com/ansible/awx/issues/11017
2022-02-11 10:24:04 -05:00
Seth Foster
6db7cea148
variable name changes 2022-02-10 10:57:00 -05:00
Seth Foster
3993aa9524
Add metric for number of events emitted over websocket broadcast 2022-02-09 21:57:01 -05:00
Alex Corey
6f9d4d89cd
Adds credential password step to ad hoc commands wizard (#11598) 2022-02-09 15:59:50 -05:00
Amol Gautam
443bdc1234 Decoupled callback functions from BaseTask Class
--- Removed all callback functions from 'jobs.py' and put them in a new file '/awx/main/tasks/callback.py'
--- Modified Unit tests unit moved
--- Moved 'update_model' from jobs.py to /awx/main/utils/update_model.py
2022-02-09 13:46:32 -05:00
Ivan Aragonés Muniesa
9cd43d044e let an organization admin to add new users to it's tower organization 2022-02-09 18:59:53 +01:00
Kersom
f8e680867b
Merge pull request #11710 from nixocio/ui_npm_audit
Run npm audit fix
2022-02-09 12:48:54 -05:00
Rebeccah Hunter
96a5540083
Merge pull request #11632 from ansible/minikube-docs-part-2
update minikube dev env docs with newer keywords for instantiate-awx-deployment.yml
2022-02-09 11:44:43 -05:00
Shane McDonald
750e1bd80a
Merge pull request #11342 from shanemcd/custom-uwsgi-mount-path
Allow for running AWX at non-root path (URL prefixing)
2022-02-09 10:37:04 -05:00
Jeff Bradberry
a12f161be5
Merge pull request #11711 from jbradberry/firehose-with-partitioning
Fix the firehose job creation script
2022-02-09 10:07:47 -05:00
Jeff Bradberry
04568ea830 Fix the firehose job creation script
to account for the changes made due to the job event table partitioning work.
2022-02-09 09:49:17 -05:00
nixocio
3be0b527d6 Run npm audit fix
Run npm audit fix

See: https://github.com/ansible/awx/issues/11709
2022-02-09 09:03:20 -05:00
Kersom
afc0732a32
Merge pull request #11568 from nixocio/ui_rs5
Bump react scripts to 5.0
2022-02-09 07:49:43 -05:00
nixocio
9703fb06fc Bump react scripts to 5.0
Bump react scripts to 5.0

See: https://github.com/ansible/awx/issues/11543

Bump eslint

Bump eslint and related plugins

Add @babe/core

Add @babe/core remove babel/core.

Rename .eslintrc to .eslintrc.json

Rename .eslintrc to .eslintrc.json

Add extra plugin

Move babe-plugin-macro as dev dependencies

Move babe-plugin-macro as dev dependencies

Add preset-react

Add preset-react

Fixing lint errors

Fixing lint errors

Run eslint --fix

Run eslint --fix

Turn no-restricted-exports off

Turn no-restricted-exports off

Revert "Run eslint --fix"

This reverts commit e760885b6c199f2ca18091088cb79bfa77c1d3ed.

Run --fix

Run --fix

Fix lint errors

Also bump specificity of Select CSS border component to avoid bug of
missing borders.

Also update API tests related to lincenses.
2022-02-08 11:12:51 -05:00
Shane McDonald
54cbf13219
Merge pull request #11696 from sean-m-sullivan/awx_collection_role_update_v2
add execution_environment_admin to role module
2022-02-08 10:12:00 -05:00
Shane McDonald
6774a12c67
Merge pull request #11694 from shanemcd/scoped-schema
Scope schema.json to target branch
2022-02-08 09:48:08 -05:00
Sean Sullivan
94e53d988b add execution adminitrator to role module 2022-02-08 09:44:50 -05:00
Shane McDonald
22d47ea8c4
Update port binding for UI dev tooling
Jake says "Folks sometimes run the ui dev server independently of the tools_awx container"

Co-authored-by: Jake McDermott <9753817+jakemcdermott@users.noreply.github.com>
2022-02-08 08:33:21 -05:00
Sarah Akus
73bba00cc6
Merge pull request #11670 from keithjgrant/11628-missing-job-output
Display all job type events in job output
2022-02-07 18:04:18 -05:00
Shane McDonald
6ed429ada2 Scope api schema.json to target branch 2022-02-07 17:54:01 -05:00
Keith J. Grant
d2c2d459c4 display all job type events in job output 2022-02-07 14:48:39 -08:00
John Westcott IV
c8b906ffb7
Workflow changes (#11692)
Modifying workflows to install python for make commands
Squashing CI tasks to remove repeated steps
Modifying pre-commit.sh to not fail if there are no python file changes
2022-02-07 15:42:35 -05:00