Переглянути джерело

modify docker bash command

master
Jeong Geol Kim 4 роки тому
джерело
коміт
abcc6b28da
3 змінених файлів з 12 додано та 12 видалено
  1. 3
    3
      auto_coordinate.py
  2. 4
    4
      auto_extract.py
  3. 5
    5
      auto_kpi.py

+ 3
- 3
auto_coordinate.py Переглянути файл

23
                 logs = f.readlines()
23
                 logs = f.readlines()
24
                 f.close()
24
                 f.close()
25
                 if len(logs) == 4:
25
                 if len(logs) == 4:
26
-                    f = open(file, 'ar')
26
+                    f = open(file, 'at')
27
                     r_time = time.ctime(time.time())
27
                     r_time = time.ctime(time.time())
28
                     f.write('global coordinate successfully starts at ' + str(r_time) + '\n')
28
                     f.write('global coordinate successfully starts at ' + str(r_time) + '\n')
29
                     f.close()
29
                     f.close()
30
                     #FIXME: change coordinate_g.py when IMU sensor works
30
                     #FIXME: change coordinate_g.py when IMU sensor works
31
-                    os.system('run --rm --name coordinate --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/coordinate_g.py ' + id + '/ >> /dev/null')
32
-                    f = open(file, 'ar')
31
+                    os.system('docker run --rm --name coordinate --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/coordinate_g.py ' + id + '/ >> /dev/null')
32
+                    f = open(file, 'at')
33
                     r_time = time.ctime(time.time())
33
                     r_time = time.ctime(time.time())
34
                     f.write('global coordinate successfully ends at ' + str(r_time) + '\n')
34
                     f.write('global coordinate successfully ends at ' + str(r_time) + '\n')
35
                     f.close()
35
                     f.close()

+ 4
- 4
auto_extract.py Переглянути файл

23
                 logs = f.readlines()
23
                 logs = f.readlines()
24
                 f.close()
24
                 f.close()
25
                 if len(logs) == 2:
25
                 if len(logs) == 2:
26
-                    f = open(file, 'ar')
26
+                    f = open(file, 'at')
27
                     r_time = time.ctime(time.time())
27
                     r_time = time.ctime(time.time())
28
                     f.write('exectue is successfully starts at ' + str(r_time) + '\n')
28
                     f.write('exectue is successfully starts at ' + str(r_time) + '\n')
29
                     f.close()
29
                     f.close()
30
-                    os.system('run --rm --name extract_1 --gpus '"device=0"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_01.py ' + id + '/ >> /dev/null')
31
-                    os.system('run --rm --name extract_2 --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_02.py ' + id + '/ >> /dev/null')
32
-                    f = open(file, 'ar')
30
+                    os.system('docker run --rm --name extract_1 --gpus '"device=0"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_01.py ' + id + '/ >> /dev/null')
31
+                    os.system('docker run --rm --name extract_2 --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_02.py ' + id + '/ >> /dev/null')
32
+                    f = open(file, 'at')
33
                     r_time = time.ctime(time.time())
33
                     r_time = time.ctime(time.time())
34
                     f.write('exectue is successfully ends at ' + str(r_time) + '\n')
34
                     f.write('exectue is successfully ends at ' + str(r_time) + '\n')
35
                     f.close()
35
                     f.close()

+ 5
- 5
auto_kpi.py Переглянути файл

31
                 logs = f.readlines()
31
                 logs = f.readlines()
32
                 f.close()
32
                 f.close()
33
                 if len(logs) == 6:
33
                 if len(logs) == 6:
34
-                    f = open(file, 'ar')
34
+                    f = open(file, 'at')
35
                     r_time = time.ctime(time.time())
35
                     r_time = time.ctime(time.time())
36
                     f.write('kpi successfully starts at ' + str(r_time) + '\n')
36
                     f.write('kpi successfully starts at ' + str(r_time) + '\n')
37
                     f.close()
37
                     f.close()
38
                     #FIXME: change coordinate_g.py when IMU sensor works and get generic optimizer for DBSCAN
38
                     #FIXME: change coordinate_g.py when IMU sensor works and get generic optimizer for DBSCAN
39
-                    os.system('run --rm --name kpi --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/kpi.py ' + id + '/ >> /dev/null')
40
-                    f = open(file, 'ar')
39
+                    os.system('docker run --rm --name kpi --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/kpi.py ' + id + '/ >> /dev/null')
40
+                    f = open(file, 'at')
41
                     r_time = time.ctime(time.time())
41
                     r_time = time.ctime(time.time())
42
                     f.write('kpi successfully ends at ' + str(r_time) + '\n')
42
                     f.write('kpi successfully ends at ' + str(r_time) + '\n')
43
                     f.close()
43
                     f.close()
44
 
44
 
45
-                    transport = paramiko.Transport(('365mc.iptime.org', '63122'))
46
-                    transport.connect(username='mc365', password='tkadbrdhmc1!')
45
+                    transport = paramiko.Transport(('365mc.iptime.org', 63122))
46
+                    transport.connect(username='mc365', password='tkadbrdhMC1!')
47
                     sftp = paramiko.SFTPClient.from_transport(transport)
47
                     sftp = paramiko.SFTPClient.from_transport(transport)
48
                     #FIXME: send file recursively
48
                     #FIXME: send file recursively
49
                     for file in file_list:
49
                     for file in file_list:

Завантаження…
Відмінити
Зберегти