diff options
-rw-r--r-- | .gitlab-ci.yml | 41 | ||||
-rw-r--r-- | analysis/Justfile | 26 | ||||
-rw-r--r-- | analysis/vis.livemd | 4 | ||||
-rw-r--r-- | src/Justfile | 23 |
4 files changed, 65 insertions, 29 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b724527..9c92da0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,12 @@ variables: SSH_LOCATION: "root@192.168.1.246" -run-tests: - when: manual +stages: +- deploy +- benchmark + +default: image: alpine - timeout: 6 hours before_script: - apk update && apk add openssh-client - eval $(ssh-agent -s) @@ -13,6 +15,37 @@ run-tests: - mkdir -p ~/.ssh - chmod 700 ~/.ssh - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts + +rebuild: + when: manual + stage: deploy + resource_group: vm script: - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra && git pull && NIXOS_SWITCH_USE_DIRTY_ENV=1 nixos-rebuild switch --fast --flake .#default'" - - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just run-all-tests'" + +cost-models: + when: manual + stage: benchmark + needs: ["rebuild"] + timeout: 6 hours + resource_group: vm + script: + - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just cost-models'" + +selections: + when: manual + stage: benchmark + needs: ["rebuild"] + timeout: 6 hours + resource_group: vm + script: + - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just selections'" + +comparisons: + when: manual + stage: benchmark + needs: ["rebuild"] + timeout: 6 hours + resource_group: vm + script: + - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just selections --compare'" diff --git a/analysis/Justfile b/analysis/Justfile index 837a79e..6e356ac 100644 --- a/analysis/Justfile +++ b/analysis/Justfile @@ -1,17 +1,19 @@ default: livebook server -fetch job: (download-log job) (download-other job) +fetch-log job outp="current": + mkdir -p {{justfile_directory()}}/{{outp}} + curl https://git.tardisproject.uk/tcmal/dissertation/-/jobs/{{job}}/raw > {{justfile_directory()}}/{{outp}}/log + ./split-log.py {{justfile_directory()}}/{{outp}}/log + grep -R -H -i 'error' {{justfile_directory()}}/{{outp}}/sections/ -download-log job: - mkdir -p {{justfile_directory()}}/{{job}} - curl https://git.tardisproject.uk/tcmal/dissertation/-/jobs/{{job}}/raw > {{justfile_directory()}}/{{job}}/log - ./split-log.py {{justfile_directory()}}/{{job}}/log - grep -R -H -i 'error' {{justfile_directory()}}/{{job}}/sections/ +fetch-cost-models outp="current": + mkdir -p {{justfile_directory()}}/{{outp}} + rsync -ravP candelabra:/opt/candelabra/src/target/candelabra/ {{justfile_directory()}}/{{outp}}/candelabra -download-other job: - rsync -ravP candelabra:/opt/candelabra/src/tests/target/criterion/ {{justfile_directory()}}/{{job}}/criterion - rsync -ravP candelabra:/opt/candelabra/src/target/candelabra/ {{justfile_directory()}}/{{job}}/candelabra - rm -rf {{justfile_directory()}}/{{job}}/criterion/report - find {{justfile_directory()}}/{{job}}/criterion -iname '*.svg' -exec rm '{}' \; - find {{justfile_directory()}}/{{job}}/criterion -iname '*.html' -exec rm '{}' \; +fetch-comparisons outp="current": + mkdir -p {{justfile_directory()}}/{{outp}} + rsync -ravP candelabra:/opt/candelabra/src/tests/target/criterion/ {{justfile_directory()}}/{{outp}}/criterion + rm -rf {{justfile_directory()}}/{{outp}}/criterion/report + find {{justfile_directory()}}/{{outp}}/criterion -iname '*.svg' -exec rm '{}' \; + find {{justfile_directory()}}/{{outp}}/criterion -iname '*.html' -exec rm '{}' \; diff --git a/analysis/vis.livemd b/analysis/vis.livemd index 727a459..001b53d 100644 --- a/analysis/vis.livemd +++ b/analysis/vis.livemd @@ -7,8 +7,6 @@ Mix.install([ {:json, "~> 1.4"}, {:explorer, "~> 0.8.0"}, {:kino_explorer, "~> 0.1.11"}, - {:nx, "~> 0.5"}, - {:scholar, "~> 0.2.1"}, {:math, "~> 0.7.0"} ]) ``` @@ -20,7 +18,7 @@ require Explorer.DataFrame require Explorer.Series alias Explorer.DataFrame, as: DF alias Explorer.Series, as: SE -job_id = "other" +job_id = "current" job_dir = Path.expand(~c"./" ++ job_id) |> Path.absname() sections_dir = Path.join(job_dir, "sections") cm_dir = Path.join([job_dir, "candelabra", "benchmark_results"]) diff --git a/src/Justfile b/src/Justfile index a96a779..855bd5a 100644 --- a/src/Justfile +++ b/src/Justfile @@ -7,26 +7,29 @@ impls := "std::collections::BTreeSet primrose_library::LazySortedVec std::collec proj := "std::vec::Vec std::collections::LinkedList" export RUST_LOG := "debug" -run-all-tests: - which candelabra-cli 2>/dev/null || cargo build +cost-models: rebuild rm -fr {{target_dir}}/candelabra + @IMPLS=`{{candelabra}} list-library 2>&1 | cut -d ']' -f 2 | grep ::`; for impl in $IMPLS; do just cost-model $impl; done + +selections *SELECTFLAGS: rebuild rm -fr {{tests_dir}}/target/criterion - echo "Candelabra Path: {{candelabra}}" + @cd tests/ && for i in $(ls -d */); do [ "${i%%/}" == "target" ] || just select ${i%%/} {{SELECTFLAGS}}; done - @IMPLS=`{{candelabra}} list-library 2>&1 | cut -d ']' -f 2 | grep ::`; for impl in $IMPLS; do just cost-model $impl; done - @cd tests/ && for i in $(ls -d */); do [ "${i%%/}" == "target" ] || just select ${i%%/}; done +rebuild: + which candelabra-cli 2>/dev/null || cargo build + echo "Candelabra Path: {{candelabra}}" cost-model impl: (section-start ("cost-model-" + impl)) && (section-end ("cost-model-" + impl)) {{candelabra}} -l cost-model {{impl}} -select proj: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj)) - {{candelabra}} -l --manifest-path {{tests_manifest}} -p {{proj}} select - -compare proj: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj)) - {{candelabra}} -l --manifest-path {{tests_manifest}} -p {{proj}} select --compare +select proj *FLAGS: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj)) + {{candelabra}} -l --manifest-path {{tests_manifest}} -p {{proj}} select {{FLAGS}} @section-start NAME: echo -e "\e[0Ksection_start:`date +%s`:{{replace(NAME, ":", "-")}}\r\e[0K{{replace(NAME, ":", "-")}}" @section-end NAME: echo -e "\e[0Ksection_end:`date +%s`:{{replace(NAME, ":", "-")}}\r\e[0K" + +brief-tests *SELECTFLAGS: cost-models (selections SELECTFLAGS) +all-tests: (brief-tests --compare) |