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

Mongo Auth | Intall pymongo via pip (vs via sys pkgs) #216

Merged
merged 2 commits into from Jan 16, 2020

Conversation

cognifloyd
Copy link
Member

This PR is preparation for enabling mongo auth via the ansible playbook.
These tasks will not be activated until all required tasks are committed.

This installs pip via system package, and then pymongo via pip.

pymongo is needed for mongodb_user module to enable mongo auth.
pymongo 3.2+ is required to work with mongo 3.2+
system packages are too old on all but Ubuntu 16:

  • 2.5.2 on EL 6 and EL 7
  • 2.6.3 on Ubuntu 14 Trusty
  • 3.2 on Ubuntu 16 Xenial

@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch 4 times, most recently from 22a3d13 to 4b9fac5 Compare November 12, 2018 21:44
@cognifloyd
Copy link
Member Author

Removed special case for EL7 and pinned version.
Tests here (with the rest of the auth tasks): https://travis-ci.org/theatro/ansible-st2/builds/454176993

@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch from 4b9fac5 to 65e0fe8 Compare November 12, 2018 23:26
@cognifloyd
Copy link
Member Author

Travis tests pass except for one false negative a chatops EADDRINUSE error.

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

One cosmetic comment: please also add tags to be consistent with other tasks in this role

tags: [databases, mongodb]

@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch from 65e0fe8 to 0d815f7 Compare November 13, 2018 22:19
@cognifloyd
Copy link
Member Author

@armab done!

@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch 4 times, most recently from 00702dd to 8e96f6b Compare January 10, 2020 02:05
@cognifloyd cognifloyd changed the title Mongo Auth | Intall pymongo via pip over sys pkgs Mongo Auth | Intall pymongo via pip (vs sys pkgs) Jan 10, 2020
@pull-request-size pull-request-size bot added the size/S PR that changes 10-29 lines. Very easy to review. label Jan 10, 2020
@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch from 8e96f6b to 670b17c Compare January 10, 2020 07:44
This installs pip via system package, and then pymongo via pip.

pymongo is needed for mongodb_user module to enable mongo auth.
pymongo 3.2+ is required to work with mongo 3.2+
system packages are too old on all but Ubuntu 16:
 - 2.5.2 on EL 6 and EL 7
 - 2.6.3 on Ubuntu 14 Trusty
 - 3.2 on Ubuntu 16 Xenial
@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch from 670b17c to cc44ec3 Compare January 15, 2020 17:13
@cognifloyd
Copy link
Member Author

Checks are green. Please review and merge.

@cognifloyd cognifloyd requested a review from arm4b January 15, 2020 20:06
@cognifloyd cognifloyd changed the title Mongo Auth | Intall pymongo via pip (vs sys pkgs) Mongo Auth | Intall pymongo via pip (vs via sys pkgs) Jan 15, 2020
# pymongo 3.2+ is required to work with mongo 3.2+. system packages are too old.
become: yes
pip:
name: "pymongo=={{ mongodb_major_minor_version }}"
Copy link
Member

@arm4b arm4b Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest pymongo is 3.10.1 as for Jan 8, 2020 https://pypi.org/project/pymongo/

What will happen if mongodb_major_minor_version would be 4.0 that needed for Bionic #253 and EL8?

I don't think pymongo pip version correlates with mongodb_major_minor_version, otherwise it would affect us like Russian roulette depending on mongodb version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I guess my sample size was too small when I looked that up. For versions 3.2-3.6, that assumption held.
Here's the chart showing supported versions: https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#python-driver-compatibility
Now to find an elegant way to record those requirements.

Copy link
Member

@arm4b arm4b Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's possible to use one of the latest pymongo versions pinned with safe interval.
My understanding that this should cover all older MongoDB versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pymongo>=3.10.1,<4.0.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K. the latest commit pins the version as suggested.

@cognifloyd cognifloyd force-pushed the mongo_auth_install_pymongo_via_pip branch from fbffeba to 0999616 Compare January 16, 2020 19:18
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@arm4b arm4b merged commit fc44e29 into StackStorm:master Jan 16, 2020
@cognifloyd cognifloyd deleted the mongo_auth_install_pymongo_via_pip branch September 24, 2020 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement size/S PR that changes 10-29 lines. Very easy to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants