AWS Elastic Beanstalk: Python 2.7

3

Eu tenho um aplicativo que preciso hospedar no Elastic Beanstock. O aplicativo requer o Python 2.7, mas o Elastic Beanstock suporta apenas o Python 2.6.

Eu gostaria de instalar o Python 2.7 na implantação. Aqui está a configuração.

.ebextensions / config:

packages:                                                                                                                                                                                                                                                      
  yum:                                                                                                                                                                                                                                                         
    python27.x86_64: '2.7.3'                                                                                                                                                                                                                                   

container_commands:                                                                                                                                                                                                                                            
  01create_virtual_environment:                                                                                                                                                                                                                                
    command: "virtualenv -p /usr/bin/python27 /opt/python/run/venv27"                                                                                                                                                                                          
  02activate:                                                                                                                                                                                                                                                  
    command: "source /opt/python/run/venv27/bin/activate"                                                                                                                                                                                                      
  02install_packages:                                                                                                                                                                                                                                          
    command: "pip install -r /opt/python/current/app/requirements.txt"

Quando eu crio o aplicativo, recebo:

ERROR: Responses from [xxxxxxxx] were received, but the commands failed.

Quando eu ssh, não vejo o pacote.

Idéias?

    
por Charles R 13.06.2013 / 05:57

2 respostas

1

Em link :

Here’s the .ebextensions/python27.config I've written to get everything set up. I’ll explain what each part of the config does inline.

# Yum install the packages we need for python2.7
# on the EC2 box. python27-devel, make and httpd-devel
# are required for getting modwsgi setup with python27.
packages: 
  yum:
    python27: []
    python27-devel: []
    make: []
    httpd-devel: []

commands:
  # The modwsgi version currently installed on the system
  # is built with support for python2.6 only. This
  # command compiles and installs modwsgi with python2.7 support.
  installmodwsgi27:
    command: '[ -f mod_wsgi-3.4.tar.gz ] && echo "mod_wsgi-3.4 is already installed" || { wget http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz; tar xzvf mod_wsgi-3.4.tar.gz; cd mod_wsgi-3.4; ./configure --with-python=python27; make; make install; } | iconv -f utf-8 -t us-ascii//TRANSLIT'

  # When our app is being deployed a virtualenv is setup
  # automatically for us. This injects the --python=python2.7
  # argument into the virtualenv CLI. This tells virtualenv to
  # use python2.7 instead of the default python2.6.
  usepython27:
    command: grep "python2.7" 03deploy.py || sed -i 's/--distribute/--python=python2.7 &/' 03deploy.py
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre

container_commands:
  # Now that our app is installed using python2.7 we
  # need to fix some paths that the wsgi configuration
  # has pointing to python2.6. Copy the default eb wsgi.conf,
  # check it into git and replace the paths pointing
  # to python2.6. Check this diff out for the changes required:
  # https://github.com/leetreveil/elasticbeanstalk-python27/commit/3b3c955cfe686b9df77e0dddaf299ce6e1a20f32
  01replacewsgiconf:
    command: scp /opt/python/ondeck/app/wsgi.conf /opt/python/ondeck/wsgi

O autor também tem um repositório do Git com todos os scripts e arquivos necessários para configurar isso.

    
por 07.08.2013 / 22:20
0

situação semelhante é descrita aqui com detalhes sobre como resolver

link

    
por 13.06.2013 / 22:59