30623 Commits

Author SHA1 Message Date
Alan Rominger
2eb1e4bbe3
Add OPTIONS documentation for new job limit feature 2021-06-07 11:11:22 -04:00
Shane McDonald
d3b20e6585
Merge pull request #10362 from shanemcd/runner-alpha-5
Bump to Ansible Runner alpha 5 release
2021-06-04 16:51:19 -04:00
nixocio
310cc2fd03 Update message for missing EE for Job pages
Update message for missing EE for Job pages

See: https://github.com/ansible/awx/issues/10355
2021-06-04 16:04:39 -04:00
softwarefactory-project-zuul[bot]
1fd6ba0bfc
Merge pull request #10349 from AlexSCorey/8401-MoreFiltersonDashboard
Adds more filters to dashboard chart

SUMMARY
Resolves #8401 and #10356
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

AWX VERSION



ADDITIONAL INFORMATION

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-06-04 19:56:10 +00:00
softwarefactory-project-zuul[bot]
b64f966db1
Merge pull request #10090 from rebeccahhh/custom_venv_command
add a new awx-manage command `custom_venvs`

add an awx-manage command that gets pip freeze data from custom_venv and outputs to command line stdout
SUMMARY

part of #7062  - this command is a glorified pip freeze + some extra stuff, people could navigate to each of their custom virtual environments themselves and run a pip freeze, but this allows them to not, and everyone likes their life to be easier. The extra stuff allows users to see the connections that their existing virtual envs have in awx to things like organizations, jobs, inventory updates, and projects.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.1.0

ADDITIONAL INFORMATION

This is built off of existing code and there is a line that gets custom venv paths from the settings module, that line does not seem to be working. I have written around that but want to make a note of it.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
2021-06-04 18:44:52 +00:00
softwarefactory-project-zuul[bot]
891eeb22a5
Merge pull request #10343 from chrismeyersfsu/doc-job_event_performance
add docs on debugging job event perf

related to ansible/tower#4985

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-06-04 17:17:16 +00:00
softwarefactory-project-zuul[bot]
0f6e221c14
Merge pull request #10023 from ansible/db_partition_analytics_cmeyers2
Db partition analytics cmeyers2

Keep old primary key based analytics gathering for unpartitioned
tables.
Use created time on new partitioned tables.

80 million partitioned + 1.5 million unpartitioned Events



Query
awx-manage gather_analytics --dry-run Time
Micro Benchmark Query Time*
Query Only Time**




sequential index scan, multiple ::json casts, 100,000 event batches
102m7.836s
6s
80 minutes


sequential index scan, optimized json cast, 100,000 event batches
48m9.276s
2.2s
30.4 minutes


sequential index scan, optimized json cast, 1,00,000 event batches
39m35.094s
10s
13.3 minutes


sequential table scan, optimized json cast, per-partition batch 600,000 ***
36m42.081s
11.5s
25.5 minutes



*micro benchmarking consists of simply copying a query, running it manually, and observing the runtime.
**micro benchmark time x (80 million / batch size)
**Note that this testing does NOT include the extra modified range query that is needed for correctness. We expect this to be quite fast and is only needed to catch edge case events.

Reviewed-by: Ladislav Smola <lsmola@redhat.com>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
2021-06-04 16:48:11 +00:00
Shane McDonald
239f20ede5
Bump to Ansible Runner alpha 5 release 2021-06-04 12:22:53 -04:00
Chris Meyers
ffbbcd2bf6 fix tests, add pagination tests
* job_created is a fake field as far as Django is concerned. Under the
hood, in postgres, this is the partition key so it is real. sqlite
doesn't support partitioning so we need to fake some things.
Specifically, we need to remove job_created from being auto-added to
get_event_queryset()
* Add pagination tests for <unified_job_name>/<id>/<job_events>?limit=x
endpoint to make sure the paginator is wired up.
2021-06-04 09:17:09 -07:00
Jake McDermott
b648957c8e Update pagination scheme for jobs
* Use an initial request for max event `counter` to get the total row count,
otherwise rely on websocket message counters to update remote row count

* For running jobs, request event ranges with counters to handle events getting
saved to db out of display order

