Skip to content

Commit

Permalink
Improve setup.py (#106)
Browse files Browse the repository at this point in the history
* Improve setup.py

* [Automated Commit] Format Codebase

* Update test-mlperf-inference-resnet50.yml
  • Loading branch information
arjunsuresh authored Jan 3, 2025
1 parent 16f75ef commit 5bcdfb5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test-mlperf-inference-resnet50.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
git config --system core.longpaths true
- name: Install dependencies
run: |
pip install "cmind @ git+https://[email protected]/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'
Expand All @@ -59,14 +59,13 @@ jobs:
- name: Push Results
if: github.repository_owner == 'mlcommons'
env:
USER: "GitHub Action"
EMAIL: "[email protected]"
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 "[email protected]"
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 ""
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
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,18 @@ def custom_function(self):
'force': True,
'all': True})
branch = os.environ.get('CM_MLOPS_REPO_BRANCH', 'dev')
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']
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']

def get_sys_platform(self):
self.system = platform.system()
Expand Down

0 comments on commit 5bcdfb5

Please sign in to comment.