Skip to content

Commit

Permalink
rendered correct timeline from assets
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Apr 21, 2024
1 parent b307789 commit 67bf465
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 153 deletions.
24 changes: 18 additions & 6 deletions cache/artifacts.json → cache/assets/artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,28 @@
"type": "generic",
"filepath": "fetch/result.json"
},
"timeline": {
"path": "process",
"ext": ".json",
"type": "generic",
"filepath": "process/timeline.json"
},
"website": {
"path": "fetch",
"ext": ".json",
"type": "generic",
"filepath": "fetch/website.json"
},
"pipeline": {
"path": "assets",
"ext": ".json",
"type": "generic",
"filepath": "assets/pipeline.json"
},
"dependencies": {
"path": "assets",
"ext": ".json",
"type": "graph",
"filepath": "assets/dependencies.json"
},
"timeline": {
"path": "assets",
"ext": ".json",
"type": "generic",
"filepath": "assets/timeline.json"
}
}
12 changes: 5 additions & 7 deletions cache/dependencies.dot → cache/assets/dependencies.dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ digraph G {
D [label="stats", class="artifact", shape="ellipse"];
E [label="compute-statistics", class="job", shape="box"];
F [label="result", class="artifact", shape="ellipse"];
G [label="timeline", class="artifact", shape="ellipse"];
H [label="generate-website", class="job", shape="box"];
I [label="website", 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;
E -> G;
D -> H;
F -> H;
H -> I;
D -> G;
F -> G;
G -> H;
}
82 changes: 35 additions & 47 deletions cache/dependencies.dot.svg → cache/assets/dependencies.dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions cache/dependencies.json → cache/assets/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
"label": "result",
"class": "artifact"
},
{
"label": "timeline",
"class": "artifact"
},
{
"label": "generate-website",
"class": "job"
Expand Down Expand Up @@ -58,10 +54,6 @@
"source": "compute-statistics",
"target": "result"
},
{
"source": "compute-statistics",
"target": "timeline"
},
{
"source": "stats",
"target": "generate-website"
Expand Down
34 changes: 34 additions & 0 deletions cache/assets/pipeline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"stage": "fetch",
"job": "fetch-data-1",
"start": "2024-04-21 15:06:16.087712",
"stop": "2024-04-21 15:06:16.188543",
"duration": "0:00:00.100831",
"duration_text": "100 ms"
},
{
"stage": "process",
"job": "calculate-functions",
"start": "2024-04-21 15:06:16.188543",
"stop": "2024-04-21 15:06:16.490527",
"duration": "0:00:00.301984",
"duration_text": "301 ms"
},
{
"stage": "process",
"job": "compute-statistics",
"start": "2024-04-21 15:06:16.490527",
"stop": "2024-04-21 15:06:16.891631",
"duration": "0:00:00.401104",
"duration_text": "401 ms"
},
{
"stage": "build",
"job": "generate-website",
"start": "2024-04-21 15:06:16.891631",
"stop": "2024-04-21 15:06:17.394657",
"duration": "0:00:00.503026",
"duration_text": "503 ms"
}
]
26 changes: 26 additions & 0 deletions cache/assets/timeline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"id": "fetch-data-1",
"content": "fetch-data-1",
"start": "2024-04-21 15:06:16.087712",
"end": "2024-04-21 15:06:16.188543"
},
{
"id": "calculate-functions",
"content": "calculate-functions",
"start": "2024-04-21 15:06:16.188543",
"end": "2024-04-21 15:06:16.490527"
},
{
"id": "compute-statistics",
"content": "compute-statistics",
"start": "2024-04-21 15:06:16.490527",
"end": "2024-04-21 15:06:16.891631"
},
{
"id": "generate-website",
"content": "generate-website",
"start": "2024-04-21 15:06:16.891631",
"end": "2024-04-21 15:06:17.394657"
}
]
34 changes: 0 additions & 34 deletions cache/pipeline.json

This file was deleted.

33 changes: 0 additions & 33 deletions cache/process/timeline.json

This file was deleted.

3 changes: 3 additions & 0 deletions containers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def graphviz(filename):
os.chdir(docker_compose_dir)
command_line = f"docker compose run --rm graphviz -Tsvg {filename} -o {filename}.svg"
subprocess.run(command_line.split(" "))
os.chdir(original_dir)
return

def run(command):
Expand All @@ -16,7 +17,9 @@ def run(command):
elif(command == "server"):
os.chdir(docker_compose_dir)
subprocess.run("docker compose up apache", shell=True, check=True)
os.chdir(original_dir)

original_dir = os.getcwd()
docker_compose_dir = os.path.join(os.path.dirname(__file__))

if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def add_edge(source,target):
})
return

def get_dot_graph():
global graph
def get_dot_graph(graph):
dot_string = graph_to_dot(graph)
return dot_string

Expand Down
9 changes: 0 additions & 9 deletions pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ def compute():
new_data = run.get_artifact("content")
time.sleep(0.4)
run.set_artifact({"result":6},"fetch/result.json")
timeline = [
{"id": 1, "content": 'item 1', "start": '2013-04-20'},
{"id": 2, "content": 'item 2', "start": '2013-04-14'},
{"id": 3, "content": 'item 3', "start": '2013-04-18'},
{"id": 4, "content": 'item 4', "start": '2013-04-16', "end": '2013-04-19'},
{"id": 5, "content": 'item 5', "start": '2013-04-25'},
{"id": 6, "content": 'item 6', "start": '2013-04-27'}
]
run.set_artifact(timeline,"process/timeline.json")
return

def build():
Expand Down
Loading

0 comments on commit 67bf465

Please sign in to comment.