Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][From @nzlosh] Interoperability updates for py3.8, py3.9 and py3.10 #6223

Closed
wants to merge 65 commits into from

Conversation

FileMagic
Copy link
Contributor

Based on the updates done in #6157, I merged in the changes that @cognifloyd did on master into the changes that @nzlosh was working on. From here I am going to update things until unit tests work properly on python 3.8-3.10.

nzlosh and others added 14 commits April 3, 2024 09:40
Note that this only adjusts interpreter constraints.
python 3.10 is not officially supported yet.

Lockfile diff: lockfiles/st2.lock [st2]

==                    Upgraded dependencies                     ==

  orjson                         3.10.1       -->   3.10.2

Lockfile diff: lockfiles/bandit.lock [bandit]

==                    Upgraded dependencies                     ==

  setuptools                     69.2.0       -->   69.5.1

Lockfile diff: lockfiles/flake8.lock [flake8]

==                    Upgraded dependencies                     ==
  setuptools                     69.2.0       -->   69.5.1

Lockfile diff: lockfiles/black.lock [black]

==                    Upgraded dependencies                     ==

  platformdirs                   4.2.0        -->   4.2.1
  typing-extensions              4.10.0       -->   4.11.0

Lockfile diff: lockfiles/pytest.lock [pytest]

==                    Upgraded dependencies                     ==

  coverage                       7.4.4        -->   7.5.0
  execnet                        2.0.2        -->   2.1.1
  pluggy                         1.4.0        -->   1.5.0

Lockfile diff: lockfiles/twine.lock [twine]

==                    Upgraded dependencies                     ==

  idna                           3.6          -->   3.7
  jaraco-context                 4.3.0        -->   5.3.0
  jaraco-functools               4.0.0        -->   4.0.1
  keyring                        25.1.0       -->   25.2.0

==                      Added dependencies                      ==

  backports-tarfile              1.1.1

Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pluggy                         1.4.0        -->   1.5.0
Lockfile diff: lockfiles/st2.lock [st2]

==                    Upgraded dependencies                     ==

  bcrypt                         4.1.2        -->   4.1.3
  chardet                        3.0.4        -->   5.2.0
  cryptography                   42.0.5       -->   42.0.7
  dnspython                      1.16.0       -->   2.6.1
  flask                          2.1.3        -->   3.0.3
  jinja2                         3.1.3        -->   3.1.4
  markupsafe                     2.0.1        -->   2.1.5
  networkx                       2.8.8        -->   3.1
  orjson                         3.10.2       -->   3.10.3
  platformdirs                   4.2.1        -->   4.2.2
  pygments                       2.17.2       -->   2.18.0
  tenacity                       8.2.3        -->   8.3.0
  ujson                          5.9.0        -->   5.10.0
  virtualenv                     20.26.1      -->   20.26.2
  werkzeug                       2.1.2        -->   3.0.3
  zipp                           3.18.1       -->   3.18.2

==                      Added dependencies                      ==

  blinker                        1.8.2

==                     Removed dependencies                     ==

  colorama                       0.4.6
  nose                           1.3.7
  nose-parallel                  0.4.0
  nose-timer                     1.0.1
  rednose                        1.3.0
  termstyle                      0.1.11
Apparently, argparse has been in the standard library since Python 3.2.
We want the std lib version, not the old version from pypi.
So, drop the argparse dep.
@CLAassistant
Copy link

CLAassistant commented Jul 15, 2024

CLA assistant check
All committers have signed the CLA.

@pull-request-size pull-request-size bot added the size/XXL PR that changes 1000+ lines. You should absolutely split your PR into several. label Jul 15, 2024
@FileMagic
Copy link
Contributor Author

pls ignore this for a bit. I am more setting this up for ci-cd for after I figure out this race condition, and will be working with @nzlosh to rebase any changes into his pr to be shipped afterwards.

@FileMagic
Copy link
Contributor Author

From inital looks, it seems that tooz is not configured properly to use a datastore during pytest which may be causing race conditions????? I am not quite sure yet, however, we are clearly getting race conditions while testing, and the issue is coming from

WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2common.services.action:action.py:254 The status of action execution is changed from requested to scheduled. <LiveAction.id=6695750428019631d0419e7f, ActionExecution.id=6695750428019631d0419e80>
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2actions.worker:worker.py:195 Launching action execution.
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2common.services.action:action.py:254 The status of action execution is changed from requested to scheduled. <LiveAction.id=6695750428019631d0419e8d, ActionExecution.id=6695750428019631d0419e8e>
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2actions.worker:worker.py:195 Launching action execution.
AUDIT    st2.st2common.services.access:access.py:91 Access granted to "stanley" with the token set to expire at "2024-07-16T19:14:12.940541Z".
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2actions.container.base:base.py:173 Liveaction completed
AUDIT    st2.st2common.services.action:action.py:201 Action execution requested. LiveAction.id=6695750428019631d0419e8d, ActionExecution.id=6695750428019631d0419e8e
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
AUDIT    st2.st2actions.container.base:base.py:173 Liveaction completed
AUDIT    st2.st2common.services.action:action.py:201 Action execution requested. LiveAction.id=6695750428019631d0419e7f, ActionExecution.id=6695750428019631d0419e80
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] Workflow execution completed with errors.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] {'type': 'error', 'message': 'Execution failed. See result for details.', 'task_id': 'task1', 'result': {'failed': True, 'succeeded': False, 'return_code': 1, 'stdout': '', 'stderr': 'sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper'}}
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] Workflow execution completed with errors.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] {'type': 'error', 'message': 'Execution failed. See result for details.', 'task_id': 'task1', 'result': {'failed': True, 'succeeded': False, 'return_code': 1, 'stdout': '', 'stderr': 'sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper'}}
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] Workflow execution completed with errors.
ERROR    st2.st2common.services.workflows:workflows.py:71 [6695750428019631d0419e80] {'type': 'error', 'message': 'Execution failed. See result for details.', 'task_id': 'task1', 'result': {'failed': True, 'succeeded': False, 'return_code': 1, 'stdout': '', 'stderr': 'sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper'}}
WARNING  st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible.

Every time something fails, we get WARNING st2.st2common.services.coordination:coordination.py:244 Coordination backend is not configured. Code paths which use coordination service will use best effort approach and race conditions are possible. coming up quite a few times. I wonder if I change the tests to auto setup a different backend for tooz to coordinate off of if it would fix this issue (I have no clue what it is using now I am assuming a file rn).

@FileMagic
Copy link
Contributor Author

I read the test, my last comment was dumb. We do noop(s) on tooz calls. Still no clue what is happening on that end though.

@ajjonen
Copy link

ajjonen commented Jul 16, 2024

The race conditions are due to noop being used instead of actual coordination in the unit testing. Setting up redis and coordination will fix these.

@nzlosh
Copy link
Contributor

nzlosh commented Jul 16, 2024

+1 @ajjonen. Redis wasn't a hard dependency initially but has been for a couple of years now, I think it makes sense to use redis as the tooz coordinator to run tests.

@FileMagic
Copy link
Contributor Author

Okay makes sense to me. I'll do that then. Thanks for the heads up good to see I wasn't as crazy as I initially thought with this #6223 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL PR that changes 1000+ lines. You should absolutely split your PR into several.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants