- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试在 Amazon Elastic Beanstalk 上运行的基本 Django 应用程序上安装 scipy,但我无法让它工作。
以下是重现我的问题的步骤:
来自 the guide 的常规内容:
# Create a new virtual environment
mkvirtualenv -p python2.7 django_eb
# Install Django on it
pip install django==1.9.12
# pip freeze should now show Django==1.9.12 and some other things
# Start a new Django project
# This creates a directory that has everything you need for Django
django-admin startproject django_eb
cd django_eb
# Optionally check that the site works
python manage.py runserver
Ctrl-C
# Store the pip requirements so that the remote host can install them
pip freeze > requirements.txt
# Tell the remote server where our wsgi file is
mkdir .ebextensions
cat <<EOT >> .ebextensions/django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: django_eb/wsgi.py
EOT
# Allow any host for our project
# If this is unset, you'll get a 404 on the deployed site
set ALLOWED_HOSTS = ['*'] in settings.py
# Create an EB project
# Will need AWS EB CLI for this
eb init -p python2.7 django_eb
# Choose some region
eb init
# choose Y so we can SSH and check logs
# Create a deployment environment
eb create django-eb-env
# This step takes around 5 minutes
# If it fails and you need to restart run 'eb deploy'
# Open the website in your OS's default browser
eb open
# If you get DisallowedHost at / error
# double check that ALLOWED_HOSTS = ['*']
安装 scipy:
# Now we'll install scipy and watch how it doesn't work remotely
pip install scipy==0.19.0
pip freeze > requirements.txt
eb deploy
# Should take forever and then finally print
# 'ERROR: Failed to deploy application.'
eb ssh
cat /var/log/eb-activity.log
# Should print
# numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
# After reading this blog post
# https://medium.com/@DaveJMcKeown/deploying-scipy-into-aws-elastic-beanstalk-2e5e481155de
# I added this to .ebextensions/django.config:
packages:
yum:
make: []
gcc-c++: []
gcc-gfortran: []
python27-devel: [] # I used python27-devel instead of python-devel
atlas-sse3-devel: []
lapack-devel: []
libpng-devel: []
freetype-devel: []
zlib-devel: []
container_commands:
AddGlobalWSGIGroupAccess:
command: "if ! grep -q 'WSGIApplicationGroup %{GLOBAL}' ../wsgi.conf ; then echo 'WSGIApplicationGroup %{GLOBAL}' >> ../wsgi.conf; fi;"
# Unfortunately, this leads to an our of memory error
# Running dmesg now looks like the following:
# http://stackoverflow.com/a/35011967/2770572
我在这里不知所措。看起来我也许可以让它在具有更多 RAM 的 EC2 实例上运行,但我不能真的那样做,因为它会让我脱离免费层。有没有办法运行 make 命令,使其不会占用太多内存或其他解决方案?
最佳答案
您可以尝试将此添加到您的.ebextensions/django.config
:
commands:
01_no_cache:
command: "/opt/python/run/venv/bin/pip install --no-cache-dir -r /opt/python/current/app/requirements.txt"
如果您检查 /var/log/eb-activity.log
(或者如果您安装了 EB CLI,则只需键入 eb logs
),您可以看到错误这里:
MemoryError
2017-08-10 11:40:25,557 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
据我所知,如果将特定命令包含在 django.config 中,则可以为 EB 提供这些命令。如所写here ,您可以禁用缓存。
这对我有用。
关于linux - Elastic Beanstalk 安装 scipy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43164961/
我正在尝试将我的应用程序上载到Elastic Beanstalk,但是在节点预gyp安装--fallback-to-build上,npm安装失败。我尝试了各种版本的节点,但无济于事。似乎正在尝试获取一
每当我在 Elastic Beanstalk 中创建新环境时,我都会手动配置自定义 AMI ID、SNS 通知等,但我想自动完成,即,将设置(自定义 AMI ID、SNS、 key 对等)保存到一个配
我已使用以下方法连接到 Elastic Beanstalk: eb ssh XXXXXX --profile=xx 现在我想将一个文件复制到我的本地机器上,我该怎么做? 最佳答案 找出与 scp 一起
对于典型的 Java Web 应用程序,使用 Elastic Beanstalk 相对于手动创建 EC2 实例、设置 tomcat 服务器和部署等有哪些优势?负载平衡、监控和自动缩放是唯一的优势吗?
我有两个Elastic Search版本,一个是 7.3 ,另一个是 7.1 。我正在将flattened数据类型用于 Elastic Search 7.3 ,并且我也想在 Elastic Searc
我是 Elastic 和 spring-data-elastic 的新手。我一直在此处和网络的其他区域进行搜索,但到目前为止尚未找到我的问题的答案。我希望 SO 能够提供帮助。 我正在为我的Users
我有一个运行 PHP 的弹性 beanstalk 环境。在我的项目中,我有一个 .ebextensions 文件夹和一个名为“15-memorymonitor.config”的文件,其中包含以下内容;
我有 “更新”:Dockerrun.aws.json 中的“真” 当我更新 ECR 中的图像时,它应该自动更新 EC2 iontance 中的图像和容器。 但是当我在推送新图像后通过 ssh 进入实例
我有一个定义 Elastic Beanstalk 应用程序的 CloudFormation 模板。 我想扩展这个应用程序,即我希望端口 80 上的监听器重定向到 HTTPS。 AWS::Elastic
我在使用自定义 .ebextensions 文件部署 EB 实例时遇到问题。这是该文件中的相关部分: container_commands: 01_migrate: command: 'p
我已经使用带负载均衡器的 Elastic Beanstalk 创建了一个环境,并在各自的配置中分配了所有健康检查值 我也为ELB设置了应用健康检查url 但是当我检查自动缩放组配置时,健康检查类型是
我想使用 OpenTelemetry 将跟踪/指标数据导出到 Elastic Search,但我更愿意避免使用 Elastic APM。是否可以?opentelemetry 贡献 repo显然暗示这是
我正在尝试部署我的 角申请通过GitHub Actions到 Elastic Beanstalk 。我正在使用这个 GitHub actions用于部署到 ELB。 我的问题是,部署失败,因为 ELB
我已阅读有关 Deploying Versions with Zero Downtime 的 AWS 文档,又名 CNAME 交换。 如 yegor256在 this answer 中有解释: The
我们在我们的一个应用程序服务器上安装了 Elastic 5.6.10 和 HibernateSearch ORM 5.11.4.Final,现在我们计划通过我们的一个微服务(spring boot,但
我正在使用 AWS Elastic beanstalk 并希望为不同的环境配置不同的 ENV 变量。我发现的唯一方法是使用 ebextensions,但如果我将同一个数据包部署到多个环境,则无法覆盖在
我有一个应用程序,其中包含 nodejs 和 php 代码。 nodejs 用于运行应用程序所需的几个脚本。我如何使用 aws Elastic beanstalk 部署此类应用程序? 最佳答案 有两种
我打算将 MP4(1920x1080,比特率可能因 mp4 而异)转换为 HLS(不同类型的分辨率)。 不同类型的分辨率,我正在寻找 1080p = 1920x1080 720p = 1280x720
我不断收到以下消息。但是在我的 nginx 日志中没有任何内容表明返回的请求状态为 5xx。此外,应用程序似乎按预期工作。我可能会得到这些的任何指示? 留言: Environment health h
我们如何使用 bitbucket 管道更新 aws elastic beanstalk 上的 asp.net 核心网站? 最佳答案 我知道这是迟到的答案,但几天前我做了同样的事情,所以这里是我是如何做
我是一名优秀的程序员,十分优秀!