Skip to content

Commit 09551e8

Browse files
committed
Progress on cleaning store.
1 parent 61ef39f commit 09551e8

18 files changed

+193
-255
lines changed

docs/jobs_diagram.png

9.2 KB
Loading
6.87 KB
Loading

docs/jobs_flow_diagram.py

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,37 @@
1616
# NON-ZIP NODES
1717
dot.node('START', 'START', shape='ellipse', fillcolor='black', fontcolor='white')
1818
dot.node('END', 'END', shape='ellipse', fillcolor='#77DD77')
19-
dot.node('A', 'FetchFileJob [db]')
20-
dot.node('C', 'OpenDbJob', fillcolor='#ffefd5')
19+
dot.node('ABORT', 'ABORT', shape='ellipse', fillcolor='#ff8f8f')
20+
dot.node('A', 'FetchDataJob [db]')
21+
dot.node('B', 'LoadLocalStoreJob', fillcolor='#ffefd5')
22+
dot.node('C', 'OpenDbJob', fillcolor='#B0E0E6')
2123
dot.node('D', 'ProcessDbMainJob', fillcolor='#B0E0E6')
22-
dot.node('E', 'ProcessDbIndexJob', fillcolor='#B0E0E6')
24+
dot.node('E', 'ProcessDbIndexJob', fillcolor='#B0E0E6:#ffefd5')
2325
dot.node('M', 'FetchFileJob [file]')
24-
dot.node('N', 'ValidateFileJob [file]', fillcolor='#ffefd5')
2526

2627
# Example "legend" nodes
2728
dot.node('0', 'CPU', fillcolor='#B0E0E6')
2829
dot.node('1', 'File System', fillcolor='#ffefd5')
2930
dot.node('2', 'Network')
3031

3132
dot.edge('START', 'A', label='1:N')
33+
dot.edge('START', 'B')
3234

3335
dot.edge('A', 'C', weight='10')
34-
dot.edge('C', 'D', weight='10')
35-
dot.edge('D', 'E', weight='10')
36+
dot.edge('C', 'D', weight='10', label=' db + store')
37+
dot.edge('D', 'E', weight='10', label=' if no zips')
3638

37-
dot.edge('E', 'M', label='1:N')
38-
dot.edge('M', 'N')
39+
dot.edge('E', 'M', label=' 1:N')
3940

41+
dot.edge('B', 'C', style='dotted', constraint='true', label='wait\nstore', dir='back')
42+
43+
dot.edge('B', 'B', label=' retry', style='dashed', constraint='false')
44+
dot.edge('A', 'A', label=' retry', style='dashed', constraint='false')
4045
dot.edge('C', 'A', label=' retry', style='dashed', constraint='true')
41-
dot.edge('N', 'M', label=' retry', style='dashed', constraint='false')
46+
dot.edge('M', 'M', label=' retry', style='dashed', constraint='false')
4247

43-
dot.edge('N', 'END', weight='20', constraint='true')
48+
dot.edge('M', 'END', weight='20', constraint='true')
49+
dot.edge('B', 'ABORT', weight='20', constraint='true', label=' if always fails', style='dashed')
4450

4551
dot.render('jobs_diagram', format='png', cleanup=True)
4652

@@ -50,49 +56,50 @@
5056
c.node('3', 'Zip Feature', style='filled', fillcolor='#8f8fff', fontcolor='white', penwidth='0')
5157

5258
c.node('O', 'WaitDbZipsJob', fillcolor='#B0E0E6')
53-
c.node('F', 'ProcessZipIndexJob', fillcolor='#B0E0E6')
54-
c.node('G', 'FetchFileJob [zip summary]')
55-
c.node('H', 'ValidateFileJob [zip summary]', fillcolor='#ffefd5')
56-
c.node('I', 'OpenZipSummaryJob', fillcolor='#ffefd5')
57-
c.node('J', 'FetchFileJob [zip contents]')
58-
c.node('K', 'ValidateFileJob [zip contents]', fillcolor='#ffefd5')
59+
c.node('F', 'ProcessZipIndexJob', fillcolor='#B0E0E6:#ffefd5')
60+
c.node('G', 'FetchDataJob [zip summary]')
61+
c.node('I', 'OpenZipSummaryJob', fillcolor='#B0E0E6')
62+
c.node('DOT0', '', shape='circle', fixedsize='true', width='0.01', fillcolor='#ff8f8f')
63+
c.node('J', 'FetchDataJob [zip contents]')
5964
c.node('L', 'OpenZipContentsJob', fillcolor='#ffefd5')
60-
c.node('Q', '', shape='circle', fixedsize='true', width='0.01', fillcolor='#ff8f8f')
65+
c.node('DOT1', '', shape='circle', fixedsize='true', width='0.01', fillcolor='#ff8f8f')
66+
c.node('DOT2', '', shape='circle', fixedsize='true', width='0.01', fillcolor='#ff8f8f')
6167
#
6268
# EDGES
6369
#
64-
dot.edge('D', 'O', weight='10')
65-
dot.edge('O', 'E', weight='10')
66-
dot.edge('D', 'G', label='1:N')
70+
dot.edge('D', 'O', weight='10', label='if zips')
71+
dot.edge('O', 'E', weight='10', label='store w/ deselected\nzip indexes')
72+
dot.edge('D', 'G', label='1:N (missing zips)')
6773

