pilot.linkstec 0.0.10__py3-none-any.whl → 0.0.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pilot.linkstec might be problematic. Click here for more details.

@@ -81,9 +81,9 @@ class ConfigReader:
81
81
  steps = [s.strip() for s in steps_str.split(',')] if steps_str else []
82
82
  skipsteps_str = self.get('DEFAULT', 'skipsteps', fallback='')
83
83
  skipsteps = [s.strip() for s in skipsteps_str.split(',')] if skipsteps_str else []
84
- runsteps_str = self.get('DEFAULT', 'runstep', fallback='')
84
+ runsteps_str = self.get('DEFAULT', 'runsteps', fallback='')
85
85
  runsteps = [s.strip() for s in runsteps_str.split(',')] if runsteps_str else []
86
- multisteps_str = self.get('DEFAULT', 'multistep', fallback='')
86
+ multisteps_str = self.get('DEFAULT', 'multisteps', fallback='')
87
87
  multisteps = [s.strip() for s in multisteps_str.split(',')] if multisteps_str else []
88
88
 
89
89
  return ConfigDTO(
@@ -11,21 +11,46 @@ class BaseController(ControlInterface):
11
11
  def __init__(self):
12
12
  pass
13
13
 
14
-
15
14
  def _init_unit(self):
16
15
  return BaseUnit()
17
16
 
18
17
  def run(self,configfile: str = None):
19
18
  import time
20
19
  config_dto = ConfigReader(configfile).get_dto()
21
- def worker():
22
- unit = self._init_unit()
23
- unit.config_dto = config_dto
24
- unit.run()
25
- with ThreadPoolExecutor(max_workers=config_dto.threads) as executor:
26
- futures = []
27
- for _ in range(config_dto.threads):
28
- futures.append(executor.submit(worker))
29
- time.sleep(0.2)
30
- for future in futures:
31
- future.result()
20
+ unit = self._init_unit()
21
+ unit.config_dto = config_dto
22
+
23
+ steps = config_dto.steps
24
+ runsteps = config_dto.runsteps
25
+
26
+ def run_step(index):
27
+ if index >= len(steps):
28
+ return
29
+ step = steps[index]
30
+ if step in config_dto.skipsteps:
31
+ run_step(index + 1)
32
+ return
33
+
34
+ if len(runsteps) == 0:
35
+ pass
36
+ elif len(runsteps) != 0 and step not in runsteps:
37
+ run_step(index + 1)
38
+ return
39
+
40
+ max_workers = 1
41
+ if step in config_dto.multisteps:
42
+ max_workers = config_dto.threads
43
+
44
+ def step_worker():
45
+ unit.run(index)
46
+
47
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
48
+ futures = []
49
+ for _ in range(max_workers):
50
+ futures.append(executor.submit(step_worker))
51
+ time.sleep(0.5)
52
+ for future in futures:
53
+ future.result()
54
+ run_step(index + 1)
55
+
56
+ run_step(0)
@@ -1,6 +1,4 @@
1
1
  import os
2
- from concurrent.futures import ThreadPoolExecutor
3
- import time
4
2
 
5
3
  from pilot.unit.unit_interface import UnitInterface
6
4
  from pilot.job.impl.base_job import BaseJob
@@ -13,55 +11,14 @@ class BaseUnit(UnitInterface):
13
11
  def __init__(self):
14
12
  pass
15
13
 
16
-
17
14
  def _init_job(self,step):
18
15
  return BaseJob()
19
16
 
20
- def run(self):
17
+ def run(self, index=0):
21
18
  steps = self.config_dto.steps
22
- skipsteps = self.config_dto.skipsteps
23
-
24
- runsteps = self.config_dto.runsteps
25
-
26
- def run_step(index):
27
- if index >= len(steps):
28
- return
29
- step = steps[index]
30
- if step in skipsteps:
31
- run_step(index + 1)
32
- return
33
-
34
- if len(runsteps) == 0 :
35
- pass
36
- elif len(runsteps) != 0 and step not in runsteps:
37
- run_step(index + 1)
38
- return
39
-
40
- current_step_dir = self.config_dto.work_space + "/" + step
41
-
42
- max_workers = self.config_dto.threads
43
- unit_multiset = self.config_dto.multisteps
44
- if step in unit_multiset:
45
- max_workers = self.config_dto.threads
46
- else:
47
- max_workers = 1
48
- def step_worker():
49
- self._run_jobs_in_step_dir(current_step_dir, step, index)
50
-
51
- #with ThreadPoolExecutor(max_workers=max_workers) as executor:
52
- # future = executor.submit(step_worker)
53
- # future.result()
54
- # STEP完了後、次のSTEPを実行
55
- with ThreadPoolExecutor(max_workers=max_workers) as executor:
56
- futures = []
57
- for _ in range(max_workers):
58
- futures.append(executor.submit(step_worker))
59
- time.sleep(0.5)
60
- for future in futures:
61
- future.result()
62
- run_step(index + 1)
63
-
64
- run_step(0)
19
+ step = steps[index]
20
+ current_step_dir = self.config_dto.work_space + "/" + step
21
+ self._run_jobs_in_step_dir(current_step_dir, step, index)
65
22
 
66
23
  def _run_jobs_in_step_dir(self, current_step_dir, step, index):
67
24
  for dirpath, _, filenames in os.walk(current_step_dir):
@@ -75,6 +32,5 @@ class BaseUnit(UnitInterface):
75
32
  if self.job_need_run(job, filename, index):
76
33
  job.run()
77
34
 
78
-
79
35
  def job_need_run(self, job:BaseJob,filename: str,index):
80
36
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pilot.linkstec
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: pilot of the ship, a tool for managing and deploying Python projects.
5
5
  Author-email: wanglr <wanglr1980@gmail.com>
6
6
  License-Expression: MIT
@@ -1,10 +1,10 @@
1
1
  pilot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  pilot/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pilot/config/config_reader.py,sha256=wrb6bIDMYqZfp0KtoYIzoRMLmbKVEFaRhydm-csJaKM,3752
3
+ pilot/config/config_reader.py,sha256=zG_CFIgeTvrcXCtKmOgXC39625XFFIPGuw4u9lzkeEs,3754
4
4
  pilot/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  pilot/control/control_interface.py,sha256=zGv380oQgAKPAIHDHeFdPYzhj2Ngo2T66NWlNloA7vY,124
6
6
  pilot/control/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- pilot/control/impl/base_controller.py,sha256=XdqpoyO6mw7sNp14hZo5BP1Eel39W8Q_VWmTMFYy4Wo,924
7
+ pilot/control/impl/base_controller.py,sha256=h-A2X4BD_4GGQ0BjCXv_tcO8XdM8_YjXHDIZzvdzyjQ,1634
8
8
  pilot/conver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  pilot/conver/converfileEncodding.py,sha256=UqjcWO0bzkuTRHLEWrWJkeo3p-P7WuYE7jFKveyPekA,2781
10
10
  pilot/conver/nkf_converter.py,sha256=JqgThmXcdnTGMsLIHUEwe8sc0VGMqDaKCIQTg-UE3WE,1148
@@ -19,11 +19,11 @@ pilot/splitters/cobolsplitter.py,sha256=oPwxKRjA7TyXWaWV3jdy59lJZy1mRn6yxD9ivqFY
19
19
  pilot/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  pilot/unit/unit_interface.py,sha256=fE8N4h_rZU-dWLHy9o0EE3yyErGmRyIuGUDb-zqe7qo,167
21
21
  pilot/unit/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- pilot/unit/impl/base_unit.py,sha256=lSQiP9NuHgapO8PJGrsTkejFwJhernbk6qPYH_8thi8,2719
22
+ pilot/unit/impl/base_unit.py,sha256=LsFPpL28aSNv5rsZhfKv6CWhAw1XR4n-A6FOn2RBrZo,1272
23
23
  pilot/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  pilot/util/files.py,sha256=v9uzfzo3Aq4xgnUIASEZeBJoA2nD9Qz_EA3P-FwzGFQ,1896
25
- pilot_linkstec-0.0.10.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
26
- pilot_linkstec-0.0.10.dist-info/METADATA,sha256=ge675xquQ47T08TWMZz0LXx-C9xWohZ9eDlChc85-9E,679
27
- pilot_linkstec-0.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- pilot_linkstec-0.0.10.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
29
- pilot_linkstec-0.0.10.dist-info/RECORD,,
25
+ pilot_linkstec-0.0.12.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
26
+ pilot_linkstec-0.0.12.dist-info/METADATA,sha256=ELdi7kuau5JI1tVRE6HooTPRHTBvZbcyY_K6g0xAoaM,679
27
+ pilot_linkstec-0.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
+ pilot_linkstec-0.0.12.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
29
+ pilot_linkstec-0.0.12.dist-info/RECORD,,