我怎样自动加载的软件包(如的libjpeg-dev的)到我的弹性魔豆应用程序? [英] How do I auto load packages (such as libjpeg-dev) to my Elastic Beanstalk App?
问题描述
我有一个自动缩放运行的Python,我想使用PIL弹性魔豆的应用程序。当我这样做,它说,我的JPEG德codeR失踪,我需要安装的libjpeg。
I have a auto scaling Elastic Beanstalk app running Python where I want to use PIL. When I do, it says that my jpeg decoder is missing and that I need to install libjpeg.
于是我按照AWS官方指导的配置文件的位置:
So I follow AWS official guides for "configuration files" here:
- 的http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
- <一个href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html#customize-containers-format" rel="nofollow">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html#customize-containers-format
- http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
- http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html#customize-containers-format
但我无法得到它的工作。
But I can't get it working.
如果我理解正确指导我应该成立一个名为 .ebextensions
在我的应用程序文件夹的目录。在我的.ebextensions我应该成立一个foo.config文件。在我来说,我将其命名为 python.config
。
If I understand the guides correctly I should set up a directory called .ebextensions
in my application folder. Inside my .ebextensions I should set up a foo.config file. In my case I name it python.config
.
在这个文件中,我假设执行命令。我的config文件的code是:
In this file I'm suppose to execute commands. The code of my .config file is:
packages:
yum:
libjpeg-devel: '6b'
我部署我的应用程序,我可以在我的日志快照看到它的膨胀和创建该文件是这样的:
I deploy my app and I can see in my Log Snapshots that its inflating and creating the file like this:
-------------------------------------
/var/log/eb-tools.log
-------------------------------------
creating: /opt/python/ondeck/app/.ebextensions/
inflating: /opt/python/ondeck/app/.ebextensions/python.config
inflating: /opt/python/ondeck/app/application.py
...
不过,我无法找到实际执行的命令任何东西。我一直在寻找我的日志荫,python.config,JPEG,libjpeg的等没有任何相关的痕迹。我重新启动应用程序服务器,但我仍然会得到相同的信息,说的libjpeg丢失。
However, I can't find anything about actually executing the commands. I've been searching my log for "yum", "python.config", "jpeg", "libjpeg" and so on without any relevant traces. I restart the application server but still I get the same messages saying libjpeg is missing.
我看到其他人问类似的问题,关于配置文件无法正常工作。但是,我还没有看到任何回答。
I have seen other people asking similar questions, about config files not working. But I have yet to see any answer.
推荐答案
我碰到了同样的问题,而不是建立一个全新的弹性魔豆的应用程序,我通过SSH和重新安装PIL连接到EC2实例(或枕头)。
I ran into the same issue, instead of setting up a completely new Elastic Beanstalk app, I connected to the EC2 instance via SSH and re-installed PIL (or Pillow).
在EC2实例,我运行下面的命令:
On EC2 instance, I ran the following commands:
source /opt/python/run/venv/bin/activate
pip uninstall PIL
pip install PIL
现在PIL支持JPEG编码=)
Now PIL supports jpeg encoding =)
这篇关于我怎样自动加载的软件包(如的libjpeg-dev的)到我的弹性魔豆应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!