68-
dot.edge('F', 'J')
74+
dot.edge('F', 'J', label='if many file installs')
6975
dot.edge('I', 'F')
70-
dot.edge('G', 'H')
71-
dot.edge('H', 'I')
72-
dot.edge('J', 'K')
73-
dot.edge('K', 'L')
74-
dot.edge('L', 'M', label='1:N')
75-
dot.edge('F', 'Q', label='1:N', dir='none')
76-
dot.edge('Q', 'M')
76+
dot.edge('G', 'I')
77+
dot.edge('J', 'L')
78+
dot.edge('L', 'M', label='1:N\n(invalid files)')
79+
dot.edge('F', 'DOT1', dir='none')
80+
dot.edge('DOT1', 'DOT2', label='if just few\n file installs', dir='none')
81+
dot.edge('DOT2', 'M', label=' 1:N')
7782
#dot.edge('L', 'M', label='1:N')
7883

7984
# “Wait” edges
80-
dot.edge('F', 'O', style='dotted', constraint='true', label='wait')
85+
dot.edge('F', 'O', style='dotted', constraint='true', label='wait\n zip indexes', dir='back')
8186

8287
# Labeled “1:N” edges
83-
dot.edge('D', 'F', label='1:N', weight='5')
88+
dot.edge('D', 'F', label='1:N (stored zips)', weight='5')
8489

8590
# Edges to END
8691
dot.edge('L', 'END', weight='20', constraint='true')
8792

8893
# “Retry” edges
89-
dot.edge('H', 'G', label=' r', style='dashed', constraint='false')
90-
dot.edge('I', 'G', label=' r', style='dashed', constraint='false')
91-
dot.edge('K', 'J', label=' r', style='dashed', constraint='false')
92-
dot.edge('L', 'J', label=' r', style='dashed', constraint='false')
94+
dot.edge('G', 'G', label=' retry', style='dashed', constraint='false')
95+
dot.edge('I', 'G', label=' retry', style='dashed', constraint='false')
96+
dot.edge('J', 'J', label=' retry', style='dashed', constraint='false')
97+
dot.edge('L', 'J', label=' retry', style='dashed', constraint='false')
9398

9499
# "Backup" edges
95-
dot.edge('G', 'F', label='backup if stored', style='dashed', constraint='false')
100+
dot.edge('G', 'DOT0', style='dashed', constraint='true', dir='none')
101+
dot.edge('I', 'DOT0', style='dashed', constraint='true', dir='none')
102+
dot.edge('DOT0', 'F', label='backup:\nstored summary', style='dashed', constraint='false')
96103
#dot.edge('H', 'I', label='b', style='dashed', constraint='false', dir='none')
97104
#dot.edge('I', 'F', label='b', style='dashed', constraint='false')
98105
#dot.edge('J', 'E', label='b', style='dashed', constraint='false')

src/downloader/full_run_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def _full_run_impl(self):
107107
local_store = self._local_repository.load_store()
108108

109109
db_pkgs = [DbSectionPackage(db_id, section, local_store.store_by_id(db_id)) for db_id, section in sorted_db_sections(self._config)]
110+
#db_pkgs = [db_pkg for db_pkg in db_pkgs if db_pkg.db_id == 'distribution_mister']
110111

111112
for relocation_package in self._base_path_relocator.relocating_base_paths(db_pkgs):
112113
self._base_path_relocator.relocate_non_system_files(relocation_package)

src/downloader/jobs/open_db_worker.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ def operate_on(self, job: OpenDbJob) -> WorkerResult: # type: ignore[override]
3939
return [ProcessDbMainJob(db=db, ini_description=ini_description, store=store, full_resync=full_resync).add_tag(make_db_tag(job.section))], None
4040

4141
def _open_db(self, section: str, transfer: Any) -> DbEntity:
42-
self._ctx.logger.bench('Loading database start: ', section)
42+
self._ctx.logger.bench('OpenDbWorker Loading database: ', section)
4343
db_raw = self._ctx.file_system.load_dict_from_transfer(transfer)
44-
self._ctx.logger.bench('Loading database end: ', section)
45-
self._ctx.logger.bench('Validating database start: ', section)
44+
self._ctx.logger.bench('OpenDbWorker Validating database: ', section)
4645
db_entity = DbEntity(db_raw, section)
47-
self._ctx.logger.bench('Validating database end: ', section)
46+
self._ctx.logger.bench('OpenDbWorker end: ', section)
4847
return db_entity

src/downloader/jobs/process_db_index_job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
class ProcessDbIndexJob(Job):
3333
type_id: int = field(init=False, default=JobSystem.get_job_type_id())
3434

35+
# Inputs
3536
db: DbEntity
3637
store: StoreWrapper
3738
ini_description: Dict[str, Any]

0 commit comments

Comments
 (0)