Skip to content

Commit 67bf465

Browse files
committed
rendered correct timeline from assets
1 parent b307789 commit 67bf465

16 files changed

+171
-153
lines changed

cache/artifacts.json renamed to cache/assets/artifacts.json

+18-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,28 @@
1717
"type": "generic",
1818
"filepath": "fetch/result.json"
1919
},
20-
"timeline": {
21-
"path": "process",
22-
"ext": ".json",
23-
"type": "generic",
24-
"filepath": "process/timeline.json"
25-
},
2620
"website": {
2721
"path": "fetch",
2822
"ext": ".json",
2923
"type": "generic",
3024
"filepath": "fetch/website.json"
25+
},
26+
"pipeline": {
27+
"path": "assets",
28+
"ext": ".json",
29+
"type": "generic",
30+
"filepath": "assets/pipeline.json"
31+
},
32+
"dependencies": {
33+
"path": "assets",
34+
"ext": ".json",
35+
"type": "graph",
36+
"filepath": "assets/dependencies.json"
37+
},
38+
"timeline": {
39+
"path": "assets",
40+
"ext": ".json",
41+
"type": "generic",
42+
"filepath": "assets/timeline.json"
3143
}
3244
}

cache/dependencies.dot renamed to cache/assets/dependencies.dot

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ digraph G {
55
D [label="stats", class="artifact", shape="ellipse"];
66
E [label="compute-statistics", class="job", shape="box"];
77
F [label="result", class="artifact", shape="ellipse"];
8-
G [label="timeline", class="artifact", shape="ellipse"];
9-
H [label="generate-website", class="job", shape="box"];
10-
I [label="website", class="artifact", shape="ellipse"];
8+
G [label="generate-website", class="job", shape="box"];
9+
H [label="website", class="artifact", shape="ellipse"];
1110
A -> B;
1211
B -> C;
1312
C -> D;
1413
B -> E;
1514
E -> F;
16-
E -> G;
17-
D -> H;
18-
F -> H;
19-
H -> I;
15+
D -> G;
16+
F -> G;
17+
G -> H;
2018
}

cache/dependencies.dot.svg renamed to cache/assets/dependencies.dot.svg

+35-47
Loading

cache/dependencies.json renamed to cache/assets/dependencies.json

-8
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
"label": "result",
2525
"class": "artifact"
2626
},
27-
{
28-
"label": "timeline",
29-
"class": "artifact"
30-
},
3127
{
3228
"label": "generate-website",
3329
"class": "job"
@@ -58,10 +54,6 @@
5854
"source": "compute-statistics",
5955
"target": "result"
6056
},
61-
{
62-
"source": "compute-statistics",
63-
"target": "timeline"
64-
},
6557
{
6658
"source": "stats",
6759
"target": "generate-website"

cache/assets/pipeline.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[
2+
{
3+
"stage": "fetch",
4+
"job": "fetch-data-1",
5+
"start": "2024-04-21 15:06:16.087712",
6+
"stop": "2024-04-21 15:06:16.188543",
7+
"duration": "0:00:00.100831",
8+
"duration_text": "100 ms"
9+
},
10+
{
11+
"stage": "process",
12+
"job": "calculate-functions",
13+
"start": "2024-04-21 15:06:16.188543",
14+
"stop": "2024-04-21 15:06:16.490527",
15+
"duration": "0:00:00.301984",
16+
"duration_text": "301 ms"
17+
},
18+
{
19+
"stage": "process",
20+
"job": "compute-statistics",
21+
"start": "2024-04-21 15:06:16.490527",
22+
"stop": "2024-04-21 15:06:16.891631",
23+
"duration": "0:00:00.401104",
24+
"duration_text": "401 ms"
25+
},
26+
{
27+
"stage": "build",
28+
"job": "generate-website",
29+
"start": "2024-04-21 15:06:16.891631",
30+
"stop": "2024-04-21 15:06:17.394657",
31+
"duration": "0:00:00.503026",
32+
"duration_text": "503 ms"
33+
}
34+
]

cache/assets/timeline.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"id": "fetch-data-1",
4+
"content": "fetch-data-1",
5+
"start": "2024-04-21 15:06:16.087712",
6+
"end": "2024-04-21 15:06:16.188543"
7+
},
8+
{
9+
"id": "calculate-functions",
10+
"content": "calculate-functions",
11+
"start": "2024-04-21 15:06:16.188543",
12+
"end": "2024-04-21 15:06:16.490527"
13+
},
14+
{
15+
"id": "compute-statistics",
16+
"content": "compute-statistics",
17+
"start": "2024-04-21 15:06:16.490527",
18+
"end": "2024-04-21 15:06:16.891631"
19+
},
20+
{
21+
"id": "generate-website",
22+
"content": "generate-website",
23+
"start": "2024-04-21 15:06:16.891631",
24+
"end": "2024-04-21 15:06:17.394657"
25+
}
26+
]

cache/pipeline.json

-34
This file was deleted.

cache/process/timeline.json

-33
This file was deleted.

containers/run.py

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def graphviz(filename):
66
os.chdir(docker_compose_dir)
77
command_line = f"docker compose run --rm graphviz -Tsvg {filename} -o {filename}.svg"
88
subprocess.run(command_line.split(" "))
9+
os.chdir(original_dir)
910
return
1011

1112
def run(command):
@@ -16,7 +17,9 @@ def run(command):
1617
elif(command == "server"):
1718
os.chdir(docker_compose_dir)
1819
subprocess.run("docker compose up apache", shell=True, check=True)
20+
os.chdir(original_dir)
1921

22+
original_dir = os.getcwd()
2023
docker_compose_dir = os.path.join(os.path.dirname(__file__))
2124

2225
if __name__ == '__main__':

graph_utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def add_edge(source,target):
4242
})
4343
return
4444

45-
def get_dot_graph():
46-
global graph
45+
def get_dot_graph(graph):
4746
dot_string = graph_to_dot(graph)
4847
return dot_string
4948

pipeline.py

-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ def compute():
2323
new_data = run.get_artifact("content")
2424
time.sleep(0.4)
2525
run.set_artifact({"result":6},"fetch/result.json")
26-
timeline = [
27-
{"id": 1, "content": 'item 1', "start": '2013-04-20'},
28-
{"id": 2, "content": 'item 2', "start": '2013-04-14'},
29-
{"id": 3, "content": 'item 3', "start": '2013-04-18'},
30-
{"id": 4, "content": 'item 4', "start": '2013-04-16', "end": '2013-04-19'},
31-
{"id": 5, "content": 'item 5', "start": '2013-04-25'},
32-
{"id": 6, "content": 'item 6', "start": '2013-04-27'}
33-
]
34-
run.set_artifact(timeline,"process/timeline.json")
3526
return
3627

3728
def build():

0 commit comments

Comments
 (0)