From 225e08909a73fa8a4d47565acd7c006258db6396 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Tue, 24 Sep 2024 11:27:00 +0100 Subject: [PATCH] Support generic result repositories --- .github/workflows/publish.yml | 2 +- docinit.sh | 23 +++++++++++++++-------- run.sh | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 run.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba2b4a4..8d0833c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: python-version: "3.11" - name: Init docs site - run: INFERENCE_RESULTS_VERSION=scc24 bash docinit.sh + run: bash run.sh - name: Run Mkdocs deploy run: mkdocs gh-deploy --force diff --git a/docinit.sh b/docinit.sh index 5da706a..b7b8662 100644 --- a/docinit.sh +++ b/docinit.sh @@ -12,15 +12,22 @@ if [ ! -e overrides ]; then test $? -eq 0 || exit $? fi +repo_owner=${INFERENCE_RESULTS_REPO_OWNER:-mlcommons} +repo_branch=${INFERENCE_RESULTS_REPO_BRANCH:-main} +repo_name=${INFERENCE_RESULTS_REPO_NAME:-inference_results_${INFERENCE_RESULTS_VERSION}} + if [ ! -e docs/javascripts/config.js ]; then - if [ -n "${INFERENCE_RESULTS_VERSION}" ]; then - echo "const results_version=\"${INFERENCE_RESULTS_VERSION}\";" > docs/javascripts/config.js; - ver_num=`echo ${INFERENCE_RESULTS_VERSION} | tr -cd '0-9'` - echo "const dbVersion =\"${ver_num}\";" >> docs/javascripts/config.js; - else - echo "Please export INFERENCE_RESULTS_VERSION=v4.1 or the corresponding version"; - exit 1 - fi + if [ -n "${INFERENCE_RESULTS_VERSION}" ]; then + echo "const results_version=\"${INFERENCE_RESULTS_VERSION}\";" > docs/javascripts/config.js; + echo "const repo_owner=\"${repo_owner}\";" >> docs/javascripts/config.js; + echo "const repo_branch=\"${repo_branch}\";" >> docs/javascripts/config.js; + echo "const repo_name=\"${repo_name}\";" >> docs/javascripts/config.js; + ver_num=`echo ${INFERENCE_RESULTS_VERSION} | tr -cd '0-9'` + echo "const dbVersion =\"${ver_num}\";" >> docs/javascripts/config.js; + else + echo "Please export INFERENCE_RESULTS_VERSION=v4.1 or the corresponding version"; + exit 1 + fi fi if [ ! -e docs/thirdparty/tablesorter ]; then diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..63a3fb6 --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +INFERENCE_RESULTS_VERSION=scc24 INFERENCE_RESULTS_REPO_OWNER=GATEOverflow INFERENCE_RESULTS_REPO_BRANCH=mlperf-inference-results-scc24 INFERENCE_RESULTS_REPO_NAME=cm4mlperf-inference bash docinit.sh