From 2c8f1b401e947338697be538eaf1e932264d0a2b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sat, 4 Jan 2025 03:55:54 +0530 Subject: [PATCH 1/4] Improve setup.py --- .github/workflows/test-mlperf-inference-resnet50.yml | 2 +- setup.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 5b742eba2..90eceeadc 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -38,7 +38,7 @@ jobs: git config --system core.longpaths true - name: Install dependencies run: | - 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 ResNet50 (Windows) if: matrix.os == 'windows-latest' diff --git a/setup.py b/setup.py index 8cc2aec00..5fe18d067 100644 --- a/setup.py +++ b/setup.py @@ -146,14 +146,17 @@ def custom_function(self): 'force': True, 'all': True}) branch = os.environ.get('CM_MLOPS_REPO_BRANCH', 'dev') - r = cmind.access({'action': 'pull', + pull_default_mlops_repo = os.environ.get('CM_PULL_DEFAULT_MLOPS_REPO', 'true') + + if str(pull_default_mlops_repo).lower() not in [ "no", "0", "false" ]: + r = cmind.access({'action': 'pull', 'automation': 'repo', 'artifact': 'mlcommons@mlperf-automations', 'checkout': commit_hash, 'branch': branch}) - print(r) - if r['return'] > 0: - return r['return'] + print(r) + if r['return'] > 0: + return r['return'] def get_sys_platform(self): self.system = platform.system() From aa50c7c71d0b43a3cd2e888b48cf183b210d0062 Mon Sep 17 00:00:00 2001 From: arjunsuresh Date: Fri, 3 Jan 2025 22:26:11 +0000 Subject: [PATCH 2/4] [Automated Commit] Format Codebase --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 5fe18d067..0e040665e 100644 --- a/setup.py +++ b/setup.py @@ -146,14 +146,15 @@ def custom_function(self): 'force': True, 'all': True}) branch = os.environ.get('CM_MLOPS_REPO_BRANCH', 'dev') - pull_default_mlops_repo = os.environ.get('CM_PULL_DEFAULT_MLOPS_REPO', 'true') + pull_default_mlops_repo = os.environ.get( + 'CM_PULL_DEFAULT_MLOPS_REPO', 'true') - if str(pull_default_mlops_repo).lower() not in [ "no", "0", "false" ]: + if str(pull_default_mlops_repo).lower() not in ["no", "0", "false"]: r = cmind.access({'action': 'pull', - 'automation': 'repo', - 'artifact': 'mlcommons@mlperf-automations', - 'checkout': commit_hash, - 'branch': branch}) + 'automation': 'repo', + 'artifact': 'mlcommons@mlperf-automations', + 'checkout': commit_hash, + 'branch': branch}) print(r) if r['return'] > 0: return r['return'] From f2b71b0540ea547df537c1861171567d5c029ddc Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 3 Jan 2025 22:48:48 +0000 Subject: [PATCH 3/4] Update test-mlperf-inference-resnet50.yml --- .github/workflows/test-mlperf-inference-resnet50.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 90eceeadc..9820f358d 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -59,12 +59,10 @@ jobs: - name: Push Results if: github.repository_owner == 'mlcommons' env: - USER: "GitHub Action" - EMAIL: "admin@gateoverflow.com" GITHUB_TOKEN: ${{ env.PAT }} run: | - git config --global user.name "${{ env.USER }}" - git config --global user.email "${{ env.EMAIL }}" + git config --global user.name mlcommons-bot + git config --global user.email "mlcommons-bot@users.noreply.github.com" git config --global credential.https://github.com.helper "" git config --global credential.https://github.com.helper "!gh auth git-credential" git config --global credential.https://gist.github.com.helper "" From 0f251e8b575cc307527c9cced71da53729fc8b3a Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 3 Jan 2025 22:58:41 +0000 Subject: [PATCH 4/4] Update test-mlperf-inference-resnet50.yml --- .github/workflows/test-mlperf-inference-resnet50.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 9820f358d..a14cc144a 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -67,4 +67,5 @@ jobs: git config --global credential.https://github.com.helper "!gh auth git-credential" 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 --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