forked from mlcommons/ck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/octoml/ck
- Loading branch information
Showing
24 changed files
with
538 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Get GIT Repository | ||
This [CM script](https://github.com/mlcommons/ck/blob/master/cm/docs/specs/script.md) git clones any specified GIT repository. | ||
|
||
## Commands | ||
To install | ||
``` | ||
cm run script --tags=get,git,repo,_repo.<repo_name>,[VARIATION] | ||
``` | ||
where [VARIATION] is one of | ||
* `patch:` Applies the `git.patch` to the cloned git repository | ||
* `short-history:` Uses a git depth of last 10 commits (significantly reduces the download size) | ||
* `full-history:` Uses the full git history | ||
* `no-recurse-submodules:` Only download the main repository | ||
|
||
## Exported Variables | ||
* `CM_GIT_CHECKOUT_PATH`: Directory path of the cloned git repository | ||
|
||
## Supported and Tested OS | ||
1. Ubuntu 18.04, 20.04, 22.04 | ||
2. RHEL 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"alias": "get-git-repo", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"category": "Modular MLPerf benchmarks", | ||
"default_env": { | ||
"CM_GIT_CHECKOUT": "main", | ||
"CM_GIT_DEPTH": "--depth 4", | ||
"CM_GIT_CHECKOUT_FOLDER": "repo", | ||
"CM_GIT_PATCH": "no", | ||
"CM_GIT_RECURSE_SUBMODULES": " --recurse-submodules", | ||
"CM_GIT_URL": "https://github.com/mlcommons/ck.git" | ||
}, | ||
"default_variation": "default", | ||
"deps": [ | ||
{ | ||
"tags": "detect,os" | ||
} | ||
], | ||
"new_env_keys": [ | ||
"CM_GIT_CHECKOUT_PATH" | ||
], | ||
"tags": [ | ||
"get", | ||
"git", | ||
"repo", | ||
"repository", | ||
"clone" | ||
], | ||
"uid": "ed603e7292974f10", | ||
"variations": { | ||
"default": { | ||
"base": [ | ||
"short-history" | ||
], | ||
"env": { | ||
"CM_GIT_PATCH": "no" | ||
} | ||
}, | ||
"full-history": { | ||
"env": { | ||
"CM_GIT_DEPTH": "" | ||
} | ||
}, | ||
"no-recurse-submodules": { | ||
"env": { | ||
"CM_GIT_RECURSE_SUBMODULES": "" | ||
} | ||
}, | ||
"patch": { | ||
"env": { | ||
"CM_GIT_PATCH": "yes" | ||
} | ||
}, | ||
"short-history": { | ||
"env": { | ||
"CM_GIT_DEPTH": "--depth 5" | ||
} | ||
}, | ||
"repo.#": { | ||
"group": "repo" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from cmind import utils | ||
import os | ||
import shutil | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
if os_info['platform'] == 'windows': | ||
return {'return':1, 'error': 'Windows is not supported in this script yet'} | ||
|
||
env = i['env'] | ||
meta = i['meta'] | ||
|
||
if 'CM_GIT_REPO_NAME' not in env: | ||
env['CM_GIT_REPO_NAME'] = os.path.basename(env['CM_GIT_URL']) | ||
|
||
if 'CM_GIT_DEPTH' not in env: | ||
env['CM_GIT_DEPTH'] = '' | ||
|
||
if 'CM_GIT_RECURSE_SUBMODULES' not in env: | ||
env['CM_GIT_RECURSE_SUBMODULES'] = '' | ||
|
||
env['CM_GIT_CHECKOUT_PATH'] = os.path.join(os.getcwd(), env['CM_GIT_CHECKOUT_FOLDER']) | ||
|
||
return {'return':0} | ||
|
||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
state = i['state'] | ||
|
||
return {'return':0} |
Oops, something went wrong.