* For jobs that are no longer running, continue to use page/pageSize scheme for
paging through the job events
2021-06-04 09:17:09 -07:00
Jim Ladd
31fe500921 move get_queryset handling to child view 2021-06-04 09:17:09 -07:00
Chris Meyers
2131703ca0 add/remove indexes, more get_event_querset()
* Do not cascade delete unified job events. We will clean those up in
cleanup_job runs
* Add limit pagination to all unified job events endpoints
2021-06-04 09:17:09 -07:00
Jim Ladd
c429563126 update view to handle hosts/N/ad_hoc_command_events 2021-06-04 09:17:09 -07:00
Chris Meyers
1a1d66d2a2 bump db partition migration 2021-06-04 09:17:09 -07:00
Chris Meyers
30871bd6cf close db and cache connection in new threads 2021-06-04 09:17:09 -07:00
Chris Meyers
321135da3d add limit pagination to jobs/<id>/job_events/
* trigger via jobs/<id>/job_events/?limit=10
* Can and should be used in conjunction with an indexed set of fields to
generate efficient pagination queries. i.e.
jobs/<id>/job_events?limit=10&start_line__gte=10
* If limit is not specified in the query params then the default
pagination will be used.
2021-06-04 09:17:09 -07:00
Jim Ladd
2a23b4c719 bump migration 2021-06-04 09:17:09 -07:00
Jim Ladd
f7d2f7a5e6 lint 2021-06-04 09:17:09 -07:00
Jim Ladd
e371de38ed update job cleanup tests for sqlite-based execution 2021-06-04 09:17:09 -07:00
Jim Ladd
84af610a1f remove rebase cruft 2021-06-04 09:17:09 -07:00
Jim Ladd
ef9f9129ba bump migration 2021-06-04 09:17:09 -07:00
Jim Ladd
7b188aafea lint 2021-06-04 09:17:09 -07:00
Chris Meyers
6ce227a6b6 bump migrations 2021-06-04 09:17:09 -07:00
Chris Meyers
1c97b9a046 no longer get the size of the gather set
* Before, we would get the min and max pk of the set we are to gather.
This changeset removes that.
* Before, we would, basically, know the size of the set we are to gather
and would query 100,000 of those job event records at a time. That logic
is now gone.
* Now, for unpartitioned job events we gather 4 hours at a time by
created time.
* Now, for partitioned job events we gather 4 hours at a time by
modified time.
2021-06-04 09:17:09 -07:00
Chris Meyers
137111351c bump migrations after devel rebase 2021-06-04 09:17:09 -07:00
Chris Meyers
c5a1e4c704 remove order by from partitioned events query
* The order by results in an in-memory sort that COULD blow out the
worker mem buffer and result in sorting having to take place on disk.
* This WILL happen with a default postgres 4MB mem buffer. We saw as
much as 20MB used. Note that AWX defaults postgres mem worker buffer to
3% of the DB memory on external installs and 1% on same-node installs.
So for a 16GB remote DB this would not be a problem.
* We are going to avoid this problem all together by NOT doing a sort
when gathering. Instead, we will sort remotely, in analytics.
2021-06-04 09:17:09 -07:00
Chris Meyers
4f058245e4 conditionally project job_created
* Old, _unpartitioned_main_jobevent table does not have the job_created
column
* New, main_jobevent does.
* Always in clude the job_created column. NULL if old, job_created if
new
* Bump events_table schema version from 1.2 to 1.3 because of the
job_created field
2021-06-04 09:17:08 -07:00
Chris Meyers
ecdf6cccf8 json cast optimization
* We found that having multiple `::json` casts in a query slows down
queries more and more by =~> 33%.
* This change coerces postgres into only casting once. Micro
benchmarking shows =~ 2-3x performance boost
2021-06-04 09:17:08 -07:00
Chris Meyers
4d7edbbad0 analytics support for db partitions
* Keep old primary key based analytics gathering for unpartitioned
tables.
* Use created time on new partitioned tables.
2021-06-04 09:17:08 -07:00
Jim Ladd
0f9f3f58e2 bump migration 2021-06-04 09:17:08 -07:00
Chris Meyers
34c4967d27 Revert "query for jobevents based on table location"
This reverts commit 278dc521fffb85d4faa023ccd634044cfd3b3d75.
2021-06-04 09:17:08 -07:00
Jim Ladd
6123b8e148 query for jobevents based on table location
* pre-migration jobevents live in unpartitioned table
  where only created field has index
