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
a82c6b3b
Commit
a82c6b3b
authored
Dec 29, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added 30s timeout to deployer
parent
24692805
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
9 deletions
+9
-9
ansible_playbook.py
drip-deployer/ansible_playbook.py
+1
-1
control_agent.py
drip-deployer/control_agent.py
+1
-1
docker_check.py
drip-deployer/docker_check.py
+1
-1
docker_compose.py
drip-deployer/docker_compose.py
+1
-1
docker_engine.py
drip-deployer/docker_engine.py
+1
-1
docker_kubernetes.py
drip-deployer/docker_kubernetes.py
+1
-1
docker_service.py
drip-deployer/docker_service.py
+1
-1
docker_swarm.py
drip-deployer/docker_swarm.py
+2
-2
No files found.
drip-deployer/ansible_playbook.py
View file @
a82c6b3b
...
@@ -66,7 +66,7 @@ def install_prerequisites(vm,return_dict):
...
@@ -66,7 +66,7 @@ def install_prerequisites(vm,return_dict):
logger
.
info
(
"Installing ansible prerequisites on: "
+
vm
.
ip
)
logger
.
info
(
"Installing ansible prerequisites on: "
+
vm
.
ip
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
sftp
=
ssh
.
open_sftp
()
sftp
=
ssh
.
open_sftp
()
file_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
file_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sftp
.
chdir
(
'/tmp/'
)
sftp
.
chdir
(
'/tmp/'
)
...
...
drip-deployer/control_agent.py
View file @
a82c6b3b
...
@@ -39,7 +39,7 @@ def install_agent(vm, vm_list):
...
@@ -39,7 +39,7 @@ def install_agent(vm, vm_list):
logger
.
info
(
"Starting control agent installation on: "
+
(
vm
.
ip
))
logger
.
info
(
"Starting control agent installation on: "
+
(
vm
.
ip
))
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
sftp
=
ssh
.
open_sftp
()
sftp
=
ssh
.
open_sftp
()
sftp
.
chdir
(
'/tmp/'
)
sftp
.
chdir
(
'/tmp/'
)
vm_cnt
=
0
vm_cnt
=
0
...
...
drip-deployer/docker_check.py
View file @
a82c6b3b
...
@@ -51,7 +51,7 @@ def docker_check(vm, compose_name):
...
@@ -51,7 +51,7 @@ def docker_check(vm, compose_name):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
node_format
=
'
\'
{
\"
ID
\"
:
\"
{{.ID}}
\"
,
\"
hostname
\"
:
\"
{{.Hostname}}
\"
,
\"
status
\"
:
\"
{{.Status}}
\"
,
\"
availability
\"
:
\"
{{.Availability}}
\"
,
\"
status
\"
:
\"
{{.Status}}
\"
}
\'
'
node_format
=
'
\'
{
\"
ID
\"
:
\"
{{.ID}}
\"
,
\"
hostname
\"
:
\"
{{.Hostname}}
\"
,
\"
status
\"
:
\"
{{.Status}}
\"
,
\"
availability
\"
:
\"
{{.Availability}}
\"
,
\"
status
\"
:
\"
{{.Status}}
\"
}
\'
'
cmd
=
'sudo docker node ls --format '
+
(
node_format
)
cmd
=
'sudo docker node ls --format '
+
(
node_format
)
...
...
drip-deployer/docker_compose.py
View file @
a82c6b3b
...
@@ -41,7 +41,7 @@ def deploy_compose(vm, compose_file, compose_name,docker_login):
...
@@ -41,7 +41,7 @@ def deploy_compose(vm, compose_file, compose_name,docker_login):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
1
0
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
3
0
)
sftp
=
ssh
.
open_sftp
()
sftp
=
ssh
.
open_sftp
()
sftp
.
chdir
(
'/tmp/'
)
sftp
.
chdir
(
'/tmp/'
)
sftp
.
put
(
compose_file
,
"docker-compose.yml"
)
sftp
.
put
(
compose_file
,
"docker-compose.yml"
)
...
...
drip-deployer/docker_engine.py
View file @
a82c6b3b
...
@@ -41,7 +41,7 @@ def install_engine(vm,return_dict):
...
@@ -41,7 +41,7 @@ def install_engine(vm,return_dict):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo dpkg --get-selections | grep docker"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo dpkg --get-selections | grep docker"
)
temp_list
=
stdout
.
readlines
()
temp_list
=
stdout
.
readlines
()
temp_str
=
""
temp_str
=
""
...
...
drip-deployer/docker_kubernetes.py
View file @
a82c6b3b
...
@@ -95,7 +95,7 @@ def install_worker(join_cmd, vm):
...
@@ -95,7 +95,7 @@ def install_worker(join_cmd, vm):
logger
.
info
(
"Starting kubernetes slave installation on: "
+
(
vm
.
ip
))
logger
.
info
(
"Starting kubernetes slave installation on: "
+
(
vm
.
ip
))
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
parentDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
vm
.
key
))
parentDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
vm
.
key
))
os
.
chmod
(
parentDir
,
0o700
)
os
.
chmod
(
parentDir
,
0o700
)
...
...
drip-deployer/docker_service.py
View file @
a82c6b3b
...
@@ -41,7 +41,7 @@ def scale_service(vm, application_name, service_name, service_num):
...
@@ -41,7 +41,7 @@ def scale_service(vm, application_name, service_name, service_num):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker service scale
%
s_
%
s=
%
s"
%
(
application_name
,
service_name
,
service_num
))
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker service scale
%
s_
%
s=
%
s"
%
(
application_name
,
service_name
,
service_num
))
stdout
.
read
()
stdout
.
read
()
logger
.
info
(
"Finished docker service scaling on: "
+
vm
.
ip
)
logger
.
info
(
"Finished docker service scaling on: "
+
vm
.
ip
)
...
...
drip-deployer/docker_swarm.py
View file @
a82c6b3b
...
@@ -43,7 +43,7 @@ def install_manager(vm):
...
@@ -43,7 +43,7 @@ def install_manager(vm):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Swarm'"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Swarm'"
)
temp_list1
=
stdout
.
readlines
()
temp_list1
=
stdout
.
readlines
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Is Manager'"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Is Manager'"
)
...
@@ -79,7 +79,7 @@ def install_worker(join_cmd, vm,return_dict):
...
@@ -79,7 +79,7 @@ def install_worker(join_cmd, vm,return_dict):
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
paramiko
.
util
.
log_to_file
(
"deployment.log"
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
,
timeout
=
30
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Swarm'"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker info | grep 'Swarm'"
)
temp_list1
=
stdout
.
readlines
()
temp_list1
=
stdout
.
readlines
()
if
temp_list1
[
0
]
.
find
(
"Swarm: active"
)
!=
-
1
:
if
temp_list1
[
0
]
.
find
(
"Swarm: active"
)
!=
-
1
:
...
...
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