From e2b54db2741f6eabfd11ce7482f36dbd5d957c15 Mon Sep 17 00:00:00 2001 From: wass Date: Sun, 21 Apr 2024 09:57:51 +0200 Subject: [PATCH] add the cache --- .gitignore | 1 - cache/artifacts.json | 26 +++++++++ cache/dependencies.dot | 18 ++++++ cache/dependencies.dot.svg | 109 +++++++++++++++++++++++++++++++++++++ cache/dependencies.json | 70 ++++++++++++++++++++++++ cache/fetch/content.json | 3 + cache/fetch/result.json | 3 + cache/fetch/stats.json | 3 + cache/fetch/website.json | 3 + cache/pipeline.json | 34 ++++++++++++ cache/test/example.dot | 6 ++ cache/test/example.dot.svg | 61 +++++++++++++++++++++ cache/test/gen.dot | 7 +++ cache/test/gen.dot.svg | 45 +++++++++++++++ 14 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 cache/artifacts.json create mode 100644 cache/dependencies.dot create mode 100644 cache/dependencies.dot.svg create mode 100644 cache/dependencies.json create mode 100644 cache/fetch/content.json create mode 100644 cache/fetch/result.json create mode 100644 cache/fetch/stats.json create mode 100644 cache/fetch/website.json create mode 100644 cache/pipeline.json create mode 100644 cache/test/example.dot create mode 100644 cache/test/example.dot.svg create mode 100644 cache/test/gen.dot create mode 100644 cache/test/gen.dot.svg diff --git a/.gitignore b/.gitignore index e3594ec..028565b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ __pycache__ venv -/cache /dist diff --git a/cache/artifacts.json b/cache/artifacts.json new file mode 100644 index 0000000..187d8ea --- /dev/null +++ b/cache/artifacts.json @@ -0,0 +1,26 @@ +{ + "content": { + "path": "fetch", + "ext": ".json", + "type": "generic", + "filepath": "fetch/content.json" + }, + "stats": { + "path": "fetch", + "ext": ".json", + "type": "generic", + "filepath": "fetch/stats.json" + }, + "result": { + "path": "fetch", + "ext": ".json", + "type": "generic", + "filepath": "fetch/result.json" + }, + "website": { + "path": "fetch", + "ext": ".json", + "type": "generic", + "filepath": "fetch/website.json" + } +} \ No newline at end of file diff --git a/cache/dependencies.dot b/cache/dependencies.dot new file mode 100644 index 0000000..d2f422f --- /dev/null +++ b/cache/dependencies.dot @@ -0,0 +1,18 @@ +digraph G { + A [label="fetch-data-1", class="job", shape="box"]; + B [label="content", class="artifact", shape="ellipse"]; + C [label="calculate-functions", class="job", shape="box"]; + D [label="stats", class="artifact", shape="ellipse"]; + E [label="compute-statistics", class="job", shape="box"]; + F [label="result", class="artifact", shape="ellipse"]; + G [label="generate-website", class="job", shape="box"]; + H [label="website", class="artifact", shape="ellipse"]; + A -> B; + B -> C; + C -> D; + B -> E; + E -> F; + D -> G; + F -> G; + G -> H; +} \ No newline at end of file diff --git a/cache/dependencies.dot.svg b/cache/dependencies.dot.svg new file mode 100644 index 0000000..5653bb1 --- /dev/null +++ b/cache/dependencies.dot.svg @@ -0,0 +1,109 @@ + + + + + + +G + + + +A + +fetch-data-1 + + + +B + +content + + + +A->B + + + + + +C + +calculate-functions + + + +B->C + + + + + +E + +compute-statistics + + + +B->E + + + + + +D + +stats + + + +C->D + + + + + +G + +generate-website + + + +D->G + + + + + +F + +result + + + +E->F + + + + + +F->G + + + + + +H + +website + + + +G->H + + + + + diff --git a/cache/dependencies.json b/cache/dependencies.json new file mode 100644 index 0000000..bbc4958 --- /dev/null +++ b/cache/dependencies.json @@ -0,0 +1,70 @@ +{ + "nodes": [ + { + "label": "fetch-data-1", + "class": "job" + }, + { + "label": "content", + "class": "artifact" + }, + { + "label": "calculate-functions", + "class": "job" + }, + { + "label": "stats", + "class": "artifact" + }, + { + "label": "compute-statistics", + "class": "job" + }, + { + "label": "result", + "class": "artifact" + }, + { + "label": "generate-website", + "class": "job" + }, + { + "label": "website", + "class": "artifact" + } + ], + "edges": [ + { + "source": "fetch-data-1", + "target": "content" + }, + { + "source": "content", + "target": "calculate-functions" + }, + { + "source": "calculate-functions", + "target": "stats" + }, + { + "source": "content", + "target": "compute-statistics" + }, + { + "source": "compute-statistics", + "target": "result" + }, + { + "source": "stats", + "target": "generate-website" + }, + { + "source": "result", + "target": "generate-website" + }, + { + "source": "generate-website", + "target": "website" + } + ] +} \ No newline at end of file diff --git a/cache/fetch/content.json b/cache/fetch/content.json new file mode 100644 index 0000000..309b1fc --- /dev/null +++ b/cache/fetch/content.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} \ No newline at end of file diff --git a/cache/fetch/result.json b/cache/fetch/result.json new file mode 100644 index 0000000..242cafb --- /dev/null +++ b/cache/fetch/result.json @@ -0,0 +1,3 @@ +{ + "result": 6 +} \ No newline at end of file diff --git a/cache/fetch/stats.json b/cache/fetch/stats.json new file mode 100644 index 0000000..cae1c80 --- /dev/null +++ b/cache/fetch/stats.json @@ -0,0 +1,3 @@ +{ + "stats": 5 +} \ No newline at end of file diff --git a/cache/fetch/website.json b/cache/fetch/website.json new file mode 100644 index 0000000..d337619 --- /dev/null +++ b/cache/fetch/website.json @@ -0,0 +1,3 @@ +{ + "web": 10 +} \ No newline at end of file diff --git a/cache/pipeline.json b/cache/pipeline.json new file mode 100644 index 0000000..2416b8e --- /dev/null +++ b/cache/pipeline.json @@ -0,0 +1,34 @@ +[ + { + "stage": "fetch", + "job": "fetch-data-1", + "start": "2024-04-21 09:50:41.486325", + "stop": "2024-04-21 09:50:41.587123", + "duration": "0:00:00.100798", + "duration_text": "100 ms" + }, + { + "stage": "process", + "job": "calculate-functions", + "start": "2024-04-21 09:50:41.587123", + "stop": "2024-04-21 09:50:41.889199", + "duration": "0:00:00.302076", + "duration_text": "302 ms" + }, + { + "stage": "process", + "job": "compute-statistics", + "start": "2024-04-21 09:50:41.889199", + "stop": "2024-04-21 09:50:42.290750", + "duration": "0:00:00.401551", + "duration_text": "401 ms" + }, + { + "stage": "build", + "job": "generate-website", + "start": "2024-04-21 09:50:42.290750", + "stop": "2024-04-21 09:50:42.793770", + "duration": "0:00:00.503020", + "duration_text": "503 ms" + } +] \ No newline at end of file diff --git a/cache/test/example.dot b/cache/test/example.dot new file mode 100644 index 0000000..b3e5351 --- /dev/null +++ b/cache/test/example.dot @@ -0,0 +1,6 @@ +digraph G { + A -> B; + B -> C; + C -> A; + C -> L; +} diff --git a/cache/test/example.dot.svg b/cache/test/example.dot.svg new file mode 100644 index 0000000..d9f884b --- /dev/null +++ b/cache/test/example.dot.svg @@ -0,0 +1,61 @@ + + + + + + +G + + + +A + +A + + + +B + +B + + + +A->B + + + + + +C + +C + + + +B->C + + + + + +C->A + + + + + +L + +L + + + +C->L + + + + + diff --git a/cache/test/gen.dot b/cache/test/gen.dot new file mode 100644 index 0000000..a6a619c --- /dev/null +++ b/cache/test/gen.dot @@ -0,0 +1,7 @@ +digraph G { + A [label="Node A"]; + B [label="Node B"]; + C [label="Node C"]; + A -> B [label="A to B"]; + B -> C [label="B to C"]; +} \ No newline at end of file diff --git a/cache/test/gen.dot.svg b/cache/test/gen.dot.svg new file mode 100644 index 0000000..0af769f --- /dev/null +++ b/cache/test/gen.dot.svg @@ -0,0 +1,45 @@ + + + + + + +G + + + +A + +Node A + + + +B + +Node B + + + +A->B + + +A to B + + + +C + +Node C + + + +B->C + + +B to C + + +