* post-migration jobevents live in partitions
  where modified field has index
  (and should be used to ensure no events are missing)
2021-06-04 09:17:08 -07:00
Jim Ladd
b86d365dde collect job events based on job event modified time
* when collecting job events by creation time
  it is possible to miss events that were created
  at one point, but actually committed to the db
  much later.
* since events' modified time is set when they are
  committed to the db, we shouldn't miss any job events
* selecting job events by modified time wasn't possible
  beforehand because we didn't have an index for
  jobevent's modified field
2021-06-04 09:17:08 -07:00
Chris Meyers
4efbd45b3c add support for db partition in cleanup_jobs
Changes in old unpartitioned cleanup logic:
* Manually cascade delete events related to job(s)

(new partitions cleanup logic) For each event type:
* Get the event partitions that are within the cleanup date range
* Get a list of jobs to delete that are in the cutoff range.
* Jobs that are running, pending, or waiting in the job list are special.
* Use the special list to further filter the partition drop list.
* Drop partitions
* delete jobs
2021-06-04 09:17:08 -07:00
Jim Ladd
fb97687d14 lint 2021-06-04 09:17:08 -07:00
Jim Ladd
0f53d9b911 bump db partition migration 2021-06-04 09:17:08 -07:00
Jim Ladd
5a785798b0 is_partitioned should default to true when pk not set 2021-06-04 09:17:08 -07:00
Jim Ladd
14168297bd set event horizon to -1 for empty tables 2021-06-04 09:17:08 -07:00
Jim Ladd
7e1814e234 mock has_unpartitioned_events in collection tests
.. just like we do with the main awx tests
2021-06-04 09:17:08 -07:00
Jim Ladd
bdf11aa962 add migrations for Unpartitioned{Job}Event proxy models 2021-06-04 09:17:08 -07:00
Jim Ladd
46807205f8 Move created kwargs to right place 2021-06-04 09:17:08 -07:00
Jim Ladd
d749c172eb Ensure View.model exists before checking type 2021-06-04 09:17:08 -07:00
Jim Ladd
81db8091ea test updates
* when tests create a UnifiedJob and JobEvent,
  the two need to have the same value for job creation time
* some view validation was skipped due to `model` being
  a property in some cases now
2021-06-04 09:17:08 -07:00
Jim Ladd
5c1a33382c update mocks to reflect new migration
* instead of mocking `created_or_epoch` (which no longer exists)
* .. mock `Unified_Job.has_unpartitioned_events`
2021-06-04 09:17:08 -07:00
Jim Ladd
db6f565dca black formatting 2021-06-04 09:17:08 -07:00
Jim Ladd
6b4effc85a bump partition migration to 135 2021-06-04 09:17:08 -07:00
Jim Ladd
74a0c5bac5 Minor rebase fallout
* fix import
* remove dropped url
2021-06-04 09:17:08 -07:00
Jim Ladd
661cf0afb3 short-circuit event_processing_finished for wf jobs
* wf jobs are a wrapper for other jobs
* they do not process their own job events
2021-06-04 09:17:08 -07:00
Ryan Petrello
fbb74a9896 remove code that leaves behind old bigint tables on fresh installs
we don't need this code at all anymore - the bigint migration is long
gone, and anybody upgrading to this version of AWX has already
migrated their data
2021-06-04 09:17:08 -07:00
Ryan Petrello
200901e53b upgrade to partitions without a costly bulk data migration
keep pre-upgrade events in an old table (instead of a partition)

- instead of creating a default partition, keep all events in special
"unpartitioned" tables
- track these tables via distinct proxy=true models
- when generating the queryset for a UnifiedJob's events, look at the
  creation date of the job; if it's before the date of the migration,
  query on the old unpartitioned table, otherwise use the more modern table
  that provides auto-partitioning
2021-06-04 09:17:08 -07:00