Commit 1fecfb2d authored by qhoangxuan's avatar qhoangxuan

small fixes for zoeci when porting to new docker api

parent fc459ce4
......@@ -144,7 +144,7 @@ class ZoeBackendDeploy():
res = self.cli.containers.list(all=True, filters={'name': s})
if len(res) > 0:
for r in res:
name = r.attrs['Names'][0].split("/")[1]
name = r.name
if self.typeDeploy == 0:
if name == s:
r.remove(force=True)
......@@ -163,7 +163,7 @@ class ZoeBackendDeploy():
# start zoe_api
api_c = self.cli.containers.get(self.zoe_api)
api_c.start(self.zoe_api)
api_c.start()
print('Started latest ' + self.zoe_api + ' container...')
if not api_c.attrs['State']['Running']:
retcode = -1
......@@ -172,7 +172,7 @@ class ZoeBackendDeploy():
# start zoe_master
master_c = self.cli.containers.get(self.zoe_master)
master_c.start(self.zoe_master)
master_c.start()
print('Started latest ' + self.zoe_master + ' container...')
if not master_c.attrs['State']['Running']:
retcode = 0
......
......@@ -4,7 +4,7 @@ services:
image: 192.168.12.2:5000/zoe:reducetime
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: python3 zoe-api.py --debug --swarm consul://192.168.12.2 --deployment-name prod --dbuser postgres --dbhost 192.168.12.2 --dbport 5432 --dbname postgres --dbpass postgres --overlay-network-name my-net --master-url tcp://zoe-master:4850 --auth-type ldap --ldap-server-uri ldap://172.17.0.6 --ldap-base-dn ou=users,dc=example,dc=com --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --gelf-address udp://192.168.12.2:5004
command: python3 zoe-api.py --debug --backend-swarm-url consul://192.168.12.2 --deployment-name prod --dbuser postgres --dbhost 192.168.12.2 --dbport 5432 --dbname postgres --dbpass postgres --overlay-network-name my-net --master-url tcp://zoe-master:4850 --auth-type ldap --ldap-server-uri ldap://172.17.0.6 --ldap-base-dn ou=users,dc=example,dc=com --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --gelf-address udp://192.168.12.2:5004
ports:
- "5001:5001"
logging:
......@@ -16,7 +16,7 @@ services:
image: 192.168.12.2:5000/zoe:reducetime
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: python3 zoe-master.py --debug --swarm consul://192.168.12.2 --deployment-name prod --dbuser postgres --dbhost 192.168.12.2 --dbport 5432 --dbname postgres --dbpass postgres --overlay-network-name my-net --auth-type ldap --ldap-server-uri ldap://ldapker.example.com --ldap-base-dn ou=users,dc=example,dc=com --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --gelf-address udp://192.168.12.2:5004
command: python3 zoe-master.py --debug --backend-swarm-url consul://192.168.12.2 --deployment-name prod --dbuser postgres --dbhost 192.168.12.2 --dbport 5432 --dbname postgres --dbpass postgres --overlay-network-name my-net --auth-type ldap --ldap-server-uri ldap://ldapker.example.com --ldap-base-dn ou=users,dc=example,dc=com --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --gelf-address udp://192.168.12.2:5004
ports:
- "4850:4850"
depends_on:
......
version: '2'
services:
zoe-api-test:
image: 192.168.12.2:5000/zoe:reducetime
image: 192.168.12.2:5000/zoe:wi9
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: python3 zoe-api.py --debug --swarm consul://192.168.12.2 --deployment-name test --dbuser postgres --dbhost 192.168.12.2 --dbport 4321 --dbname postgres --dbpass postgres --overlay-network-name my-net --master-url tcp://zoe-master-test:4850 --auth-type text --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --listen-port 5100 --gelf-address udp://192.168.12.2:5004
command: python3 zoe-api.py --debug --backend-swarm-url consul://192.168.12.2 --deployment-name test --dbuser postgres --dbhost 192.168.12.2 --dbport 4321 --dbname postgres --dbpass postgres --overlay-network-name my-net --master-url tcp://zoe-master-test:4850 --auth-type text --proxy-type none --listen-port 5100
ports:
- "5100:5100"
logging:
driver: "gelf"
options:
gelf-address: "udp://192.168.12.2:5004"
tag: "zoe-api"
zoe-master-test:
image: 192.168.12.2:5000/zoe:reducetime
image: 192.168.12.2:5000/zoe:wi9
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: python3 zoe-master.py --debug --swarm consul://192.168.12.2 --deployment-name test --dbuser postgres --dbhost 192.168.12.2 --dbport 4321 --dbname postgres --dbpass postgres --overlay-network-name my-net --auth-type text --proxy-type apache --proxy-container apache2 --proxy-config-file /etc/apache2/sites-available/all.conf --proxy-path fsdna.on.kpmg.de/zoe --listen-port 5100 --gelf-address udp://192.168.12.2:5004 --gelf-address udp://192.168.12.2:5004
- /mnt/zoe-workspaces:/mnt/zoe-workspaces
command: python3 zoe-master.py --debug --backend-swarm-url consul://192.168.12.2 --deployment-name test --dbuser postgres --dbhost 192.168.12.2 --dbport 4321 --dbname postgres --dbpass postgres --overlay-network-name my-net --auth-type text --proxy-type none --listen-port 5100
depends_on:
- zoe-api
logging:
driver: "gelf"
options:
gelf-address: "udp://192.168.12.2:5004"
tag: "zoe-master"
- zoe-api-test
......@@ -58,23 +58,20 @@ class ZoeImage():
def build(self):
""" Build docker image """
ret = 1
for line in self.cli.images.build(path='.', tag=self.tag, rm=True):
print(line)
if 'error' in str(line):
ret = 0
try:
self.cli.images.build(path='.', tag=self.tag, rm=True)
except Exception:
ret = 0
return ret
def push(self):
""" Push docker image """
ret = 1
for line in self.cli.images.push(self.tag, stream=True):
print(line)
if 'error' in str(line):
ret = 0
try:
self.cli.images.push(self.tag, stream=True)
except Exception:
ret = 0
pass
return ret
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment