diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 3a8bc9a64..b43a4e838 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -36,9 +36,15 @@ jobs: if: matrix.os == 'windows-latest' run: | git config --system core.longpaths true - - name: Install dependencies + - name: Install cm4mlops on Windows + if: matrix.os == 'windows-latest' + run: | + $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops + - name: Install dependencies on Unix Platforms + if: matrix.os != 'windows-latest' run: | CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + - name: Pull MLOps repo cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference ResNet50 (Windows) if: matrix.os == 'windows-latest' @@ -68,4 +74,4 @@ jobs: # git config --global credential.https://gist.github.com.helper "" # git config --global credential.https://gist.github.com.helper "!gh auth git-credential" # cm run script --tags=gh,auth,cli --with_token=${{ env.PAT }} - cm run script --tags=push,github,mlperf,inference,submission --env.CM_GH_TOKEN=${{ env.PAT }} --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R50 GH action on ${{ matrix.os }}" --quiet + cm run script --tags=push,github,mlperf,inference,submission --env.CM_GITHUB_PAT=${{ env.PAT }} --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R50 GH action on ${{ matrix.os }}" --quiet diff --git a/.github/workflows/test-mlperf-inference-retinanet.yml b/.github/workflows/test-mlperf-inference-retinanet.yml index 3df5ea51b..f5f335c0b 100644 --- a/.github/workflows/test-mlperf-inference-retinanet.yml +++ b/.github/workflows/test-mlperf-inference-retinanet.yml @@ -41,7 +41,7 @@ jobs: git config --system core.longpaths true - name: Install dependencies run: | - python3 -m pip install "cmind @ git+https://git@github.com/mlcommons/ck.git@mlperf-inference#subdirectory=cm" + CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference Retinanet using ${{ matrix.backend }} on ${{ matrix.os }} if: matrix.os == 'windows-latest' diff --git a/script/push-mlperf-inference-results-to-github/customize.py b/script/push-mlperf-inference-results-to-github/customize.py index f1cfe1eba..3fab7359d 100644 --- a/script/push-mlperf-inference-results-to-github/customize.py +++ b/script/push-mlperf-inference-results-to-github/customize.py @@ -1,6 +1,7 @@ from cmind import utils import cmind as cm import os +from giturlparse import parse def preprocess(i): @@ -32,6 +33,11 @@ def preprocess(i): env['CM_MLPERF_RESULTS_REPO_COMMIT_MESSAGE'] = env.get( 'CM_MLPERF_RESULTS_REPO_COMMIT_MESSAGE', 'Added new results') + p = parse(repo) + if env.get('CM_GITHUB_PAT', '') != '': + token = env['CM_GITHUB_PAT'] + env['CM_SET_REMOTE_URL_CMD'] = f"""git remote set-url origin https://git:{token}@{p.host}/{p.owner}/{p.repo}""" + return {'return': 0} diff --git a/script/push-mlperf-inference-results-to-github/run.sh b/script/push-mlperf-inference-results-to-github/run.sh index 1eb4f663e..7fb95eb3d 100644 --- a/script/push-mlperf-inference-results-to-github/run.sh +++ b/script/push-mlperf-inference-results-to-github/run.sh @@ -16,5 +16,10 @@ fi test $? -eq 0 || exit $? git commit -a -m "${CM_MLPERF_RESULTS_REPO_COMMIT_MESSAGE}" + +if [[ -n ${CM_SET_REMOTE_URL_CMD} ]]; then + ${CM_SET_REMOTE_URL_CMD} +fi + git push test $? -eq 0 || exit $?