Files
awx/requirements/requirements.txt
Alan Rominger 94764a1f17 AAP-42649 Flag-gated use of "dispatcherd" as its own library (#15981)
Use dynamic AWX max_workers value

Make basic --status and --running commands work

Make feature flag enabled true by default for development

* [dispatcherd] Dispatcher socket-based `--status` demo working (#15908)

* Fix Task Decorator to Work With and Without Feature Flag (AAP-41775) (#15911)

* refactor(system): extract common heartbeat helpers and split cluster_node_heartbeat

Extract common heartbeat logic into helper functions:  _heartbeat_instance_management: consolidates instance management, health checks, and lost-instance detection.  _heartbeat_check_versions: compares instance versions and initiates shutdown when necessary.  _heartbeat_handle_lost_instances: reaps jobs and marks lost instances offline.

Refactor the original cluster_node_heartbeat to use these helpers and retain legacy behavior (using bind_kwargs).

Introduce adispatch_cluster_node_heartbeat for dispatcherd: uses the control API to retrieve running tasks and reaps them.

Link the two implementations by attaching adispatch_cluster_node_heartbeat as the _new_method on cluster_node_heartbeat.

* feat(publish): delegate heartbeat task submission to new dispatcherd implementation

Update apply_async to check at runtime if FEATURE_NEW_DISPATCHER is enabled.

When the task is cluster_node_heartbeat and a _new_method is attached, delegate the task submission to the new dispatcherd implementation.

Preserve the original behavior for all other tasks and fallback on error.

* refactor(system): extract task ID retrieval from dispatcherd into helper function

Improves readability of adispatch_cluster_node_heartbeat by extracting
the complex UUID parsing logic into a dedicated helper function.
Adds clearer error handling and follows established code patterns.

* fix(dispatcher): Enable task decorator to work with and without feature flag

Implemented a new approach for handling task execution with feature flags
by attaching alternative implementations to apply_async._new_method. This
allows cluster_node_heartbeat to work correctly with both the legacy and
new dispatcher systems without modifying core decorator logic.

AAP-41775

* fix(dispatcher): Improve error handling and logging in feature flag implementation

- Add error handling when attaching alternative dispatcher implementation
- Fix method self-reference in apply_async to properly use cls.apply_async
- Document limitations of this targeted approach for specific tasks
- Add logging for better debugging of dispatcher selection
- Ensure decorator timing by keeping method attachment after function definitions

This completes the robust implementation for switching between dispatcher
implementations based on feature flags.

AAP-41775

* fix(dispatcher): Implement registry pattern for dispatcher feature flag compatibility

Replaces direct method attribute assignment with a global registry for
alternative implementations. The original approach tried to attach new
methods directly to apply_async bound methods, which fails because bound
methods don't support attribute assignment in Python.

The registry pattern:
- Creates a global ALTERNATIVE_TASK_IMPLEMENTATIONS dict in publish.py
- Registers alternative implementations by task name
- Modifies apply_async to check the registry when feature flag is enabled
- Adds extensive logging throughout the process for debugging

This enables cluster_node_heartbeat to work correctly with both the legacy
and new dispatcher implementations based on the FEATURE_NEW_DISPATCHER flag.

AAP-41775

* refactor(dispatcher): Remove excessive logging from dispatcher implementation

Reduces verbose debugging logs while maintaining essential logging for critical
operations. Preserves:
- Task implementation selection based on feature flag
- Registration success/failure messages
- Critical error reporting

Removed:
- Registry content debugging messages
- Repetitive task diagnostics
- Non-essential information logging

AAP-41775

* fix(dispatcher): Fix shallow copy in dispatcher schedule conversion

This resolves "AttributeError: 'float' object has no attribute 'total_seconds'"
errors when the dispatcher is restarted.

Refs: AAP-41775

* Use IPC mechanism to get running tasks (#15926)
* Allow tasks from tasks
* Fix failure to limit to waiting jobs
* Get job record with lock
* Fix failures in dispatcherd feature branch (#15930)
* Fully handle DispatcherCancel
* Complete rest of preload import work
* Complete dispatcherd integration & job cancellation (AAP-43033) (#15941)
* feat(dispatcher): Implement job cancellation for new dispatcher

Adds feature-flag-aware job cancellation that routes cancel requests to either
the legacy dispatcher or the new dispatcherd library based on the
FEATURE_NEW_DISPATCHER flag.

- Updates cancel_dispatcher_process() to use dispatcherd's control API when enabled
- Handles both direct cancellation and task manager workflow cancellation cases
- Works with DispatcherCancel exception handling to properly handle SIGUSR1 signals

AAP-43033

* fix(dispatcher): Update run_dispatcher.py to properly handle task cancellation

Modifies the cancel command in run_dispatcher.py to properly cancel tasks
when the FEATURE_NEW_DISPATCHER flag is enabled, rather than just listing
running tasks.

The implementation translates each task UUID to the appropriate
filter format expected by the dispatcherd control API, maintaining the same
behavior as the original implementation.

Part of: AAP-43033

* refactor(system): Refactor dispatch_startup() to extract common startup logic and branch based on feature flag

This commit refactors the dispatch_startup() function to improve clarity and consistency across the legacy
and new dispatcherd flows.

No dispatcher-specific functionality is needed beyond the changes made, so this refactoring improves robustness without
altering core behavior.

* refactor(system): Refactor inform_cluster_of_shutdown() for clarity

* refactor(tasks): Replace @task with @task_awx across 22 tasks for dispatcher compatibility

- Migrated all task decorators to use @task_awx, ensuring dispatcher-aware behavior.
- Tested each task with the new dispatcherd, verifying that tasks using the registry pattern execute correctly without needing binder‐based alternative implementations.
- Removed redundant logging and outdated comments.
- Legacy tasks that do not require special parameter extraction continue to use their original logic.
- This commit reflects our complete journey of testing and verifying dispatcherd compatibility across all 22 tasks.

* refactor(publish): fix linter

* Fix bug from the branch rebase

* AAP-43763 Add tests for connection management in dispatcherd workers (#15949)

* Add test for job cancel in live tests
* Fix bug from the branch rebase
* Add test for connection recovery after connection broke
* Add test for breaking connection

* Fix dispatcherd bugs: schedule aliases, job kwargs handling, cancel handling (#15960)

* Put in job kwargs handling, not done before

* AAP-44382 [dispatcherd] Fixes for running with feature flag off (#15973)

* Use correct decorator for test of tasks

* Finalize dispatcherd feature branch (#15975)

* Work dispatcherd into dependency management system

* Use util methods from DAB

* Rename the dispatcherd feature flag, and flip default to not-enabled

* Move to new submit_task method

* Update the location of the sock file

* AAP-44381 Make dispatcherd config loading more lazy (#15979)

* Make dispatcherd config loading more lazy

* Make submission error more obvious

* Fix signal handling gap, hijack SIGUSR1 from dispatcherd (#15983)

* Fix signal handling gap, hijack SIGUSR1 from dispatcherd

* Minor adjustments to dispatcherd status command

* [dispatcherd] Get rid of alternative task registry (#15984)

Get rid of alternative task registry

* Fix deadlock error and other cleanup errors (#15987)
* Move to proper error handling location

---------

Co-authored-by: artem_tiupin <70763601+art-tapin@users.noreply.github.com>
2025-05-16 09:39:22 -04:00

562 lines
14 KiB
Plaintext

adal==1.2.7
# via msrestazure
aiodns==3.2.0
# via aiohttp
aiofiles==24.1.0
# via opa-python-client
aiohappyeyeballs==2.4.4
# via aiohttp
aiohttp[speedups]==3.11.11
# via
# -r /awx_devel/requirements/requirements.in
# aiohttp-retry
# opa-python-client
# twilio
aiohttp-retry==2.8.3
# via twilio
aiosignal==1.3.2
# via aiohttp
ansi2html==1.9.2
# via -r /awx_devel/requirements/requirements.in
# git+https://github.com/ansible/ansible-runner.git@devel # git requirements installed separately
# via -r /awx_devel/requirements/requirements_git.txt
asciichartpy==1.5.25
# via -r /awx_devel/requirements/requirements.in
asgiref==3.8.1
# via
# channels
# channels-redis
# daphne
# django
# django-ansible-base
# django-cors-headers
asn1==2.7.1
# via -r /awx_devel/requirements/requirements.in
attrs==24.3.0
# via
# aiohttp
# jsonschema
# referencing
# service-identity
# twisted
autobahn==24.4.2
# via daphne
autocommand==2.2.2
# via jaraco-text
automat==24.8.1
# via twisted
# awx-plugins-core @ git+https://github.com/ansible/awx-plugins.git@devel # git requirements installed separately
# via -r /awx_devel/requirements/requirements_git.txt
awx-plugins.interfaces @ git+https://github.com/ansible/awx_plugins.interfaces.git
# via
# -r /awx_devel/requirements/requirements_git.txt
# awx-plugins-core
azure-core==1.32.0
# via
# azure-identity
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
# msrest
azure-identity==1.19.0
# via -r /awx_devel/requirements/requirements.in
azure-keyvault==4.2.0
# via -r /awx_devel/requirements/requirements.in
azure-keyvault-certificates==4.9.0
# via azure-keyvault
azure-keyvault-keys==4.10.0
# via azure-keyvault
azure-keyvault-secrets==4.9.0
# via azure-keyvault
backports-tarfile==1.2.0
# via jaraco-context
boto3==1.35.96
# via -r /awx_devel/requirements/requirements.in
botocore==1.35.96
# via
# -r /awx_devel/requirements/requirements.in
# boto3
# s3transfer
brotli==1.1.0
# via aiohttp
cachetools==5.5.0
# via google-auth
# git+https://github.com/ansible/system-certifi.git@devel # git requirements installed separately
# via
# -r /awx_devel/requirements/requirements_git.txt
# kubernetes
# msrest
# requests
cffi==1.17.1
# via
# cryptography
# pycares
# pynacl
channels==4.2.0
# via
# -r /awx_devel/requirements/requirements.in
# channels-redis
channels-redis==4.2.1
# via -r /awx_devel/requirements/requirements.in
charset-normalizer==3.4.1
# via requests
click==8.1.8
# via receptorctl
constantly==23.10.4
# via twisted
cryptography==41.0.7
# via
# -r /awx_devel/requirements/requirements.in
# adal
# autobahn
# azure-identity
# azure-keyvault-keys
# django-ansible-base
# jwcrypto
# msal
# pyjwt
# pyopenssl
# service-identity
cython==3.0.11
# via -r /awx_devel/requirements/requirements.in
daphne==4.1.2
# via -r /awx_devel/requirements/requirements.in
deprecated==1.2.15
# via
# opentelemetry-api
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-semantic-conventions
# pygithub
dispatcherd==2025.5.12
# via -r /awx_devel/requirements/requirements.in
distro==1.9.0
# via -r /awx_devel/requirements/requirements.in
django==4.2.20
# via
# -r /awx_devel/requirements/requirements.in
# channels
# django-ansible-base
# django-cors-headers
# django-crum
# django-extensions
# django-flags
# django-guid
# django-oauth-toolkit
# django-polymorphic
# django-solo
# djangorestframework
# django-ansible-base @ git+https://github.com/ansible/django-ansible-base@devel # git requirements installed separately
# via -r /awx_devel/requirements/requirements_git.txt
django-cors-headers==4.6.0
# via -r /awx_devel/requirements/requirements.in
django-crum==0.7.9
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
django-extensions==3.2.3
# via -r /awx_devel/requirements/requirements.in
django-flags==5.0.13
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
django-guid==3.5.0
# via -r /awx_devel/requirements/requirements.in
django-oauth-toolkit==1.7.1
# via -r /awx_devel/requirements/requirements.in
django-polymorphic==3.1.0
# via -r /awx_devel/requirements/requirements.in
django-solo==2.4.0
# via -r /awx_devel/requirements/requirements.in
djangorestframework==3.15.2
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
djangorestframework-yaml==2.0.0
# via -r /awx_devel/requirements/requirements.in
durationpy==0.9
# via kubernetes
dynaconf==3.2.10
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
enum-compat==0.0.3
# via asn1
filelock==3.16.1
# via -r /awx_devel/requirements/requirements.in
frozenlist==1.5.0
# via
# aiohttp
# aiosignal
gitdb==4.0.12
# via gitpython
gitpython==3.1.44
# via -r /awx_devel/requirements/requirements.in
google-auth==2.37.0
# via kubernetes
googleapis-common-protos==1.66.0
# via
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
grpcio==1.69.0
# via
# -r /awx_devel/requirements/requirements.in
# opentelemetry-exporter-otlp-proto-grpc
hiredis==3.1.0
# via redis
hyperlink==21.0.0
# via
# autobahn
# twisted
idna==3.10
# via
# hyperlink
# requests
# twisted
# yarl
importlib-metadata==8.5.0
# via opentelemetry-api
importlib-resources==6.5.2
# via irc
incremental==24.7.2
# via twisted
inflection==0.5.1
# via django-ansible-base
irc==20.5.0
# via -r /awx_devel/requirements/requirements.in
isodate==0.7.2
# via
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
# msrest
jaraco-collections==5.1.0
# via irc
jaraco-context==6.0.1
# via jaraco-text
jaraco-functools==4.1.0
# via
# irc
# jaraco-text
# tempora
jaraco-logging==3.3.0
# via irc
jaraco-stream==3.0.4
# via irc
jaraco-text==4.0.0
# via
# irc
# jaraco-collections
jinja2==3.1.5
# via -r /awx_devel/requirements/requirements.in
jmespath==1.0.1
# via
# boto3
# botocore
jq==1.8.0
# via -r /awx_devel/requirements/requirements.in
json-log-formatter==1.1
# via -r /awx_devel/requirements/requirements.in
jsonschema==4.23.0
# via -r /awx_devel/requirements/requirements.in
jsonschema-specifications==2024.10.1
# via jsonschema
jwcrypto==1.5.6
# via django-oauth-toolkit
kubernetes==31.0.0
# via openshift
lockfile==0.12.2
# via python-daemon
markdown==3.7
# via -r /awx_devel/requirements/requirements.in
markupsafe==3.0.2
# via jinja2
maturin==1.8.1
# via -r /awx_devel/requirements/requirements.in
more-itertools==10.5.0
# via
# irc
# jaraco-functools
# jaraco-stream
# jaraco-text
msal==1.31.1
# via
# azure-identity
# msal-extensions
msal-extensions==1.2.0
# via azure-identity
msgpack==1.1.0
# via
# -r /awx_devel/requirements/requirements.in
# channels-redis
msrest==0.7.1
# via msrestazure
msrestazure==0.6.4.post1
# via -r /awx_devel/requirements/requirements.in
multidict==6.1.0
# via
# aiohttp
# yarl
oauthlib==3.2.2
# via
# django-oauth-toolkit
# kubernetes
# requests-oauthlib
opa-python-client==2.0.2
# via -r /awx_devel/requirements/requirements.in
openshift==0.13.2
# via -r /awx_devel/requirements/requirements.in
opentelemetry-api==1.29.0
# via
# -r /awx_devel/requirements/requirements.in
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-instrumentation
# opentelemetry-instrumentation-logging
# opentelemetry-sdk
# opentelemetry-semantic-conventions
opentelemetry-exporter-otlp==1.29.0
# via -r /awx_devel/requirements/requirements.in
opentelemetry-exporter-otlp-proto-common==1.29.0
# via
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
opentelemetry-exporter-otlp-proto-grpc==1.29.0
# via opentelemetry-exporter-otlp
opentelemetry-exporter-otlp-proto-http==1.29.0
# via opentelemetry-exporter-otlp
opentelemetry-instrumentation==0.50b0
# via opentelemetry-instrumentation-logging
opentelemetry-instrumentation-logging==0.50b0
# via -r /awx_devel/requirements/requirements.in
opentelemetry-proto==1.29.0
# via
# opentelemetry-exporter-otlp-proto-common
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
opentelemetry-sdk==1.29.0
# via
# -r /awx_devel/requirements/requirements.in
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
opentelemetry-semantic-conventions==0.50b0
# via
# opentelemetry-instrumentation
# opentelemetry-sdk
packaging==24.2
# via
# ansible-runner
# opentelemetry-instrumentation
# setuptools-scm
pexpect==4.7.0
# via
# -r /awx_devel/requirements/requirements.in
# ansible-runner
pkgconfig==1.5.5
# via -r /awx_devel/requirements/requirements.in
portalocker==2.10.1
# via msal-extensions
prometheus-client==0.21.1
# via -r /awx_devel/requirements/requirements.in
propcache==0.2.1
# via
# aiohttp
# yarl
protobuf==5.29.3
# via
# googleapis-common-protos
# opentelemetry-proto
psutil==6.1.1
# via -r /awx_devel/requirements/requirements.in
psycopg==3.2.6
# via -r /awx_devel/requirements/requirements.in
ptyprocess==0.7.0
# via pexpect
pyasn1==0.6.1
# via
# pyasn1-modules
# rsa
# service-identity
pyasn1-modules==0.4.1
# via
# google-auth
# service-identity
pycares==4.5.0
# via aiodns
pycparser==2.22
# via cffi
pygerduty==0.38.3
# via -r /awx_devel/requirements/requirements.in
pygithub==2.6.1
# via awx-plugins-core
pyjwt[crypto]==2.10.1
# via
# adal
# django-ansible-base
# msal
# pygithub
# twilio
pynacl==1.5.0
# via pygithub
pyopenssl==24.3.0
# via
# -r /awx_devel/requirements/requirements.in
# twisted
pyparsing==2.4.6
# via -r /awx_devel/requirements/requirements.in
python-daemon==3.1.2
# via
# -r /awx_devel/requirements/requirements.in
# ansible-runner
python-dateutil==2.9.0.post0
# via
# adal
# botocore
# kubernetes
# receptorctl
# tempora
python-dsv-sdk==1.0.4
# via -r /awx_devel/requirements/requirements.in
python-string-utils==1.0.0
# via openshift
python-tss-sdk==1.2.3
# via -r /awx_devel/requirements/requirements.in
pytz==2024.2
# via irc
pyyaml==6.0.2
# via
# -r /awx_devel/requirements/requirements.in
# ansible-runner
# dispatcherd
# djangorestframework-yaml
# kubernetes
# receptorctl
pyzstd==0.16.2
# via -r /awx_devel/requirements/requirements.in
receptorctl==1.5.2
# via -r /awx_devel/requirements/requirements.in
redis[hiredis]==5.2.1
# via
# -r /awx_devel/requirements/requirements.in
# channels-redis
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
requests==2.32.3
# via
# -r /awx_devel/requirements/requirements.in
# adal
# azure-core
# django-ansible-base
# django-oauth-toolkit
# kubernetes
# msal
# msrest
# opa-python-client
# opentelemetry-exporter-otlp-proto-http
# pygithub
# python-dsv-sdk
# python-tss-sdk
# requests-oauthlib
# twilio
requests-oauthlib==2.0.0
# via
# kubernetes
# msrest
rpds-py==0.22.3
# via
# jsonschema
# referencing
rsa==4.9
# via google-auth
s3transfer==0.10.4
# via boto3
semantic-version==2.10.0
# via setuptools-rust
service-identity==24.2.0
# via twisted
setuptools-rust==1.10.2
# via -r /awx_devel/requirements/requirements.in
setuptools-scm[toml]==8.1.0
# via -r /awx_devel/requirements/requirements.in
six==1.17.0
# via
# azure-core
# kubernetes
# msrestazure
# openshift
# pygerduty
# python-dateutil
slack-sdk==3.34.0
# via -r /awx_devel/requirements/requirements.in
smmap==5.0.2
# via gitdb
sqlparse==0.5.3
# via
# -r /awx_devel/requirements/requirements.in
# django
# django-ansible-base
tempora==5.8.0
# via
# irc
# jaraco-logging
twilio==9.4.2
# via -r /awx_devel/requirements/requirements.in
twisted[tls]==24.11.0
# via
# -r /awx_devel/requirements/requirements.in
# daphne
txaio==23.1.1
# via autobahn
typing-extensions==4.12.2
# via
# azure-core
# azure-identity
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
# jwcrypto
# opentelemetry-sdk
# psycopg
# pygithub
# twisted
urllib3==2.3.0
# via
# botocore
# django-ansible-base
# kubernetes
# pygithub
# requests
uwsgi==2.0.28
# via -r /awx_devel/requirements/requirements.in
uwsgitop==0.12
# via -r /awx_devel/requirements/requirements.in
websocket-client==1.8.0
# via kubernetes
wheel==0.45.1
# via -r /awx_devel/requirements/requirements.in
wrapt==1.17.0
# via
# deprecated
# opentelemetry-instrumentation
yarl==1.18.3
# via aiohttp
zipp==3.21.0
# via importlib-metadata
zope-interface==7.2
# via twisted
# The following packages are considered to be unsafe in a requirements file:
pip==21.2.4
# via -r /awx_devel/requirements/requirements.in
setuptools==70.3.0
# via
# -r /awx_devel/requirements/requirements.in
# asciichartpy
# autobahn
# incremental
# setuptools-rust
# setuptools-scm
# zope-interface