Skip to content
Snippets Groups Projects
Commit 31678b57 authored by Sigurd Hagen Tullander's avatar Sigurd Hagen Tullander
Browse files

Plot graphs in separate docker container

parent fc427df6
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": [ "recommendations": [
"emeraldwalk.RunOnSave",
"James-Yu.latex-workshop", "James-Yu.latex-workshop",
"streetsidesoftware.code-spell-checker", "vitaliymaz.vscode-svg-previewer"
], ],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [ "unwantedRecommendations": [
......
{ {
"emeraldwalk.runonsave": {
"commands": [
{
"match": "report/.*",
"cmd": "docker-compose up"
},
{
"match": "source_code/plot/.*.py",
"cmd": "python ${file} report/figures/plots/ && docker-compose up"
}
]
},
"latex-workshop.latex.autoBuild.run": "never", "latex-workshop.latex.autoBuild.run": "never",
"editor.wordWrap": "on", "editor.wordWrap": "on",
"cSpell.language": "en", "cSpell.language": "en",
......
...@@ -4,14 +4,22 @@ ...@@ -4,14 +4,22 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "Build report container", "label": "Build docker containers",
"type": "shell", "type": "shell",
"command": "docker-compose build" "command": "docker-compose build"
}, },
{ {
"label": "Compile report", "label": "Compile",
"type": "shell", "type": "shell",
"command": "docker-compose up" "command": "docker-compose up plot && docker-compose up report"
},
{
"label": "Recompile loop",
"type": "shell",
"command": "docker-compose up",
"runOptions": {
"runOn": "folderOpen"
}
} }
] ]
} }
No preview for this file type
version: "3" version: "3"
services: services:
report: report_loop:
image: sigurdht/compile-latex image: sigurdht/compile-latex
volumes: volumes:
- ./report:/data/report:Z - ./report:/data/report:ro
- ./report_output:/data/report_output:Z - ./report_output:/data/report_output:rw
- ./source_code:/data/source_code:Z - ./source_code:/data/source_code:ro
- ./Report.pdf:/data/Report.pdf:Z - ./Report.pdf:/data/Report.pdf:rw
- ./compile.sh:/data/compile.sh:Z - ./filechange_loop.sh:/data/filechange_loop.sh:ro
working_dir: /data - ./compile.sh:/data/compile.sh:ro
command: /data/filechange_loop.sh report ./compile.sh
plot_loop:
image: sigurdht/matplotlib
volumes:
- ./source_code:/app/source_code:ro
- ./report/figures/plots:/app/plots:rw
- ./filechange_loop.sh:/app/filechange_loop.sh:ro
- ./plot.sh:/app/plot.sh:ro
working_dir: /app
command: /app/filechange_loop.sh source_code ./plot.sh
plot:
extends: plot_loop
command: ./plot.sh
profiles:
- plot
report:
extends: report_loop
command: ./compile.sh command: ./compile.sh
profiles:
- report
#!/bin/sh
# set -e
# cd $(dirname $0)/
$2
while [ 1 ]
do
last_changed_file=$(find $1 -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1)
seconds_since_change=$(($(date +%s) - $(date -r $last_changed_file +%s)))
if [ $seconds_since_change -lt 3 ]
then
$2 &
sleep 3 &
wait
else
sleep 1
fi
done
#!/bin/sh
# set -e
cd $(dirname $0)/
rm -rf plots/*
python source_code/plot/plot.py plots
...@@ -10,8 +10,9 @@ from plot_dvfs_theory import plot_dvfs_theory ...@@ -10,8 +10,9 @@ from plot_dvfs_theory import plot_dvfs_theory
from plot_cpu_frequency_test_results import plot_cpu_frequency_test_results from plot_cpu_frequency_test_results import plot_cpu_frequency_test_results
from plot_dataset_distribution import plot_dataset_distribution from plot_dataset_distribution import plot_dataset_distribution
def plot_all(): def plot_all(
output_directory=os.path.join(os.path.dirname(__file__), "../../report/figures/plots/") output_directory=os.path.join(os.path.dirname(__file__), "../../report/figures/plots/")
):
plot_dvfs_theory(output_dir=output_directory) plot_dvfs_theory(output_dir=output_directory)
plot_cpu_frequency_test_results(output_dir=output_directory) plot_cpu_frequency_test_results(output_dir=output_directory)
plot_dataset_distribution(output_dir=output_directory) plot_dataset_distribution(output_dir=output_directory)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment