From 83a316b5dfc832ca9b6d175cb94f44bf24e8ec91 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 12:37:11 +0530 Subject: [PATCH 01/18] support find cache --- mlc/main.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mlc/main.py b/mlc/main.py index 594804b59..5bf61a368 100644 --- a/mlc/main.py +++ b/mlc/main.py @@ -1077,6 +1077,7 @@ def call_script_module_function(self, function_name, run_args): return result else: logger.info("ScriptAutomation class not found in the script.") + return {'return': 1, 'error': 'ScriptAutomation class not found in the script.'} def docker(self, run_args): return self.call_script_module_function("docker", run_args) @@ -1111,10 +1112,23 @@ def find(self, run_args): #logger.info(f"Running script with identifier: {args.details}") # The REPOS folder is set by the user, for example via an environment variable. #logger.info(f"In cache action {repos_folder}") - run_args['target_name'] = "cache" #print(f"run_args = {run_args}") - return self.search(run_args) + res = self.search(run_args) + if res['return'] > 0: + return res + else: + if not res['list']: + logger.warning("No cache entry found for the specified tags!") + return {'return': 0, 'list': []} + else: + logger.info("Listing all cache entries found for the specified tags.") + print("Cache entries:") + print("-------------") + for cache_entry in res['list']: + print(f"- {cache_entry.path}\n") + print("-------------") + return {"return": 0, 'list': res['list']} def list(self, args): logger.info("Listing all caches.") From e4a05f57770a36df81b3b0e615fce4c72fcb9bd6 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 12:37:32 +0530 Subject: [PATCH 02/18] initial commit for testing mlc core actions --- .github/workflows/test-mlc-core-actions.yaml | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test-mlc-core-actions.yaml diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml new file mode 100644 index 000000000..b84d42258 --- /dev/null +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -0,0 +1,57 @@ +name: MLC core actions test + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-mlc-core-actions.yml' + - '**' + - '!**.md' + +jobs: + test_mlc_core_actions: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.12", "3.8"] + os: ["ubuntu-latest", "windows-latest", "macos-latest"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Configure git longpaths (Windows) + if: matrix.os == 'windows-latest' + run: | + git config --system core.longpaths true + + - name: Test pull repo - Pull MLOps repository + run: | + pip install mlcflow + mlc pull repo anandhu-eng@mlperf-automations + + - name: Test pull repo - Test conflicting repo scenario + run: | + mlc pull repo mlcommons@mlperf-automations + + - name: Test list repo - List the existing repositories + run: | + mlc list repo + + - name: Test find cache - Cache not present + run: | + mlc find cache --tags=detect,os + + - name: Test run script - Output being used for testing mlc cache + run: | + mlc run script --tags=get,imagenet-aux + mlc run script --tags=get,imagenet-aux,_from.dropbox + + - name: Test find cache - More than one cache present + run: | + mlc find cache --tags=get,imagenet-aux \ No newline at end of file From a08f555f20a8ecf207f6fc38dbea0a5138dc7e42 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 12:41:42 +0530 Subject: [PATCH 03/18] fix branch --- .github/workflows/test-mlc-core-actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index b84d42258..d8a11dc3b 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -33,11 +33,11 @@ jobs: - name: Test pull repo - Pull MLOps repository run: | pip install mlcflow - mlc pull repo anandhu-eng@mlperf-automations + mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - name: Test pull repo - Test conflicting repo scenario run: | - mlc pull repo mlcommons@mlperf-automations + mlc pull repo mlcommons@mlperf-automations --checkout=dev - name: Test list repo - List the existing repositories run: | From 0982081a208b3ef630944aba59a1653953b42396 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 12:53:57 +0530 Subject: [PATCH 04/18] install mlcflow from source of pr --- .github/workflows/test-mlc-core-actions.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index d8a11dc3b..9ac472ee8 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -30,9 +30,14 @@ jobs: run: | git config --system core.longpaths true - - name: Test pull repo - Pull MLOps repository + - name: Install mlcflow from the pull request's source repository and branch + run: | + git clone ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + cd mlcflow + pip install . + + - name: Test pull repo - Pull a forked MLOps repository run: | - pip install mlcflow mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - name: Test pull repo - Test conflicting repo scenario @@ -43,6 +48,10 @@ jobs: run: | mlc list repo + - name: Test rm repo - Remove the forked mlperf-automation repo + run: | + mlc rm repo anandhu-eng@mlperf-automations + - name: Test find cache - Cache not present run: | mlc find cache --tags=detect,os From 1074131813d0bd8b73dbc274951390fa7d26f1c7 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 13:11:17 +0530 Subject: [PATCH 05/18] fix repo key error --- mlc/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlc/main.py b/mlc/main.py index 5bf61a368..482dfc93c 100644 --- a/mlc/main.py +++ b/mlc/main.py @@ -1266,6 +1266,10 @@ def main(): if hasattr(args, 'repo') and args.repo: run_args['repo'] = args.repo + if args.command in ['rm']: + if args.target == "repo": + run_args['repo'] = args.details + if args.command in ["cp", "mv"]: run_args['target'] = args.target if hasattr(args, 'details') and args.details: From dff795392c1dbf9d9ef88c241cc061fc6ab0f9ab Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sat, 25 Jan 2025 17:18:46 +0530 Subject: [PATCH 06/18] use action to clone source repo --- .github/workflows/test-mlc-core-actions.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index 9ac472ee8..d06c86fff 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -32,9 +32,9 @@ jobs: - name: Install mlcflow from the pull request's source repository and branch run: | - git clone ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - cd mlcflow - pip install . + python -m pip install --upgrade pip + python -m pip install --ignore-installed --verbose pip setuptools + python -m pip install . - name: Test pull repo - Pull a forked MLOps repository run: | From 85ca2a313c937e4a9433b007b43db9ca12003715 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sun, 26 Jan 2025 03:36:25 +0530 Subject: [PATCH 07/18] added more extensive checking --- .github/workflows/test-mlc-core-actions.yaml | 73 +++++++++++++++++--- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index d06c86fff..cfca4bd31 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -36,31 +36,86 @@ jobs: python -m pip install --ignore-installed --verbose pip setuptools python -m pip install . - - name: Test pull repo - Pull a forked MLOps repository + - name: Define helper functions + shell: bash + run: | + # Function to validate a repository after pulling + validate_repo() { + local repo_path="$1" + local repo_json_path="$2" + local expected_branch="$3" + + if [ ! -d "$repo_path" ]; then + echo "Repository folder $repo_path not found. Exiting with failure." + exit 1 + fi + if [ ! -f "$repo_json_path" ]; then + echo "File $repo_json_path does not exist. Exiting with failure." + exit 1 + fi + if ! grep -q "$repo_path" "$repo_json_path"; then + echo "Path $repo_path not found in $repo_json_path. Exiting with failure." + exit 1 + fi + CURRENT_BRANCH=$(git -C "$repo_path" rev-parse --abbrev-ref HEAD) + if [ "$CURRENT_BRANCH" != "$expected_branch" ]; then + echo "Expected branch '$expected_branch', but found '$CURRENT_BRANCH'. Exiting with failure." + exit 1 + fi + } + + - name: Test 1 - pull repo - Pull a forked MLOps repository + env: + GH_MLC_REPO_PATH_FORK: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev + validate_repo "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH" "dev" + - - name: Test pull repo - Test conflicting repo scenario + - name: Test 2 - pull repo - Test conflicting repo scenario + env: + GH_MLC_REPO_PATH: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc pull repo mlcommons@mlperf-automations --checkout=dev + validate_repo "$GH_MLC_REPO_PATH" "$GH_MLC_REPO_JSON_PATH" "dev" + if grep -q "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH"; then + echo "Path $GH_MLC_REPO_PATH_FORK also found in $GH_MLC_REPO_JSON_PATH. This should have been replaced. Exiting with failure." + exit 1 + fi - - name: Test list repo - List the existing repositories + - name: Test 3 - list repo - List the existing repositories run: | mlc list repo - - name: Test rm repo - Remove the forked mlperf-automation repo + - name: Test 4 - rm repo - Remove the forked mlperf-automation repo + env: + GH_MLC_REPO_PATH_FORK: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc rm repo anandhu-eng@mlperf-automations + if [ -d "$GH_MLC_REPO_PATH_FORK" ]; then + echo "Repository folder $GH_MLC_REPO_PATH found. It should ideally be deleted. Exiting with failure." + exit 1 + fi - - name: Test find cache - Cache not present + - name: Test 5 - find cache - Cache not present run: | - mlc find cache --tags=detect,os + mlc find cache --tags=detect,os 2>&1 | tee test5.log + if ! grep -q "No cache entry found for the specified tags!" test5.log; then + exit 1 + fi - - name: Test run script - Output being used for testing mlc cache + - name: Test 6 - run script - Output being used for testing mlc cache run: | mlc run script --tags=get,imagenet-aux mlc run script --tags=get,imagenet-aux,_from.dropbox - - name: Test find cache - More than one cache present + - name: Test 7 - find cache - More than one cache present run: | - mlc find cache --tags=get,imagenet-aux \ No newline at end of file + mlc find cache --tags=get,imagenet-aux 2>&1 | tee test7.log + mlc find cache --tags=detect,os 2>&1 | tee test5.log + if grep -q "No cache entry found for the specified tags!" test5.log; then + exit 1 + fi \ No newline at end of file From 45a4314e46ffb8ecca5a5fc58c59bb9e01ff27fa Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sun, 26 Jan 2025 03:37:36 +0530 Subject: [PATCH 08/18] silence the prompts - quiet --- .github/workflows/test-mlc-core-actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index cfca4bd31..09110df07 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -109,8 +109,8 @@ jobs: - name: Test 6 - run script - Output being used for testing mlc cache run: | - mlc run script --tags=get,imagenet-aux - mlc run script --tags=get,imagenet-aux,_from.dropbox + mlc run script --tags=get,imagenet-aux --quiet + mlc run script --tags=get,imagenet-aux,_from.dropbox --quiet - name: Test 7 - find cache - More than one cache present run: | From b784d5fe336ad73eb899a37bd63b3ff17212b5e6 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sun, 26 Jan 2025 03:41:03 +0530 Subject: [PATCH 09/18] expanded validate function --- .github/workflows/test-mlc-core-actions.yaml | 66 +++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index 09110df07..b97ae6ce0 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -36,41 +36,29 @@ jobs: python -m pip install --ignore-installed --verbose pip setuptools python -m pip install . - - name: Define helper functions - shell: bash - run: | - # Function to validate a repository after pulling - validate_repo() { - local repo_path="$1" - local repo_json_path="$2" - local expected_branch="$3" - - if [ ! -d "$repo_path" ]; then - echo "Repository folder $repo_path not found. Exiting with failure." - exit 1 - fi - if [ ! -f "$repo_json_path" ]; then - echo "File $repo_json_path does not exist. Exiting with failure." - exit 1 - fi - if ! grep -q "$repo_path" "$repo_json_path"; then - echo "Path $repo_path not found in $repo_json_path. Exiting with failure." - exit 1 - fi - CURRENT_BRANCH=$(git -C "$repo_path" rev-parse --abbrev-ref HEAD) - if [ "$CURRENT_BRANCH" != "$expected_branch" ]; then - echo "Expected branch '$expected_branch', but found '$CURRENT_BRANCH'. Exiting with failure." - exit 1 - fi - } - - name: Test 1 - pull repo - Pull a forked MLOps repository env: GH_MLC_REPO_PATH_FORK: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - validate_repo "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH" "dev" + if [ ! -d "$GH_MLC_REPO_PATH_FORK" ]; then + echo "Repository folder $GH_MLC_REPO_PATH_FORK not found. Exiting with failure." + exit 1 + fi + if [ ! -f "$GH_MLC_REPO_JSON_PATH" ]; then + echo "File $GH_MLC_REPO_JSON_PATH does not exist. Exiting with failure." + exit 1 + fi + if ! grep -q "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH"; then + echo "Path $GH_MLC_REPO_PATH_FORK not found in $GH_MLC_REPO_JSON_PATH. Exiting with failure." + exit 1 + fi + CURRENT_BRANCH=$(git -C "$GH_MLC_REPO_PATH_FORK" rev-parse --abbrev-ref HEAD) + if [ "$CURRENT_BRANCH" != "dev" ]; then + echo "Expected branch 'dev', but found '$CURRENT_BRANCH'. Exiting with failure." + exit 1 + fi - name: Test 2 - pull repo - Test conflicting repo scenario @@ -79,11 +67,27 @@ jobs: GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc pull repo mlcommons@mlperf-automations --checkout=dev - validate_repo "$GH_MLC_REPO_PATH" "$GH_MLC_REPO_JSON_PATH" "dev" - if grep -q "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH"; then + if [ ! -d "$GH_MLC_REPO_PATH" ]; then + echo "Repository folder $GH_MLC_REPO_PATH not found. Exiting with failure." + exit 1 + fi + if [ ! -f "$GH_MLC_REPO_JSON_PATH" ]; then + echo "File $GH_MLC_REPO_JSON_PATH does not exist. Exiting with failure." + exit 1 + fi + if ! grep -q "$GH_MLC_REPO_PATH" "$GH_MLC_REPO_JSON_PATH"; then + echo "Path $GH_MLC_REPO_PATH not found in $GH_MLC_REPO_JSON_PATH. Exiting with failure." + exit 1 + fi + if ! grep -q "$GH_MLC_REPO_PATH_FORK" "$GH_MLC_REPO_JSON_PATH"; then echo "Path $GH_MLC_REPO_PATH_FORK also found in $GH_MLC_REPO_JSON_PATH. This should have been replaced. Exiting with failure." exit 1 fi + CURRENT_BRANCH=$(git -C "$GH_MLC_REPO_PATH" rev-parse --abbrev-ref HEAD) + if [ "$CURRENT_BRANCH" != "dev" ]; then + echo "Expected branch 'dev', but found '$CURRENT_BRANCH'. Exiting with failure." + exit 1 + fi - name: Test 3 - list repo - List the existing repositories run: | From 0cc856a32df03efa5a60b17eaf254b0ed756124d Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Sun, 26 Jan 2025 03:44:49 +0530 Subject: [PATCH 10/18] test commit --- .github/workflows/test-mlc-core-actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index b97ae6ce0..fc6aae960 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -38,11 +38,11 @@ jobs: - name: Test 1 - pull repo - Pull a forked MLOps repository env: - GH_MLC_REPO_PATH_FORK: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_NAME_FORK: "anandhu-eng@mlperf-automations" GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - if [ ! -d "$GH_MLC_REPO_PATH_FORK" ]; then + if [ ! -d "$HOME/MLC/repos/$GH_MLC_REPO_PATH_FORK" ]; then echo "Repository folder $GH_MLC_REPO_PATH_FORK not found. Exiting with failure." exit 1 fi From 25c2ca25972c502b27585258e4b2d239d48d6a11 Mon Sep 17 00:00:00 2001 From: ANANDHU S <71482562+anandhu-eng@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:55:16 +0530 Subject: [PATCH 11/18] fix repo path --- .github/workflows/test-mlc-core-actions.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index fc6aae960..e707f6147 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -38,11 +38,11 @@ jobs: - name: Test 1 - pull repo - Pull a forked MLOps repository env: - GH_MLC_REPO_NAME_FORK: "anandhu-eng@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" + GH_MLC_REPO_NAME_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - if [ ! -d "$HOME/MLC/repos/$GH_MLC_REPO_PATH_FORK" ]; then + if [ ! -d "$GH_MLC_REPO_PATH_FORK" ]; then echo "Repository folder $GH_MLC_REPO_PATH_FORK not found. Exiting with failure." exit 1 fi @@ -63,8 +63,8 @@ jobs: - name: Test 2 - pull repo - Test conflicting repo scenario env: - GH_MLC_REPO_PATH: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" + GH_MLC_REPO_PATH: "${HOME}/MLC/repos/mlcommons@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | mlc pull repo mlcommons@mlperf-automations --checkout=dev if [ ! -d "$GH_MLC_REPO_PATH" ]; then @@ -95,8 +95,8 @@ jobs: - name: Test 4 - rm repo - Remove the forked mlperf-automation repo env: - GH_MLC_REPO_PATH_FORK: "$HOME/MLC/repos/anandhu-eng@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "$HOME/MLC/repos/repos.json" + GH_MLC_REPO_PATH_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | mlc rm repo anandhu-eng@mlperf-automations if [ -d "$GH_MLC_REPO_PATH_FORK" ]; then @@ -122,4 +122,4 @@ jobs: mlc find cache --tags=detect,os 2>&1 | tee test5.log if grep -q "No cache entry found for the specified tags!" test5.log; then exit 1 - fi \ No newline at end of file + fi From 9d57d0e5a8eff0fa2e5ab8598a8367dc1f4c9b63 Mon Sep 17 00:00:00 2001 From: ANANDHU S <71482562+anandhu-eng@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:56:26 +0530 Subject: [PATCH 12/18] test commit --- .github/workflows/test-mlc-core-actions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index e707f6147..681728d06 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -38,7 +38,7 @@ jobs: - name: Test 1 - pull repo - Pull a forked MLOps repository env: - GH_MLC_REPO_NAME_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_PATH_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev From 19d95b089ff870172b619f51799c73502a0f2238 Mon Sep 17 00:00:00 2001 From: ANANDHU S <71482562+anandhu-eng@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:00:46 +0530 Subject: [PATCH 13/18] test commit --- .github/workflows/test-mlc-core-actions.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index 681728d06..cdb4260e1 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -17,6 +17,9 @@ jobs: matrix: python-version: ["3.12", "3.8"] os: ["ubuntu-latest", "windows-latest", "macos-latest"] + exclude: + - os: windows-latest + - os: macos-latest steps: - uses: actions/checkout@v4 @@ -42,7 +45,7 @@ jobs: GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | mlc pull repo anandhu-eng@mlperf-automations --checkout=dev - if [ ! -d "$GH_MLC_REPO_PATH_FORK" ]; then + if [ ! -d "${GH_MLC_REPO_PATH_FORK}" ]; then echo "Repository folder $GH_MLC_REPO_PATH_FORK not found. Exiting with failure." exit 1 fi From 7ef00730a599e64a0f4cb9c5c9ea92c10dd06bfe Mon Sep 17 00:00:00 2001 From: ANANDHU S <71482562+anandhu-eng@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:18:32 +0530 Subject: [PATCH 14/18] test commit --- .github/workflows/test-mlc-core-actions.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index cdb4260e1..9278c0499 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -40,10 +40,9 @@ jobs: python -m pip install . - name: Test 1 - pull repo - Pull a forked MLOps repository - env: - GH_MLC_REPO_PATH_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | + GH_MLC_REPO_PATH_FORK="${HOME}/MLC/repos/anandhu-eng@mlperf-automations" + GH_MLC_REPO_JSON_PATH="${HOME}/MLC/repos/repos.json" mlc pull repo anandhu-eng@mlperf-automations --checkout=dev if [ ! -d "${GH_MLC_REPO_PATH_FORK}" ]; then echo "Repository folder $GH_MLC_REPO_PATH_FORK not found. Exiting with failure." @@ -65,10 +64,9 @@ jobs: - name: Test 2 - pull repo - Test conflicting repo scenario - env: - GH_MLC_REPO_PATH: "${HOME}/MLC/repos/mlcommons@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | + GH_MLC_REPO_PATH="${HOME}/MLC/repos/mlcommons@mlperf-automations" + GH_MLC_REPO_JSON_PATH="${HOME}/MLC/repos/repos.json" mlc pull repo mlcommons@mlperf-automations --checkout=dev if [ ! -d "$GH_MLC_REPO_PATH" ]; then echo "Repository folder $GH_MLC_REPO_PATH not found. Exiting with failure." @@ -97,10 +95,8 @@ jobs: mlc list repo - name: Test 4 - rm repo - Remove the forked mlperf-automation repo - env: - GH_MLC_REPO_PATH_FORK: "${HOME}/MLC/repos/anandhu-eng@mlperf-automations" - GH_MLC_REPO_JSON_PATH: "${HOME}/MLC/repos/repos.json" run: | + GH_MLC_REPO_PATH_FORK="${HOME}/MLC/repos/anandhu-eng@mlperf-automations" mlc rm repo anandhu-eng@mlperf-automations if [ -d "$GH_MLC_REPO_PATH_FORK" ]; then echo "Repository folder $GH_MLC_REPO_PATH found. It should ideally be deleted. Exiting with failure." From 9fbac9251e7b7f82e1dbe81e2d0d3d1ce937bd6e Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 30 Jan 2025 22:51:01 +0000 Subject: [PATCH 15/18] Update test-mlc-core-actions.yaml --- .github/workflows/test-mlc-core-actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index 9278c0499..967b8d5d9 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -117,8 +117,8 @@ jobs: - name: Test 7 - find cache - More than one cache present run: | - mlc find cache --tags=get,imagenet-aux 2>&1 | tee test7.log - mlc find cache --tags=detect,os 2>&1 | tee test5.log + mlc search cache --tags=get,imagenet-aux 2>&1 | tee test7.log + mlc search cache --tags=detect,os 2>&1 | tee test5.log if grep -q "No cache entry found for the specified tags!" test5.log; then exit 1 fi From af3422d4a251b11b69613d6c84c9a19dc4b57d24 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 30 Jan 2025 22:53:02 +0000 Subject: [PATCH 16/18] Update test-mlc-core-actions.yaml From 60c5f997c8642af6f77e40212dda48eba157aabd Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 30 Jan 2025 22:54:38 +0000 Subject: [PATCH 17/18] Update main.py --- mlc/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mlc/main.py b/mlc/main.py index e1b7f57d3..8ef7340e6 100644 --- a/mlc/main.py +++ b/mlc/main.py @@ -1211,6 +1211,7 @@ def search(self, i): i['target_name'] = "cache" #logger.debug(f"Searching for cache with input: {i}") return self.parent.search(i) + find = search def rm(self, i): i['target_name'] = "cache" From bc80c4ac6207c3928a97f1a3822becf8c8800dc8 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 30 Jan 2025 23:07:27 +0000 Subject: [PATCH 18/18] Update test-mlc-core-actions.yaml --- .github/workflows/test-mlc-core-actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mlc-core-actions.yaml b/.github/workflows/test-mlc-core-actions.yaml index 967b8d5d9..5791d6c14 100644 --- a/.github/workflows/test-mlc-core-actions.yaml +++ b/.github/workflows/test-mlc-core-actions.yaml @@ -106,7 +106,7 @@ jobs: - name: Test 5 - find cache - Cache not present run: | mlc find cache --tags=detect,os 2>&1 | tee test5.log - if ! grep -q "No cache entry found for the specified tags!" test5.log; then + if ! grep -q "No cache entry found for the specified tags:" test5.log; then exit 1 fi @@ -119,6 +119,6 @@ jobs: run: | mlc search cache --tags=get,imagenet-aux 2>&1 | tee test7.log mlc search cache --tags=detect,os 2>&1 | tee test5.log - if grep -q "No cache entry found for the specified tags!" test5.log; then + if grep -q "No cache entry found for the specified tags:" test5.log; then exit 1 fi