OpenFoam云后端应用程序

openfoam-cloud的Python项目详细描述


从Github安装

克隆存储库

git clone https://github.com/mikelangelo-project/openfoam-cloud.git

安装所需的python软件包

pip install -r requirements.txt

通过PIP安装

pip install openfoam-cloud

设置

安装以下必需的软件包

  • capstan
  • snap
  • 格拉法纳:sudo apt-get install grafana
  • 流入量:sudo apt-get install influxdb

复制本地设置

cp ofcloud/ofcloud/local_settings.py{.example,}

编辑本地设置以反映您的环境。你看到的地方 os.environ['env_variable_name']必须导出所需的值 为了你的环境。

OPENFOAM_BASENAME       = 'http://openfoam.example.com'
GRAFANA_BASENAME        = 'http://grafana.example.com'

S3_ACCESS_KEY_ID        = os.environ['S3_ACCESS_KEY_ID']
S3_SECRET_ACCESS_KEY    = os.environ['S3_SECRET_ACCESS_KEY']
S3_HOST                 = 's3-host'
S3_PORT                 = 8443

SNAP_SERVICE            = 'snap-api-root'
INFLUX_DB_HOST          = 'influxdb-host'
INFLUX_DB_PORT          = 8086
INFLUX_DB_NAME          = 'snap'
INFLUX_DB_USER          = 'root'
INFLUX_DB_PASS          = 'root'

# Dedicated openfoam network settings
OPENFOAM_NETWORK_PREFIX = 'openfoam'
OPENFOAM_NETWORK_CIDR = 'your desired network CIDR'
OPENFOAM_NETWORK_ALLOCATION_POOL_START = 'your IP allocation range start'
OPENFOAM_NETWORK_ALLOCATION_POOL_END = 'your IP allocation range end'
OPENFOAM_NETWORK_GATEWAY_IP = 'your gateway IP usually the first IP in CIDR range'

# Scheduler daemon settings
SCHEDULER_REFRESH_INTERVAL_SECONDS = 'desired scheduler daemon refresh interval in seconds'

# OpenFOAM simulations save their results on a NFS server as is evident from the NFS_IP setting. The
# LOCAL_NFS_MOUNT_LOCATION setting tells the scheduler daemon where to prepare simulation case files, capstan package etc.
# This folder should have the NFS location mounted (example /mnt/OpenFOAM_results) except when the scheduler runs on
# the NFS machine itself, then this can point directly to the exported directory (for instance '/export/OpenFOAM_results/')
LOCAL_NFS_MOUNT_LOCATION = 'path to folder with mounted NFS location'

# Network file storage server ip address
NFS_IP = 'nfs server ip'

# Location on the NFS server where OpenFOAM case files and results will be saved
NFS_SERVER_MOUNT_FOLDER = 'location on the nfs server, where simulation case files and results are saved'

# Maximum number of launch retries of one instance. When this limit is reached, the simulation instance enters the
# 'FAILED' state
OPENFOAM_SIMULATION_MAX_RETRIES = 3

# Overrides the number of maximum NOVA vcpu's used. Example: openstack allows use of maximum 24 vcpus. Our setting
# allows only 12. The scheduler_deamon will run new simulations until 12 vcpu's are used on nova.
# If this setting value is higher than nova's max VCPU quota, the latter will be respected.
OPENFOAM_MAX_CPU_USAGE = 18

# Overrides the number of maximum NOVA instances used. Example: openstack allows use of 10 instances. Our setting
# allows only 5. The scheduler_deamon will run new simulations until 5 oinstances are used on nova.
# If this setting value is higher than nova's max instance quota, the latter will be respected.
OPENFOAM_MAX_INSTANCE_USAGE = 8

运行

确保snap、infloxdb和grafana正在运行。为定义数据源 格拉法纳的大量涌入。

  • 快照:/opt/snap/bin/snapd -t 0 -a /opt/snap/plugin
  • 流入量:/etc/init.d/influxdb start
  • 格拉法纳:^{TT5}$

然后启动OpenFoam后端

python manage.py runserver 0.0.0.0:8008

下一步启动openfoam调度程序后台程序

python manage.py runscheduler

致谢

这个项目是在riaMIKELANGELO project(编号645402)中进行的,开始于 2015年1月,由欧盟委员会根据 H2020-ICT-07-2014:先进的云基础设施和服务 节目。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用外部java程序在minecraft中移动minecraft角色的相机   java输出文本文件中的变量   java LazyLoadingException在我尝试从多通关系获取对象时出现   java json rest API的错误:ClassCastException:org。json。无法将JSONObject强制转换为组织。json。杰索纳雷   java BigInteger。C中的intValue()等价物#   java大写所有字符,但不包括带引号字符串中的字符   java获取特殊字符   javascript为什么Selenium中的所有getX()调用都需要这么长时间?   rabbitmq rabbitmq java客户端并行消费   如何使用selenium Java在popover窗口中提取文本   对象在java中构造一类对象   java Room数据库未实现   json JSONObject可以使用java保存大的格式化双值吗?   有时限的旅行推销员   java HttpsURLConnection openConnection查询   java无法使用Spring@Entity注释创建MySQL表   lambda Java 8仅映射到值类型集合   java提供OSGi服务而不实现接口   java单个对象重写对象数组,不确定原因