diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1adfc8d1e0a8614d529795a68bbfb17005f0a5d6..51ab17c61ee5dd2414f2bf58f2873ba3cba816bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,6 +98,19 @@ benchmark: when: always paths: - ./*.log + - ./*.csv + - ./scripts/results/ + +database: + stage: deploy + tags: ['plafrim'] + #extends: .only-main-mr + needs: ['benchmark'] + script: + - ./scripts/database.sh + artifacts: + when: always + paths: - ./*.sqlite3 - ./*.csv diff --git a/scripts/database.sh b/scripts/database.sh new file mode 100755 index 0000000000000000000000000000000000000000..ddf0fde3eec2e355704ffa36c6b4d103994e79a5 --- /dev/null +++ b/scripts/database.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -ex + +# get current database file scalfmm.sqlite3 stored on gitlab +if [[ ! -z "${CI_JOB_TOKEN}" ]]; then + export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` + if [[ "${PACKAGEID}" != "null" ]]; then + export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` + if [[ "${FILEID}" != "null" ]]; then + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -o scalfmm.sqlite3 + fi + fi +fi + +# update scalfmm.sqlite3 database, tables : accuracy, timeseq, timeomp +jube result scripts/results --id 1 -o accuracy +jube result scripts/results --id 2 -o timeseq +jube result scripts/results --id 3 -o timeomp + +# upload updated scalfmm.sqlite3 on gitlab +if [[ ! -z "${CI_JOB_TOKEN}" ]]; then + # get package id of the database stored on gitlab + export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` + if [[ "${PACKAGEID}" != "null" ]]; then + # get file id of the database on gitlab + export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` + if [[ "${FILEID}" != "null" ]]; then + # delete previous database version on gitlab if exists + curl --request DELETE --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files/$FILEID" + fi + fi + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./scalfmm.sqlite3 "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" +fi + +# send results to the elasticsearch server +#ls guix.json +#python3 script/add_result.py -e https://elasticsearch.bordeaux.inria.fr -t concace -p "scalfmm" scalfmm.csv diff --git a/scripts/plafrim_level3.sh b/scripts/plafrim_level3.sh index 523cd38aa45c7dd032c5b8ca1f465fdbd533c744..bd3e8dbcc8037ca0e96fdc11081151ff133e22a0 100755 --- a/scripts/plafrim_level3.sh +++ b/scripts/plafrim_level3.sh @@ -25,17 +25,6 @@ if [ -d scripts/results ]; then rm scripts/results -r fi -# get current database file scalfmm.sqlite3 stored on gitlab -if [[ ! -z "${CI_JOB_TOKEN}" ]]; then - export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` - if [[ "${PACKAGEID}" != "null" ]]; then - export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` - if [[ "${FILEID}" != "null" ]]; then - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -o scalfmm.sqlite3 - fi - fi -fi - # configuration cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O3 -march=native" -Dscalfmm_BUILD_BENCH=ON -Dscalfmm_USE_MKL=ON @@ -53,7 +42,7 @@ case "${CI_BENCHMARK}" in jube result scripts/results --id 1 -o accuracy_csv > scalfmm_accuracy.csv cat scalfmm_accuracy.csv # update scalfmm.sqlite3 database, table accuracy - jube result scripts/results --id 1 -o accuracy + #jube result scripts/results --id 1 -o accuracy ;; timeseq) echo "CI_BENCHMARK is set to timeseq." @@ -62,7 +51,7 @@ case "${CI_BENCHMARK}" in jube analyse scripts/results --id 2 jube result scripts/results --id 2 -o timeseq_csv > scalfmm_timeseq.csv cat scalfmm_timeseq.csv - jube result scripts/results --id 2 -o timeseq + #jube result scripts/results --id 2 -o timeseq ;; timeomp) echo "CI_BENCHMARK is set to timeomp." @@ -71,29 +60,10 @@ case "${CI_BENCHMARK}" in jube analyse scripts/results --id 3 jube result scripts/results --id 3 -o timeomp_csv > scalfmm_timeomp.csv cat scalfmm_timeomp.csv - jube result scripts/results --id 3 -o timeomp + #jube result scripts/results --id 3 -o timeomp ;; *) echo "CI_BENCHMARK is set to an unknown value." exit 1 ;; esac - -# upload updated scalfmm.sqlite3 on gitlab -if [[ ! -z "${CI_JOB_TOKEN}" ]]; then - # get package id of the database stored on gitlab - export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` - if [[ "${PACKAGEID}" != "null" ]]; then - # get file id of the database on gitlab - export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` - if [[ "${FILEID}" != "null" ]]; then - # delete previous database version on gitlab if exists - curl --request DELETE --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files/$FILEID" - fi - fi - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./scalfmm.sqlite3 "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -fi - -# send results to the elasticsearch server -#ls guix.json -#python3 script/add_result.py -e https://elasticsearch.bordeaux.inria.fr -t concace -p "scalfmm" scalfmm.csv