boxidau / rax-autoscaler

Apache License 2.0
5 stars 2 forks source link

pip install rax-autoscaler isn't working #55

Closed siso closed 9 years ago

siso commented 9 years ago
11:04 byte-compiling /usr/lib/python2.6/site-packages/raxas/__init__.py to __init__.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/autoscale.py to autoscale.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/cloudmonitor.py to cloudmonitor.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/common.py to common.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/version.py to version.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/auth.py to auth.pycbyte-compiling /usr/lib/python2.6/site-packages/raxas/colouredconsolehandler.py to colouredconsolehandler.pycrunning install_datacreating /usr/configerror: can't copy 'config/*': doesn't exist or not a regular file----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/rax-autoscaler/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lDDmZM-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/rax-autoscaler 
siso commented 9 years ago

Fixed this in r0.2.5

@boxidau please, see changes to setup.py:

<<<<<<< HEAD
    data_files=[('/etc/rax-autoscaler', ['config/logging.conf', 'config/config-template.json'])],
=======
    data_files=[('config', ['config/config-template.json',
                            'config/config.include',
                            'config/logging.conf']), ],
>>>>>>> release-0.2

That would fail if pip is not run as root (e.g. virtualenv).

boxidau commented 9 years ago

In cloud-init it is run as root.

Can we remove config/config.include

When run as root the config files end up being put into /usr/config, which is not ideal. The config_check function looks at /etc/rax-autoscaler/config.json so the config install is kinda useless

boxidau commented 9 years ago
[root@group01-as45558981 ~]# autoscale
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 2659, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 550, in resolve
    raise VersionConflict(dist,req) # XXX put more info here

pkg_resources.VersionConflict: (requests 1.1.0 (/usr/lib/python2.6/site-packages), Requirement.parse('requests>=2.2.1'))
siso commented 9 years ago

Hey @boxidau, can you please run it in a virtualenv?

I cannot reproduce the error:

(test)simo6545@MLD6KDDTY4:~/tmp/20141119-141140$ pip install rax-autoscaler
Downloading/unpacking rax-autoscaler
  Downloading rax-autoscaler-0.2.5.tar.gz
  Running setup.py (path:/Users/simo6545/.virtualenvs/test/build/rax-autoscaler/setup.py) egg_info for package rax-autoscaler
...
Successfully installed rax-autoscaler pyrax requests termcolor six keyring python-novaclient mock rackspace-novaclient iso8601 python-keystoneclient Babel simplejson pbr PrettyTable oslo.utils argparse rackspace-auth-openstack os-diskconfig-python-novaclient-ext rax-scheduled-images-python-novaclient-ext os-networksv2-python-novaclient-ext os-virtual-interfacesv2-python-novaclient-ext rax-default-network-flags-python-novaclient-ext netaddr oslo.config oslo.serialization stevedore pytz oslo.i18n
Cleaning up...

(test)simo6545@MLD6KDDTY4:~/tmp/20141119-141140$ autoscale --version
rax-autoscaler v0.2.5 -- Copyright @ 2014 Rackspace

(test)simo6545@MLD6KDDTY4:~/tmp/20141119-141140$ autoscale
usage: autoscale [-h] --as-group AS_GROUP [--os-username OS_USERNAME]
                 [--os-password OS_PASSWORD] [--config-file CONFIG_FILE]
                 [--os-region-name {SYD,HKG,DFW,ORD,IAD,LON}] [--cluster]
                 [--version] [--dry-run]
autoscale: error: argument --as-group is required
boxidau commented 9 years ago

I could but when we use cloud-init it's not going to be installed in a virtualenv so it needs to work as a global install too

siso commented 9 years ago

Agree, but let's address this issue first.

Looks like you are having issues resolving dependencies. Just try virtualenv.

boxidau commented 9 years ago

Yep, as discussed, requests isn't actually a requirement, removing it works fine. I'll do the changes and push to release-0.2