Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
77886590
Commit
77886590
authored
Mar 01, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle deployer errors
parent
9e000fff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
docker_kubernetes.py
drip-deployer/docker_kubernetes.py
+12
-4
docker_kubernetes.pyc
drip-deployer/docker_kubernetes.pyc
+0
-0
rpc_server.py
drip-deployer/rpc_server.py
+14
-10
No files found.
drip-deployer/docker_kubernetes.py
View file @
77886590
...
...
@@ -45,6 +45,7 @@ def install_manager(vm):
print
"
%
s: ========= Kubernetes Master Installed ========="
%
(
vm
.
ip
)
except
Exception
as
e
:
print
'
%
s:
%
s'
%
(
vm
.
ip
,
e
)
return
"ERROR:"
+
vm
.
ip
+
" "
+
str
(
e
)
ssh
.
close
()
return
retstr
[
-
1
]
...
...
@@ -68,14 +69,21 @@ def install_worker(join_cmd, vm):
print
"
%
s: ========= Kubernetes Slave Installed ========="
%
(
vm
.
ip
)
except
Exception
as
e
:
print
'
%
s:
%
s'
%
(
vm
.
ip
,
e
)
return
"ERROR:"
+
vm
.
ip
+
" "
+
str
(
e
)
ssh
.
close
()
return
""
def
run
(
vm_list
):
for
i
in
vm_list
:
if
i
.
role
==
"master"
:
join_cmd
=
install_manager
(
i
)
join_cmd
=
join_cmd
.
encode
()
join_cmd
=
join_cmd
.
strip
()
if
"ERROR"
in
join_cmd
:
return
join_cmd
else
:
join_cmd
=
join_cmd
.
encode
()
join_cmd
=
join_cmd
.
strip
()
for
i
in
vm_list
:
if
i
.
role
==
"slave"
:
install_worker
(
join_cmd
,
i
)
if
i
.
role
==
"slave"
:
worker_cmd
=
install_worker
(
join_cmd
,
i
)
if
"ERROR"
in
worker_cmd
:
return
worker_cmd
return
""
\ No newline at end of file
drip-deployer/docker_kubernetes.pyc
View file @
77886590
No preview for this file type
drip-deployer/rpc_server.py
View file @
77886590
...
...
@@ -2,7 +2,7 @@
import
pika
import
json
import
os
import
time
from
vm_info
import
VmInfo
import
docker_kubernetes
...
...
@@ -30,17 +30,21 @@ def handleDelivery(message):
fo
.
close
()
vm
=
VmInfo
(
ip
,
user
,
key
,
role
)
vm_list
.
append
(
vm
)
docker_kubernetes
.
run
(
vm_list
)
return
docker_kubernetes
.
run
(
vm_list
)
def
on_request
(
ch
,
method
,
props
,
body
):
handleDelivery
(
body
)
print
(
" Message
%
s"
%
body
)
kuber_file
=
open
(
path
+
"admin.conf"
,
"r"
)
kuber_string
=
kuber_file
.
read
()
kuber_file
.
close
()
ret
=
handleDelivery
(
body
)
print
ret
if
"ERROR"
in
ret
:
kuber_string
=
ret
res_name
=
"error"
#print(" Message %s" % body)
else
:
res_name
=
"credential"
kuber_file
=
open
(
path
+
"admin.conf"
,
"r"
)
kuber_string
=
kuber_file
.
read
()
kuber_file
.
close
()
response
=
{}
outcontent
=
{}
...
...
@@ -50,7 +54,7 @@ def on_request(ch, method, props, body):
par
=
{}
par
[
"url"
]
=
"null"
par
[
"encoding"
]
=
"UTF-8"
par
[
"name"
]
=
"credential"
par
[
"name"
]
=
res_name
par
[
"value"
]
=
kuber_string
par
[
"attributes"
]
=
"null"
response
[
"parameters"
]
.
append
(
par
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment