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

Installing on RHEL/CentOS 6 #24

Closed
eljrax opened this issue Feb 23, 2016 · 4 comments
Closed

Installing on RHEL/CentOS 6 #24

eljrax opened this issue Feb 23, 2016 · 4 comments
Assignees
Labels

Comments

@eljrax
Copy link
Contributor

eljrax commented Feb 23, 2016

I think something's gone slightly awry with the introduction of version pinning, rax-autoscaler fails to execute when installed through pip on CentOS 6.

# cat Dockerfile
FROM centos:6
RUN yum -y install gcc python-setuptools python-devel
RUN easy_install pip
RUN pip install rax-autoscaler
RUN pip freeze | grep stevedore
RUN autoscale

Output:

# docker build -t rax-autoscaler-deps-6 .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM centos:6
 ---> a4281a4ea787
Step 2 : RUN yum -y install gcc python-setuptools python-devel
 ---> Using cache
 ---> 6b738b80f080
Step 3 : RUN easy_install pip
 ---> Using cache
 ---> 30e1b123d5fd
Step 4 : RUN pip install rax-autoscaler
 ---> Using cache
 ---> 9624d13a41fe
Step 5 : RUN pip freeze | grep stevedore
 ---> Running in 42a88daf5f71
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
stevedore==1.10.0
 ---> bf1f05f10a34
Removing intermediate container 42a88daf5f71
Step 6 : RUN autoscale
 ---> Running in fc8b82e0d132
Traceback (most recent call last):
  File "/usr/bin/autoscale", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: stevedore==1.10.0
The command '/bin/sh -c autoscale' returned a non-zero code: 1

When changing the Dockerfile to use centos:7, the process works.

pip freeze does report stevedore 1.10.0 as being installed, however.

@Teddy-Schmitz
Copy link
Contributor

Investigating...

@Teddy-Schmitz
Copy link
Contributor

So I found that if I upgrade pip and setuptools before installing it will work properly. I'm thinking its because its using very old versions that it causes an issue. Can you try and confirm?

@eljrax
Copy link
Contributor Author

eljrax commented Mar 2, 2016

Hey,

Upgrading setuptools does allow an install, but it bails when executing then:

# cat Dockerfile
FROM centos:6
RUN yum -y install gcc python-setuptools python-devel
RUN easy_install pip
RUN pip install --upgrade setuptools
RUN pip install rax-autoscaler
RUN pip freeze | grep stevedore
RUN autoscale
# docker build -t rax-autoscaler-deps-6 .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM centos:6
 ---> a4281a4ea787
Step 2 : RUN yum -y install gcc python-setuptools python-devel
 ---> Using cache
 ---> 10a2e4fdcace
Step 3 : RUN easy_install pip
 ---> Using cache
 ---> c2136b6fb0ab
Step 4 : RUN pip install --upgrade setuptools
 ---> Using cache
 ---> e68d0475a605
Step 5 : RUN pip install rax-autoscaler
 ---> Using cache
 ---> 0a7dd1ab2988
Step 6 : RUN pip freeze | grep stevedore
 ---> Running in da74c858c932
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
stevedore==1.10.0
 ---> 0a968dafe600
Removing intermediate container da74c858c932
Step 7 : RUN autoscale
 ---> Running in 160a792973dc
Traceback (most recent call last):
  File "/usr/bin/autoscale", line 9, in <module>
    load_entry_point('rax-autoscaler==0.4.0', 'console_scripts', 'autoscale')()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 549, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2542, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2202, in load
    return self.resolve()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2208, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.6/site-packages/raxas/autoscale.py", line 27, in <module>
    from raxas import common
  File "/usr/lib/python2.6/site-packages/raxas/common.py", line 23, in <module>
    import pyrax
  File "/usr/lib/python2.6/site-packages/pyrax/__init__.py", line 59, in <module>
    from novaclient import client as nc
  File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 34, in <module>
    from keystoneclient import adapter
  File "/usr/lib/python2.6/site-packages/keystoneclient/__init__.py", line 30, in <module>
    import importlib
ImportError: No module named importlib
The command '/bin/sh -c autoscale' returned a non-zero code: 1

So it looks like importlib for some reason isn't just a -dev requirement, it's actually required to execute autoscale on centos 6.

Should be sorted by PR #25

@Teddy-Schmitz
Copy link
Contributor

Great I will fixup PR #25 merge it in and do a release soon.

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

No branches or pull requests

2 participants