|
@@ -1,6 +1,7 @@
|
|
|
#!/usr/bin/env python
|
|
|
# -*- coding: utf-8 -*-
|
|
|
# 用于批量处理转换 运行多个转换容器
|
|
|
+# nohup python /data/dm/container/web/master.py 2>/dev/null &
|
|
|
import time
|
|
|
import subprocess
|
|
|
import os
|
|
@@ -11,12 +12,13 @@ def redis():
|
|
|
import redis
|
|
|
host = '0.0.0.0'
|
|
|
port = 6379
|
|
|
- pool = redis.ConnectionPool(host=host, port=int(port))
|
|
|
+ password = 'dm_redis_123'
|
|
|
+ pool = redis.ConnectionPool(host=host, password=password, port=int(port))
|
|
|
return redis.Redis(connection_pool=pool)
|
|
|
|
|
|
def command(file):
|
|
|
#return 'dm call office-convert_call id=' + file
|
|
|
- return 'docker run -d -it --entrypoint python --rm -v /data/dm/container/share:/share -v /etc/hosts:/etc/hosts.main --env HOSTIP="172.30.0.6" --net=dm -v /data/dm/container/web:/www -v /data/dm/container/web/convert/static:/usr/local/convert/front/static -v /data/dm/container/web/convert/files:/usr/local/convert/runtime/files docker.dever.cc/office/convert /usr/local/convert/convert.py -f ' + file
|
|
|
+ return 'docker run -d -it --entrypoint python --rm -v /data/dm/container/share:/share -v /etc/hosts:/etc/hosts.main --env HOSTIP="172.30.0.6" --net=dm -v /data/dm/container/web:/www -v /data/dm/container/web/convert/static:/usr/local/convert/front/static -v /data/dm/container/web/convert/files:/usr/local/convert/runtime/files registry.cn-hangzhou.aliyuncs.com/shemic/convert /usr/local/convert/convert.py -f ' + file
|
|
|
|
|
|
def popen(command, bg=False):
|
|
|
string = command
|