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

Install python modules required for embedded ansible credentials #341

Merged
merged 2 commits into from
Aug 9, 2019

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Aug 8, 2019

We install these into a new venv so that we don't conflict with
appliance python packages.

This list is taken directly from
https://raw.githubusercontent.com/ansible/awx/c7bb0f10e10476e10df8a7e7b26732eb60958ca1/requirements/requirements_ansible.txt
which is the result of resolving the dependencies from
https://github.com/ansible/awx/blob/c7bb0f10e10476e10df8a7e7b26732eb60958ca1/requirements/requirements_ansible.in

I feel like taking the resolved file first is safer since pip doesn't
do true dependency resolution (pypa/pip#988)

Replacement for #340

Looking for input on places to put the list of packages. I felt like people wouldn't go looking for this list in manageiq-appliance, but it needs to live on disk somewhere ...

I could put it in manageiq core, but this seemed like a better place to start since it's really a build-time concern.

https://bugzilla.redhat.com/show_bug.cgi?id=1734129

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

I am fine with this route for things.

I think where we get the source of truth for the requirements.txt is the only thing of concern here. That said, I think we can determine that out of band, and that doesn't really change the core functionality of this PR, just what we are version locking things to.

@carbonin
Copy link
Member Author

carbonin commented Aug 8, 2019

So I made all the changes needed to get pip install to succeed without warnings or errors on the appliance while keeping as many of the modules as I could.

Unfortunately, now, a significant number are different from what is listed in awx and also from what is shipped in the tower rpm. Plus we added a few additional rpms.

Not sure what option we want to go with here. I can always revert this PR to its original state though if we think that's better. @simaishi @NickLaMuro @Fryguy ?

@NickLaMuro
Copy link
Member

@carbonin Yeah, I don't know. Personally, I would rather we be as close to downstream as possible, or there eventually will be someone who tries fixing/replicating a bug on upstream and then turns out it is an issue with these packages and fixing it in one spot doesn't solve it in the other.

I am going to have to come back to this, but this how I started evaluating it:

So I want to take a finer look at the about, but have to work on a few of my own TODO items first.

@carbonin
Copy link
Member Author

carbonin commented Aug 8, 2019

Yeah, I came to the same conclusion @NickLaMuro I think we're closer to the downstream set with what we have here even though it required a bunch of workarounds vs the upstream set.

I'm going to un-wip this and if we need to follow up on it we can do that after. Better to just get cloud modules working more quickly.

@carbonin carbonin removed the wip label Aug 8, 2019
@carbonin carbonin changed the title [WIP] Install python modules required for embedded ansible credentials Install python modules required for embedded ansible credentials Aug 8, 2019
Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

Something I just caught that I think should be addressed before merged, if nothing else just to say it isn't a big deal.

kickstarts/partials/post/python_modules.ks.erb Outdated Show resolved Hide resolved
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2019

I'll leave it up to @carbonin and @NickLaMuro for what should be included in requirements.txt, the rest looks good to me.

virtualenv venv
source venv/bin/activate

cat > requirements.txt << EOF
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but would this be better as a straight file in COPY?

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered that, but thought that it might be more natural to keep what is essentially a packages list in this repo rather than in manageiq-appliance.

@carbonin
Copy link
Member Author

carbonin commented Aug 9, 2019

@simaishi brought up that ansible and ansible-runner are not actually present in the tower rpm. I was using the list from pip freeze to create this, but that also seems to be listing modules installed at the system level (not just the ones in the venv). I can re-work this to try to just install the modules included in the venv in the rpm (not using pip freeze) ... thoughts?

@carbonin carbonin added the wip label Aug 9, 2019
@carbonin carbonin changed the title Install python modules required for embedded ansible credentials [WIP] Install python modules required for embedded ansible credentials Aug 9, 2019
@carbonin
Copy link
Member Author

carbonin commented Aug 9, 2019

pip freeze -l is a thing. So now I have a new an updated list of modules that are actually installed using the tower venv rpm. Updating this PR to use that list.

We install these into a new venv so that we don't conflict with
appliance python packages.

This list is taken from `pip freeze -l` on an appliance with the
ansible-tower-venv-ansible rpm installed
This is needed for building python modules as we install via pip

https://bugzilla.redhat.com/show_bug.cgi?id=1734129
@miq-bot
Copy link
Member

miq-bot commented Aug 9, 2019

Checked commits carbonin/manageiq-appliance-build@4e6ae89~...23df7d9 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@carbonin carbonin removed the wip label Aug 9, 2019
@carbonin carbonin changed the title [WIP] Install python modules required for embedded ansible credentials Install python modules required for embedded ansible credentials Aug 9, 2019
@Fryguy
Copy link
Member

Fryguy commented Aug 9, 2019

well, this got a lot simpler 😂

@Fryguy Fryguy requested a review from NickLaMuro August 9, 2019 16:21
Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

So looked through the differences between what is in requirements_ansible.txt and what you have here:

applicationinsights==0.11.9             => applicationinsights==0.11.1
argcomplete==1.9.5                      => argcomplete==1.9.4
bcrypt==3.1.6                           => bcrypt==3.1.4
botocore==1.9.23                        => botocore==1.9.3
cachetools==3.1.0                       => cachetools==3.0.0
certifi==2019.3.9                       => certifi==2018.1.18
cffi==1.12.3                            => cffi==1.11.5
colorama==0.4.1                         => colorama==0.3.9
decorator==4.4.0                        => decorator==4.2.1
dogpile.cache==0.7.1                    => dogpile.cache==0.6.5
enum34==1.1.6; python_version < "3"     => <missing>
futures==3.2.0; python_version < "3"    => <missing>
humanfriendly==4.18                     => humanfriendly==4.8
idna==2.8                               => idna==2.6
ipaddress==1.0.22; python_version < "3" => ipaddress==1.0.19
jmespath==0.9.4                         => jmespath==0.9.3
jsonpatch==1.23                         => jsonpatch==1.21
keystoneauth1==3.14.0                   => keystoneauth1==3.11.2
lxml==4.3.3                             => lxml==4.1.1
monotonic==1.5; python_version < "3"    => monotonic==1.4
munch==2.3.2                            => munch==2.2.0
netifaces==0.10.9                       => netifaces==0.10.6
ntlm-auth==1.3.0                        => ntlm-auth==1.0.6
oauthlib==3.0.1                         => oauthlib==2.0.6
openstacksdk==0.31.1                    => openstacksdk==0.23.0
os-service-types==1.7.0                 => os-service-types==1.2.0
ovirt-engine-sdk-python==4.3.0          => ovirt-engine-sdk-python==4.2.4
packaging==19.0                         => packaging==17.1
pbr==5.2.0                              => pbr==3.1.1
pyasn1==0.4.5                           => pyasn1==0.4.2
pyasn1-modules==0.2.5                   => pyasn1-modules==0.2.3
pycparser==2.19                         => pycparser==2.18
pycurl==7.43.0.1                        => <missing>
pygments==2.3.1                         => pygments==2.2.0
pyjwt==1.7.1                            => pyjwt==1.6.0
pynacl==1.3.0                           => pynacl==1.2.1
pyopenssl==19.0.0                       => pyopenssl==17.5.0
pyparsing==2.4.0                        => pyparsing==2.2.0
pywinrm[kerberos]==0.3.0                => pywinrm==0.3.0
requests==2.21.0                        => requests==2.20.0
requests-credssp==1.0.2                 => requests-credssp==0.1.0
requests-oauthlib==1.2.0                => requests-oauthlib==0.8.0
rsa==4.0                                => <missing>
six==1.12.0                             => six==1.11.0
stevedore==1.30.1                       => stevedore==1.28.0
tabulate==0.8.2                         => tabulate==0.7.7
typing==3.6.6; python_version < "3"     => <missing>
wheel==0.30.0                           => <missing>
xmltodict==0.12.0                       => xmltodict==0.11.0
pip==9.0.1                              => <missing and not needed>
setuptools==36.0.1                      => <missing and not needed>

And everything should just be a downgrade (which is expected), or is missing, though probably not needed. I think this is good, and we are definitely making less changes than what was done previously. 👍

colorama==0.3.9
cryptography==2.6.1
decorator==4.2.1
deprecation==2.0
Copy link
Member

Choose a reason for hiding this comment

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

pyparsing==2.2.0
python-dateutil==2.6.1
pyvmomi==6.5
pywinrm==0.3.0
Copy link
Member

Choose a reason for hiding this comment

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

This one is the only one that has a different notation (pywinrm[kerberos]==0.3.0) in the ansible/awx file:

https://github.com/ansible/awx/blob/c7bb0f10/requirements/requirements_ansible.txt#L99

@Fryguy Fryguy merged commit 441d102 into ManageIQ:master Aug 9, 2019
@Fryguy Fryguy added this to the Sprint 118 Ending Aug 19, 2019 milestone Aug 9, 2019
@Fryguy Fryguy assigned Fryguy and unassigned simaishi Aug 9, 2019
simaishi pushed a commit that referenced this pull request Aug 9, 2019
Install python modules required for embedded ansible credentials

(cherry picked from commit 441d102)

https://bugzilla.redhat.com/show_bug.cgi?id=1734129
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2019

Ivanchuk backport details:

$ git log -1
commit df94d2e90f0942d9458a831ecd3f4199ca121603
Author: Jason Frey <jfrey@redhat.com>
Date:   Fri Aug 9 14:49:45 2019 -0400

    Merge pull request #341 from carbonin/install_python_modules
    
    Install python modules required for embedded ansible credentials
    
    (cherry picked from commit 441d102a558b8a29df35532cf5ecec21f77083f6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1734129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants