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

Add Support for MongoDB 5, 6, 7 PYMONGO 4.6.1 Drop Python 3.6 #6079

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# Run st2 Integration tests
integration:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.8
- image: mongo:4.0
- image: rabbitmq:3
working_directory: ~/st2
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
# Run st2 Lint Checks
lint:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.8
- image: mongo:4.0
- image: rabbitmq:3
working_directory: ~/st2
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
resource_class: large
docker:
# The primary container is an instance of the first list image listed. Your build commands run in this container.
- image: circleci/python:3.6
- image: circleci/python:3.8
working_directory: ~/st2
environment:
- DISTROS: "bionic focal el7 el8"
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
deploy:
docker:
# The primary container is an instance of the first list image listed. Your build commands run in this container.
- image: circleci/ruby:2.7
- image: circleci/ruby:3.2.2
working_directory: /tmp/deploy
environment:
- DISTROS: "bionic focal el7 el8"
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ jobs:
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
# setup virtualenv step will fail.
include:
- name: 'Lint Checks (black, flake8, etc.)'
task: 'ci-checks'
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Compile (pip deps, pylint, etc.)'
task: 'ci-compile'
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Lint Checks (black, flake8, etc.)'
task: 'ci-checks'
python-version-short: '3.8'
Expand Down Expand Up @@ -312,18 +304,6 @@ jobs:
# NOTE: To speed the CI run, we split unit and integration tests into multiple jobs where
# each job runs subset of tests.
include:
- name: 'Unit Tests (chunk 1)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 0
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Unit Tests (chunk 2)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 1
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Unit Tests (chunk 1)'
task: 'ci-unit'
nosetests_node_total: 2
Expand Down Expand Up @@ -499,24 +479,6 @@ jobs:
include:
# We run pack tests here since they rely on some integration tests set
# up (aka stanley user being present, etc.)
- name: 'Pack Tests'
task: 'ci-packs-tests'
nosetests_node_total: 1
nosetests_node_index: 0
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Integration Tests (chunk 1)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 0
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Integration Tests (chunk 2)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 1
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Pack Tests'
task: 'ci-packs-tests'
nosetests_node_total: 1
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/microbenchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
# setup virtualenv step will fail.
include:
- name: 'Microbenchmarks'
task: 'micro-benchmarks'
nosetests_node_total: 1
nosetests_node_index: 0
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Microbenchmarks'
task: 'micro-benchmarks'
nosetests_node_total: 1
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/orquesta-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ jobs:
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
# setup virtualenv step will fail.
include:
- name: 'Integration Tests (Orquesta)'
task: 'ci-orquesta'
nosetests_node_total: 1
nosetests_node_index: 0
python-version: '3.6.13'
python-version-short: '3.6'
- name: 'Integration Tests (Orquesta)'
task: 'ci-orquesta'
nosetests_node_total: 1
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
# setup virtualenv step will fail.
include:
- name: 'Test (pants runs: pytest)'
python-version-short: '3.6'
python-version: '3.6.13'
- name: 'Test (pants runs: pytest)'
python-version-short: '3.8'
python-version: '3.8.10'
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Changed
* Remove `distutils` dependencies across the project. #5992
Contributed by @AndroxxTraxxon


3.8.0 - November 18, 2022
-------------------------

Expand Down
2 changes: 0 additions & 2 deletions conf/st2.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ ssl_cert_reqs = None
ssl_certfile = None
# Private keyfile used to identify the local connection against MongoDB.
ssl_keyfile = None
# If True and `ssl_cert_reqs` is not None, enables hostname verification
ssl_match_hostname = True
# username for db login
username = None
# Compression level when compressors is set to zlib. Valid values are -1 to 9. Defaults to 6.
Expand Down
1 change: 0 additions & 1 deletion contrib/packs/actions/pack_mgmt/unload.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def initialize(self):
ssl_cert_reqs=cfg.CONF.database.ssl_cert_reqs,
ssl_ca_certs=cfg.CONF.database.ssl_ca_certs,
authentication_mechanism=cfg.CONF.database.authentication_mechanism,
ssl_match_hostname=cfg.CONF.database.ssl_match_hostname,
)

def run(self, packs):
Expand Down
4 changes: 2 additions & 2 deletions fixed-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lockfile==0.12.2
# Fix MarkupSafe to < 2.1.0 as 2.1.0 removes soft_unicode
# >=0.23 was from jinja2
MarkupSafe<2.1.0,>=0.23
mongoengine==0.23.0
mongoengine==0.27.0
# required by orquesta (networkx<2.6 for py3.6, networkx<3 for py3.8)
networkx<3
# networkx requires decorator>=4.3,<5 which should resolve to version 4.4.2
Expand All @@ -43,7 +43,7 @@ paramiko==2.11.0
passlib==1.7.4
prompt-toolkit==1.0.15
pyinotify==0.9.6 ; platform_system=="Linux"
pymongo==3.11.3
pymongo==4.6.1
pyparsing<3
zstandard==0.15.2
# pyOpenSSL 23.1.0 supports cryptography up to 40.0.x
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kombu==5.0.2
lockfile==0.12.2
logshipper@ git+https://github.com/StackStorm/logshipper.git@stackstorm_patched ; platform_system=="Linux"
mock==4.0.3
mongoengine==0.23.0
mongoengine==0.27.0
networkx<3
nose
nose-parallel==0.4.0
Expand All @@ -47,7 +47,7 @@ prompt-toolkit==1.0.15
psutil==5.8.0
pyOpenSSL==23.1.0
pyinotify==0.9.6 ; platform_system=="Linux"
pymongo==3.11.3
pymongo==4.6.1
pyparsing<3
pyrabbit
pysocks
Expand Down
4 changes: 2 additions & 2 deletions st2api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ eventlet==0.33.3
gunicorn==21.2.0
jsonschema==2.6.0
kombu==5.0.2
mongoengine==0.23.0
mongoengine==0.27.0
oslo.config>=1.12.1,<1.13
oslo.utils<5.0,>=4.0.0
pymongo==3.11.3
pymongo==4.6.1
pyparsing<3
simplejson
six==1.13.0
2 changes: 1 addition & 1 deletion st2auth/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ eventlet==0.33.3
gunicorn==21.2.0
oslo.config>=1.12.1,<1.13
passlib==1.7.4
pymongo==3.11.3
pymongo==4.6.1
six==1.13.0
st2-auth-backend-flat-file@ git+https://github.com/StackStorm/st2-auth-backend-flat-file.git@master
st2-auth-ldap@ git+https://github.com/StackStorm/st2-auth-ldap.git@master
Expand Down
4 changes: 2 additions & 2 deletions st2common/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jsonpath-rw==1.4.0
jsonschema==2.6.0
kombu==5.0.2
lockfile==0.12.2
mongoengine==0.23.0
mongoengine==0.27.0
networkx<3
orjson==3.5.2
orquesta@ git+https://github.com/StackStorm/[email protected]
oslo.config>=1.12.1,<1.13
paramiko==2.11.0
pyOpenSSL==23.1.0
pymongo==3.11.3
pymongo==4.6.1
python-dateutil==2.8.1
python-statsd==2.1.0
pyyaml==5.4.1
Expand Down
5 changes: 0 additions & 5 deletions st2common/st2common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,6 @@ def register_opts(ignore_errors=False):
help="ca_certs file contains a set of concatenated CA certificates, which are "
"used to validate certificates passed from MongoDB.",
),
cfg.BoolOpt(
"ssl_match_hostname",
default=True,
help="If True and `ssl_cert_reqs` is not None, enables hostname verification",
),
cfg.StrOpt(
"authentication_mechanism",
default=None,
Expand Down
1 change: 0 additions & 1 deletion st2common/st2common/database_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def db_config():
"ssl_cert_reqs": cfg.CONF.database.ssl_cert_reqs,
"ssl_ca_certs": cfg.CONF.database.ssl_ca_certs,
"authentication_mechanism": cfg.CONF.database.authentication_mechanism,
"ssl_match_hostname": cfg.CONF.database.ssl_match_hostname,
}


Expand Down
11 changes: 0 additions & 11 deletions st2common/st2common/models/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def _db_connect(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):

if "://" in db_host:
Expand Down Expand Up @@ -168,7 +167,6 @@ def _db_connect(
ssl_cert_reqs=ssl_cert_reqs,
ssl_ca_certs=ssl_ca_certs,
authentication_mechanism=authentication_mechanism,
ssl_match_hostname=ssl_match_hostname,
)

compressor_kwargs = {}
Expand Down Expand Up @@ -237,7 +235,6 @@ def db_setup(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):

connection = _db_connect(
Expand All @@ -252,7 +249,6 @@ def db_setup(
ssl_cert_reqs=ssl_cert_reqs,
ssl_ca_certs=ssl_ca_certs,
authentication_mechanism=authentication_mechanism,
ssl_match_hostname=ssl_match_hostname,
)

# Create all the indexes upfront to prevent race-conditions caused by
Expand Down Expand Up @@ -403,7 +399,6 @@ def db_cleanup(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):

connection = _db_connect(
Expand All @@ -418,7 +413,6 @@ def db_cleanup(
ssl_cert_reqs=ssl_cert_reqs,
ssl_ca_certs=ssl_ca_certs,
authentication_mechanism=authentication_mechanism,
ssl_match_hostname=ssl_match_hostname,
)

LOG.info(
Expand All @@ -440,7 +434,6 @@ def _get_ssl_kwargs(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):
# NOTE: In pymongo 3.9.0 some of the ssl related arguments have been renamed -
# https://api.mongodb.com/python/current/changelog.html#changes-in-version-3-9-0
Expand Down Expand Up @@ -468,10 +461,6 @@ def _get_ssl_kwargs(
if authentication_mechanism:
ssl_kwargs["ssl"] = True
ssl_kwargs["authentication_mechanism"] = authentication_mechanism
if ssl_kwargs.get("ssl", False):
# pass in ssl_match_hostname only if ssl is True. The right default value
# for ssl_match_hostname in almost all cases is True.
ssl_kwargs["ssl_match_hostname"] = ssl_match_hostname
return ssl_kwargs


Expand Down
2 changes: 0 additions & 2 deletions st2common/st2common/persistence/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def db_cleanup_with_retry(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):
"""
This method is a retry version of db_cleanup.
Expand All @@ -68,7 +67,6 @@ def db_cleanup_with_retry(
ssl_cert_reqs=ssl_cert_reqs,
ssl_ca_certs=ssl_ca_certs,
authentication_mechanism=authentication_mechanism,
ssl_match_hostname=ssl_match_hostname,
)


Expand Down
2 changes: 0 additions & 2 deletions st2common/st2common/persistence/db_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def db_setup_with_retry(
ssl_cert_reqs=None,
ssl_ca_certs=None,
authentication_mechanism=None,
ssl_match_hostname=True,
):
"""
This method is a retry version of db_setup.
Expand All @@ -90,5 +89,4 @@ def db_setup_with_retry(
ssl_cert_reqs=ssl_cert_reqs,
ssl_ca_certs=ssl_ca_certs,
authentication_mechanism=authentication_mechanism,
ssl_match_hostname=ssl_match_hostname,
)
Loading
Loading