|
|
@@ -5,6 +5,7 @@ import time
|
|
5
|
5
|
from datetime import datetime
|
|
6
|
6
|
from tkinter import messagebox
|
|
7
|
7
|
import os
|
|
|
8
|
+import git
|
|
8
|
9
|
|
|
9
|
10
|
from paramiko import file
|
|
10
|
11
|
import pymssql
|
|
|
@@ -43,7 +44,9 @@ def sshConnect(cs, sd):
|
|
43
|
44
|
data_root_dir = './data/'+cs+sd
|
|
44
|
45
|
stdin, stdout, stderr = ssh.exec_command('mkdir ' + data_root_dir)
|
|
45
|
46
|
#TODO: 여기에 도커 명령어 및 동시 녹화 코드 입력
|
|
46
|
|
- stdin, stdout, stderr = ssh.exec_command('docker run --rm --name mail_recorder --gpus 1 --privileged -v /dev:/dev -v /home/mc365/sources:/sources -v /home/mc365/data/'+cs+sd+':/data/'+cs+sd+' stereolabs/zed:3.5-gl-devel-cuda11.1-ubuntu18.04 python3 /sources/recorder.py')
|
|
|
47
|
+ cmd = 'docker run --rm --name mail_recorder --gpus 1 --privileged -v /dev:/dev -v /home/mc365/sources:/sources -v /home/mc365/data/'+cs+sd+':/data/'+cs+sd+' stereolabs/zed:3.5-gl-devel-cuda11.1-ubuntu18.04 python3 /sources/rec_ubuntu.py'
|
|
|
48
|
+ print(cmd)
|
|
|
49
|
+ stdin, stdout, stderr = ssh.exec_command(cmd)
|
|
47
|
50
|
f = open(filepath, 'w')
|
|
48
|
51
|
r_time = time.ctime(time.time())
|
|
49
|
52
|
f.write('record succesfully started at ' + str(r_time) + '\n')
|
|
|
@@ -75,11 +78,10 @@ def sshQuit(cs, sd):
|
|
75
|
78
|
|
|
76
|
79
|
ssh = paramiko.SSHClient()
|
|
77
|
80
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
78
|
|
- ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
|
|
79
|
|
- stdin, stdout, stderr = ssh.exec_command('docker stop mail_recorder')
|
|
80
|
|
- time.sleep(10)
|
|
81
|
|
- stdin, stdout, stderr = ssh.exec_command('mv ' + data_root_dir + ' /hdd/')
|
|
82
|
|
-
|
|
|
81
|
+ ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
|
|
|
82
|
+ t = ssh.get_transport()
|
|
|
83
|
+ c = t.open_session()
|
|
|
84
|
+ c.exec_command('docker stop mail_recorder && mv ' + data_root_dir + ' /hdd/')
|
|
83
|
85
|
|
|
84
|
86
|
|
|
85
|
87
|
|
|
|
@@ -159,4 +161,11 @@ entry_customer_code.pack()
|
|
159
|
161
|
|
|
160
|
162
|
button_confirm.pack()
|
|
161
|
163
|
|
|
162
|
|
-window.mainloop()
|
|
|
164
|
+if __name__ == "__main__":
|
|
|
165
|
+ lastmod = int(os.path.getmtime('./main.py'))
|
|
|
166
|
+ print(lastmod)
|
|
|
167
|
+ os.system('git clone -b alpha https://git.apl.hongik.ac.kr/Ellis/mailsys_client.git')
|
|
|
168
|
+ if lastmod != int(os.path.getmtime('./main.py')):
|
|
|
169
|
+ pass
|
|
|
170
|
+ else:
|
|
|
171
|
+ window.mainloop()
|