From 4b389f3a3559353ae8504b566a2f19be19ef9655 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 29 May 2025 10:46:27 +0000 Subject: [PATCH 01/26] Added option to skip detect-sudo, support postfix detection --- script/detect-sudo/customize.py | 4 ++-- script/get-generic-sys-util/meta.yaml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/script/detect-sudo/customize.py b/script/detect-sudo/customize.py index 3e1b65059..41236eb0c 100644 --- a/script/detect-sudo/customize.py +++ b/script/detect-sudo/customize.py @@ -27,8 +27,8 @@ def preprocess(i): env['MLC_SUDO'] = '' # root user does not need sudo env['MLC_SUDO_USER'] = "yes" else: - if can_execute_sudo_without_password( - logger) or prompt_sudo(logger) == 0: + if not is_true(env.get('MLC_SKIP_SUDO')) and ( can_execute_sudo_without_password( + logger) or prompt_sudo(logger) == 0): env['MLC_SUDO_USER'] = "yes" env['MLC_SUDO'] = 'sudo' diff --git a/script/get-generic-sys-util/meta.yaml b/script/get-generic-sys-util/meta.yaml index b8f248337..7e0f33ca0 100644 --- a/script/get-generic-sys-util/meta.yaml +++ b/script/get-generic-sys-util/meta.yaml @@ -662,6 +662,9 @@ variations: postfix: env: MLC_SYS_UTIL_NAME: postfix + MLC_SYS_UTIL_VERSION_CMD: postconf mail_version + MLC_SYS_UTIL_VERSION_RE: mail_version = \b(\d+\.\d+(?:\.\d+)?)\b + MLC_TMP_VERSION_DETECT_GROUP_NUMBER: 1 new_env_keys: - MLC_POSTFIX_VERSION state: From dc76ec1a7447e5e5782d9c79069ed969776d8089 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 29 May 2025 10:48:49 +0000 Subject: [PATCH 02/26] [Automated Commit] Format Codebase [skip ci] --- script/detect-sudo/customize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/detect-sudo/customize.py b/script/detect-sudo/customize.py index 41236eb0c..104d8b781 100644 --- a/script/detect-sudo/customize.py +++ b/script/detect-sudo/customize.py @@ -27,7 +27,7 @@ def preprocess(i): env['MLC_SUDO'] = '' # root user does not need sudo env['MLC_SUDO_USER'] = "yes" else: - if not is_true(env.get('MLC_SKIP_SUDO')) and ( can_execute_sudo_without_password( + if not is_true(env.get('MLC_SKIP_SUDO')) and (can_execute_sudo_without_password( logger) or prompt_sudo(logger) == 0): env['MLC_SUDO_USER'] = "yes" env['MLC_SUDO'] = 'sudo' From ffc4e25c2af2503e440f260bf457a1bd28f78ac0 Mon Sep 17 00:00:00 2001 From: Arjun Date: Mon, 2 Jun 2025 18:15:29 +0530 Subject: [PATCH 03/26] Support installation variations in get,llvm --- script/get-llvm/meta.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/script/get-llvm/meta.yaml b/script/get-llvm/meta.yaml index 8193227b7..abcebd854 100644 --- a/script/get-llvm/meta.yaml +++ b/script/get-llvm/meta.yaml @@ -27,6 +27,9 @@ prehook_deps: - 'yes' names: llvm-install reuse_version: true + inherit_variation_tags: true + skip_inherit_variation_groups: + - install-src tags: install,llvm sort: 100 tags: @@ -39,13 +42,24 @@ tags: uid: 99832a103ed04eb8 variations: from-prebuilt: + group: install-src + default: true ad: llvm-install: tags: prebuilt from-src: + group: install-src ad: llvm-install: tags: src,_clang path.#: env: MLC_LLVM_DIR_PATH: '#' + release: {} + version.#: {} + branch.#: {} + runtimes.#: {} + flang: {} + sha.#: {} + tag.#: {} + From 988924a24c7394758df13b8398f8026497495c91 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Mon, 2 Jun 2025 18:55:39 +0530 Subject: [PATCH 04/26] Fix tags for nvidia-harness --- script/app-mlperf-inference/meta.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/script/app-mlperf-inference/meta.yaml b/script/app-mlperf-inference/meta.yaml index abf480eff..dcfea1431 100644 --- a/script/app-mlperf-inference/meta.yaml +++ b/script/app-mlperf-inference/meta.yaml @@ -1820,6 +1820,8 @@ variations: nvidia-inference-server: version: r4.1 tags: _go + nvidia-harness: + tags: _v4.0 intel-harness: tags: _v4.1 nvidia-scratch-space: @@ -1841,6 +1843,8 @@ variations: nvidia-inference-server: version: r4.0 tags: _mlcommons + nvidia-harness: + tags: _v4.0 intel-harness: tags: _v4.1 inference-src: @@ -1862,6 +1866,8 @@ variations: nvidia-inference-server: version: r5.0 tags: _mlcommons + nvidia-harness: + tags: _v5.0 intel-harness: tags: _v4.1 inference-src: From 061bf6041dc253784bad8f29b1df7d2516158009 Mon Sep 17 00:00:00 2001 From: Arjun Date: Thu, 5 Jun 2025 20:08:20 +0530 Subject: [PATCH 05/26] Support tar.bz2, 7z and rar in extract-file, export more variables in detect,cpu --- script/detect-cpu/customize.py | 12 +++++++++--- script/extract-file/customize.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/script/detect-cpu/customize.py b/script/detect-cpu/customize.py index b6d1d73fc..7c3effe8d 100644 --- a/script/detect-cpu/customize.py +++ b/script/detect-cpu/customize.py @@ -172,7 +172,7 @@ def postprocess(i): else: env[env_key] = v[1].strip() - if env.get('MLC_HOST_CPU_SOCKETS', '') == '-': # assume as 1 + if env.get('MLC_HOST_CPU_SOCKETS', '') in ['-', '']: # assume as 1 env['MLC_HOST_CPU_SOCKETS'] = '1' if env.get('MLC_HOST_CPU_TOTAL_CORES', '') != '' and env.get( @@ -184,9 +184,15 @@ def postprocess(i): env['MLC_HOST_CPU_THREADS_PER_CORE'] = str(int(int(env['MLC_HOST_CPU_TOTAL_LOGICAL_CORES']) // int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES']))) - if env.get('MLC_HOST_CPU_SOCKETS', '') != '' and env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', - '') != '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '': + if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '': env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET'] = str( int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES']) // int(env['MLC_HOST_CPU_SOCKETS'])) + if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') == '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') != '': + env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'] = str(int(env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET']) * int(env['MLC_HOST_CPU_SOCKETS'])) + + if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '': + env['MLC_HOST_CPU_PHYSICAL_CORES_LIST'] = f"""0-{int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'])-1}""" + + return {'return': 0} diff --git a/script/extract-file/customize.py b/script/extract-file/customize.py index c0e0957f3..ddefc0757 100644 --- a/script/extract-file/customize.py +++ b/script/extract-file/customize.py @@ -77,9 +77,39 @@ def preprocess(i): else: env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvJf' env['MLC_EXTRACT_TOOL'] = 'tar ' + elif filename.endswith(".tar.bz2"): + if windows: + x = '"' if ' ' in filename else '' + env['MLC_EXTRACT_CMD0'] = 'bzip2 -d ' + x + filename + x + filename = filename[:-4] # leave only .tar + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvf' + env['MLC_EXTRACT_TOOL'] = 'tar ' + elif os_info['platform'] == 'darwin': + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvjf ' + env['MLC_EXTRACT_TOOL'] = 'tar ' + else: + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' --skip-old-files -xvjf ' + env['MLC_EXTRACT_TOOL'] = 'tar ' elif filename.endswith(".tar"): env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvf' env['MLC_EXTRACT_TOOL'] = 'tar ' + elif filename.endswith(".7z"): + if windows: + env['MLC_EXTRACT_TOOL'] = '7z' + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y ' + else: + # Assumes p7zip is installed and provides the `7z` or `7zr` binary + env['MLC_EXTRACT_TOOL'] = '7z' + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y ' + + elif filename.endswith(".rar"): + if windows: + env['MLC_EXTRACT_TOOL'] = 'unrar' + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y ' + else: + # unrar or unar may be available on Unix-like systems + env['MLC_EXTRACT_TOOL'] = 'unrar' + env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y ' elif filename.endswith(".gz"): # Check target filename extracted_filename = env.get('MLC_EXTRACT_EXTRACTED_FILENAME', '') From 0b55f57c138cc53bd2abb95c03d6e5d5ed21ef5e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Jun 2025 14:39:07 +0000 Subject: [PATCH 06/26] [Automated Commit] Format Codebase [skip ci] --- script/detect-cpu/customize.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/script/detect-cpu/customize.py b/script/detect-cpu/customize.py index 7c3effe8d..1e8584c03 100644 --- a/script/detect-cpu/customize.py +++ b/script/detect-cpu/customize.py @@ -184,15 +184,17 @@ def postprocess(i): env['MLC_HOST_CPU_THREADS_PER_CORE'] = str(int(int(env['MLC_HOST_CPU_TOTAL_LOGICAL_CORES']) // int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES']))) - if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '': + if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '' and env.get( + 'MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '': env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET'] = str( int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES']) // int(env['MLC_HOST_CPU_SOCKETS'])) - if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') == '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') != '': - env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'] = str(int(env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET']) * int(env['MLC_HOST_CPU_SOCKETS'])) + if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') == '' and env.get( + 'MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') != '': + env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'] = str(int( + env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET']) * int(env['MLC_HOST_CPU_SOCKETS'])) if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '': env['MLC_HOST_CPU_PHYSICAL_CORES_LIST'] = f"""0-{int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'])-1}""" - return {'return': 0} From a15e989691551b35145246146cbf174a150437fa Mon Sep 17 00:00:00 2001 From: Arjun Date: Fri, 6 Jun 2025 01:36:01 +0530 Subject: [PATCH 07/26] Added a parser for system-detail.txt --- script/get-platform-details/parse.py | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 script/get-platform-details/parse.py diff --git a/script/get-platform-details/parse.py b/script/get-platform-details/parse.py new file mode 100644 index 000000000..5aa9f3e8b --- /dev/null +++ b/script/get-platform-details/parse.py @@ -0,0 +1,59 @@ +import json +import re + +# Load the input text from the system-info.txt file +with open("system-info.txt", "r", encoding="utf-8") as f: + data = f.read() + +# Define patterns to extract key data points +extracts = { + "uname": r"uname -a\n(.+)", + "username": r"3\. Username\n(.+)", + "uptime": r"2\. w\n\s+.+\s+up\s+(.+?),", + "cpu_model": r"Model name:\s+(.+)", + "cpu_cores": r"Core\(s\) per socket:\s+(\d+)", + "threads_per_core": r"Thread\(s\) per core:\s+(\d+)", + "total_cpus": r"CPU\(s\):\s+(\d+)", + "mem_total_kb": r"MemTotal:\s+(\d+)\s+kB", + "mem_free_kb": r"MemFree:\s+(\d+)\s+kB", + "swap_total_kb": r"SwapTotal:\s+(\d+)\s+kB", + "swap_free_kb": r"SwapFree:\s+(\d+)\s+kB", + "kernel_version": r"kernel.version\s+=\s+(.+)", + "architecture": r"Architecture:\s+(\S+)", + "boot_args": r"13\. Linux kernel boot-time arguments, from /proc/cmdline\n(.+)", + "bios_vendor": r"Vendor:\s+(.+)", + "bios_version": r"Version:\s+([\d\.]+)", + "bios_release_date": r"Release Date:\s+(.+)", + "cpu_frequency_range": r"hardware limits:\s+(.+)", + "virtualization": r"Virtualization:\s+(.+)", + "l1d_cache": r"L1d cache:\s+(.+)", + "l2_cache": r"L2 cache:\s+(.+)", + "l3_cache": r"L3 cache:\s+(.+)", + "numa_nodes": r"NUMA node\(s\):\s+(\d+)", + "runlevel": r"who -r\n\s+run-level\s+(\d+)", + "systemd_version": r"Systemd service manager version\n(.+)", + "max_mhz": r"CPU max MHz:\s+([\d\.]+)", + "min_mhz": r"CPU min MHz:\s+([\d\.]+)", + "bogomips": r"BogoMIPS:\s+([\d\.]+)", + "cache_alignment": r"cache_alignment\s+:\s+(\d+)", + "address_sizes": r"Address sizes:\s+(.+)", + "numactl_total_mem_mb": r"node 0 size:\s+(\d+)\s+MB", + "dimm_actual_speed": r"Speed:\s+(\d+)\s+MT/s", + "dimm_configured_speed": r"Configured Memory Speed:\s+(\d+)\s+MT/s" +} + +# Extract matched values +results = [] +for key, pattern in extracts.items(): + match = re.search(pattern, data) + if match: + results.append({"key": key, "value": match.group(1)}) + +# Add derived field: number of services +services = re.findall(r"\.service", data) +results.append({"key": "total_services_detected", "value": len(services)}) + +# Output as JSON array +json_output = json.dumps(results, indent=2) +print(json_output) + From 0d9cdd7e1f19f5e3adc4d86890f7843071e5beda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Jun 2025 20:06:58 +0000 Subject: [PATCH 08/26] [Automated Commit] Format Codebase [skip ci] --- script/get-platform-details/parse.py | 1 - 1 file changed, 1 deletion(-) diff --git a/script/get-platform-details/parse.py b/script/get-platform-details/parse.py index 5aa9f3e8b..e3ad9efa3 100644 --- a/script/get-platform-details/parse.py +++ b/script/get-platform-details/parse.py @@ -56,4 +56,3 @@ # Output as JSON array json_output = json.dumps(results, indent=2) print(json_output) - From 9fc49f68bb9da4970b4c6e4cb5237a98ff9455fe Mon Sep 17 00:00:00 2001 From: Arjun Date: Wed, 25 Jun 2025 18:42:32 +0530 Subject: [PATCH 09/26] Added initial support for mlc doc script --- automation/script/doc.py | 140 ++++++++++++++++++++++++++++++++++++ automation/script/module.py | 37 +++++----- 2 files changed, 159 insertions(+), 18 deletions(-) create mode 100644 automation/script/doc.py diff --git a/automation/script/doc.py b/automation/script/doc.py new file mode 100644 index 000000000..c0844874d --- /dev/null +++ b/automation/script/doc.py @@ -0,0 +1,140 @@ +import os +from mlc import utils +from utils import * +import logging +from pathlib import PureWindowsPath, PurePosixPath +import copy + + +def generate_doc(self_module, input_params): + """ + Generates the documentation of MLC scripts. + + Args: + self_module: Reference to the current module for internal calls. + i: Dictionary containing input parameters. + + Returns: + Dictionary with the result of the operation. Keys: + - 'return': 0 on success, >0 on error. + - 'error': Error message (if any). + """ + + # Extract and handle basic inputs + quiet = input_params.get('quiet', False) + logger = self_module.logger + env = input_params.get('env', {}) + generic_inputs = self_module.input_flags_converted_to_env + + print(input_params) + + # Step 2: Search for scripts + search_result = self_module.search(input_params.copy()) + if search_result['return'] > 0: + return search_result + + scripts_list = search_result['list'] + if not scripts_list: + return {'return': 1, 'error': 'No scripts were found'} + + env = input_params.get('env', {}) + state_data = input_params.get('state', {}) + constant_vars = input_params.get('const', {}) + constant_state = input_params.get('const_state', {}) + tag_values = input_params.get('tags', '').split(",") + variation_tags = [tag[1:] for tag in tag_values if tag.startswith("_")] + + # Step 4: Iterate over scripts and generate Dockerfile + for script in sorted(scripts_list, key=lambda x: x.meta.get('alias', '')): + metadata = script.meta + script_directory = script.path + script_tags = metadata.get("tags", []) + script_alias = metadata.get('alias', '') + script_uid = metadata.get('uid', '') + script_input_mapping = metadata.get('input_mapping', {}) + script_input_description = metadata.get('input_description', {}) + + r = generate_docs(metadata, script_directory, generic_inputs) + if r['return'] > 0: + continue + + return {'return': 0} + +def generate_docs(metadata, script_path, generic_inputs): + script_name = metadata.get('alias', metadata['uid']) + readme_prefix = f"""This README is automatically generated. Please follow the [script execution document](https://docs.mlcommons.org/mlcflow/targets/script/execution-flow/) to understand more about the MLC script execution. +""" + doc_content = f"""# README for {script_name} +{readme_prefix} +""" + + readme_dir = os.path.join(script_path, "docs") + + + if not os.path.exists(readme_dir): + os.makedirs(readme_dir) + + script_tags = metadata.get("tags", []) + script_tags_help = metadata.get("tags_help", '') + if not script_tags_help: + tags_string = ",".join(script_tags) + else: + tags_string = script_tags_help + + script_input_mapping = metadata.get('input_mapping', {}) + script_input_description = metadata.get('input_description', {}) + + r = get_run_readme(tags_string, script_input_mapping, script_input_description, generic_inputs) + if r['return'] > 0: + return r + + run_readme = r['run_readme'] + + doc_content += run_readme + + readme_path = os.path.join(readme_dir, "README.md") + with open(readme_path, "w") as f: + f.write(doc_content) + print(f"Readme generated at {readme_path}") + + return {'return': 0} + +def get_run_readme(tags, input_mapping, input_description, generic_inputs): + run_readme = f"""## Run Commands + +```mlcr {tags} +``` +""" + + if input_description: + input_description_string = generate_markdown("Script Inputs", input_description) + else: + input_description_string = "No script specific inputs" + + run_readme += input_description_string + + generic_input_string = generate_markdown("Generic Script Inputs", generic_inputs) + + run_readme += generic_input_string + + return {'return': 0, 'run_readme': run_readme} + +def infer_type(field): + if "dtype" in field: + return field["dtype"] + elif "default" in field: + return type(field["default"]).__name__ + else: + return "str" + +def generate_markdown(heading, input_dict): + lines = [f"### {heading}\n", "| Name | Description | Default | Type |", "|------|-------------|---------|------|"] + for key in sorted(input_dict, key=lambda k: input_dict[k].get("sort", 9999)): + field = input_dict[key] + desc = field.get("desc", "") + default = field.get("default", "") + dtype = infer_type(field) + lines.append(f"| `{key}` | {desc} | `{default}` | {dtype} |") + return "\n".join(lines) + + diff --git a/automation/script/module.py b/automation/script/module.py index 6cc851fc0..69deaa013 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -68,22 +68,23 @@ def __init__(self, action_object, automation_file): 'MLC_GIT_*', 'MLC_RENEW_CACHE_ENTRY'] - self.input_flags_converted_to_tmp_env = ['path'] - - self.input_flags_converted_to_env = ['input', - 'output', - 'outdirname', - 'outbasename', - 'name', - 'extra_cache_tags', - 'skip_compile', - 'skip_run', - 'accept_license', - 'skip_system_deps', - 'git_ssh', - 'gh_token', - 'hf_token', - 'verify_ssl'] + self.input_flags_converted_to_tmp_env = {'path': {'desc': 'Filesystem path to search for executable', 'default': ''}} + + self.input_flags_converted_to_env = {'input': {'desc': 'Input to the script passed using the env key `MLC_INPUT`', 'default': ''}, + 'output': {'desc': 'Output from the script passed using the env key `MLC_OUTPUT`', 'default': ''}, + 'outdirname': {'desc': 'The directory to store the script output', 'default': 'cache directory ($HOME/MLC/repos/local/cache/<>) if the script is cacheable or else the current directory'}, + 'outbasename': {'desc': 'The output file/folder name', 'default': ''}, + 'name': {}, + 'extra_cache_tags': {'desc': 'Extra cache tags to be added to the cached entry when the script results are saved', 'default': ''}, + 'skip_compile': {'desc': 'Skip compilation', 'default': False}, + 'skip_run': {'desc': 'Skip run', 'default': False}, + 'accept_license': {'desc': 'Accept the required license requirement to run the script', 'default': False}, + 'skip_system_deps': {'desc': 'Skip installing any system dependencies', 'default': False}, + 'git_ssh': {'desc': 'Use SSH for git repos', 'default': False}, + 'gh_token': {'desc': 'Github Token', 'default': ''}, + 'hf_token': {'desc': 'Huggingface Token', 'default': ''}, + 'verify_ssl': {'desc': 'Verify SSL', 'default': False} + } ############################################################ @@ -4461,8 +4462,8 @@ def doc(self, i): """ - return utils.call_internal_module( - self, __file__, 'module_misc', 'doc', i) + from script.doc import generate_doc + return generate_doc(self, i) ############################################################ From 4e285c379e96800f2cd0cda197f3592fc1cd22e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Jun 2025 13:13:40 +0000 Subject: [PATCH 10/26] [Automated Commit] Format Codebase [skip ci] --- automation/script/doc.py | 33 ++++++++++++++++++++++----------- automation/script/module.py | 3 ++- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/automation/script/doc.py b/automation/script/doc.py index c0844874d..a2d2ab932 100644 --- a/automation/script/doc.py +++ b/automation/script/doc.py @@ -28,7 +28,7 @@ def generate_doc(self_module, input_params): print(input_params) - # Step 2: Search for scripts + # Step 2: Search for scripts search_result = self_module.search(input_params.copy()) if search_result['return'] > 0: return search_result @@ -60,6 +60,7 @@ def generate_doc(self_module, input_params): return {'return': 0} + def generate_docs(metadata, script_path, generic_inputs): script_name = metadata.get('alias', metadata['uid']) readme_prefix = f"""This README is automatically generated. Please follow the [script execution document](https://docs.mlcommons.org/mlcflow/targets/script/execution-flow/) to understand more about the MLC script execution. @@ -70,7 +71,6 @@ def generate_docs(metadata, script_path, generic_inputs): readme_dir = os.path.join(script_path, "docs") - if not os.path.exists(readme_dir): os.makedirs(readme_dir) @@ -84,10 +84,14 @@ def generate_docs(metadata, script_path, generic_inputs): script_input_mapping = metadata.get('input_mapping', {}) script_input_description = metadata.get('input_description', {}) - r = get_run_readme(tags_string, script_input_mapping, script_input_description, generic_inputs) + r = get_run_readme( + tags_string, + script_input_mapping, + script_input_description, + generic_inputs) if r['return'] > 0: return r - + run_readme = r['run_readme'] doc_content += run_readme @@ -99,6 +103,7 @@ def generate_docs(metadata, script_path, generic_inputs): return {'return': 0} + def get_run_readme(tags, input_mapping, input_description, generic_inputs): run_readme = f"""## Run Commands @@ -107,18 +112,21 @@ def get_run_readme(tags, input_mapping, input_description, generic_inputs): """ if input_description: - input_description_string = generate_markdown("Script Inputs", input_description) + input_description_string = generate_markdown( + "Script Inputs", input_description) else: input_description_string = "No script specific inputs" - + run_readme += input_description_string - generic_input_string = generate_markdown("Generic Script Inputs", generic_inputs) + generic_input_string = generate_markdown( + "Generic Script Inputs", generic_inputs) run_readme += generic_input_string return {'return': 0, 'run_readme': run_readme} + def infer_type(field): if "dtype" in field: return field["dtype"] @@ -127,14 +135,17 @@ def infer_type(field): else: return "str" + def generate_markdown(heading, input_dict): - lines = [f"### {heading}\n", "| Name | Description | Default | Type |", "|------|-------------|---------|------|"] - for key in sorted(input_dict, key=lambda k: input_dict[k].get("sort", 9999)): + lines = [ + f"### {heading}\n", + "| Name | Description | Default | Type |", + "|------|-------------|---------|------|"] + for key in sorted( + input_dict, key=lambda k: input_dict[k].get("sort", 9999)): field = input_dict[key] desc = field.get("desc", "") default = field.get("default", "") dtype = infer_type(field) lines.append(f"| `{key}` | {desc} | `{default}` | {dtype} |") return "\n".join(lines) - - diff --git a/automation/script/module.py b/automation/script/module.py index 69deaa013..6ee906c01 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -68,7 +68,8 @@ def __init__(self, action_object, automation_file): 'MLC_GIT_*', 'MLC_RENEW_CACHE_ENTRY'] - self.input_flags_converted_to_tmp_env = {'path': {'desc': 'Filesystem path to search for executable', 'default': ''}} + self.input_flags_converted_to_tmp_env = { + 'path': {'desc': 'Filesystem path to search for executable', 'default': ''}} self.input_flags_converted_to_env = {'input': {'desc': 'Input to the script passed using the env key `MLC_INPUT`', 'default': ''}, 'output': {'desc': 'Output from the script passed using the env key `MLC_OUTPUT`', 'default': ''}, From da579d26fcfc7c95a6700411285852c31d1679a5 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 14:19:53 +0100 Subject: [PATCH 11/26] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 55e79c0ae..86b93ac06 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -5,7 +5,6 @@ on: types: [published] workflow_dispatch: {} - jobs: build_wheels: if: github.repository_owner == 'mlcommons' From 76268ea998fabd3788a85fb8923c96d0fa19b999 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 14:32:28 +0100 Subject: [PATCH 12/26] Update list_modified_files.py --- .github/scripts/list_modified_files.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/scripts/list_modified_files.py b/.github/scripts/list_modified_files.py index 52b1a3a08..52562b949 100644 --- a/.github/scripts/list_modified_files.py +++ b/.github/scripts/list_modified_files.py @@ -30,12 +30,24 @@ def process_files(files): for i in range(1, num_tests + 1) ] +def get_modified_metas(files): + filenames = files.split(",") + return [ + { + "file": file, + "uid": uid, + } + for file in filenames if os.path.basename(file) == 'meta.yaml' + for uid, num_tests in [get_file_info(file)] + ] + if __name__ == "__main__": changed_files = sys.stdin.read().strip() processed_files = process_files(changed_files) + modified_metas = get_modified_metas(changed_files) json_processed_files = json.dumps(processed_files) print(json_processed_files) with open(os.environ['GITHUB_OUTPUT'], 'a') as f: f.write( - f"processed_files={json.dumps({'file_info': processed_files})}\n") + f"processed_files={json.dumps({'file_info': processed_files, 'modified_metas': modified_metas})}\n") From 5115c40f1a7538a8ae256c02fe85d912cddf3c67 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Jun 2025 13:32:55 +0000 Subject: [PATCH 13/26] [Automated Commit] Format Codebase [skip ci] --- .github/scripts/list_modified_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/list_modified_files.py b/.github/scripts/list_modified_files.py index 52562b949..c7acd1410 100644 --- a/.github/scripts/list_modified_files.py +++ b/.github/scripts/list_modified_files.py @@ -30,6 +30,7 @@ def process_files(files): for i in range(1, num_tests + 1) ] + def get_modified_metas(files): filenames = files.split(",") return [ From 09fd954da8790ea09c62b177be0c0d1de1984392 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 14:42:52 +0100 Subject: [PATCH 14/26] Update run-tests-on-modified-meta.yml to handle documentation --- .../workflows/run-tests-on-modified-meta.yml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 7fbe79327..b5154924e 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -58,3 +58,36 @@ jobs: pip install mlcflow mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} mlc test script ${{ matrix.file_info.uid}} --test_input_index=${{ matrix.file_info.num_run }} --docker_mlc_repo=${{ github.event.pull_request.head.repo.html_url }} --docker_mlc_repo_branch=${{ github.event.pull_request.head.ref }} --quiet + + document_modified_scripts: + runs-on: ubuntu-latest + needs: get_modified_files + if: needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' + strategy: + fail-fast: false + matrix: + modified_metas: ${{ fromJSON(needs.get_modified_files.outputs.processed_files).modified_metas }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Document meta.yaml file + run: | + echo "Documenting ${{ matrix.modified_metas.file }}" + + pip install mlcflow + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + mlc doc script ${{ matrix.modified_metas.uid}} --quiet + git add **/README.md + # Use the GitHub actor's name and email + git config --global user.name github-actions[bot] + git config --global user.email "github-actions[bot]@users.noreply.github.com" + # Commit changes + git commit -m '[Automated Commit] Document ${{ matrix.modified_metas.file}} [skip ci]' + git push + + + From 36aab184a117e5c75e2282bc96668cacda5b56b9 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 14:48:14 +0100 Subject: [PATCH 15/26] Update meta.yaml --- script/run-mlperf-inference-app/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/script/run-mlperf-inference-app/meta.yaml b/script/run-mlperf-inference-app/meta.yaml index ad5ba5d82..c1ed0119a 100644 --- a/script/run-mlperf-inference-app/meta.yaml +++ b/script/run-mlperf-inference-app/meta.yaml @@ -28,6 +28,7 @@ tags: tags_help: "run-mlperf,inference" predeps: False + default_env: MLC_MLPERF_IMPLEMENTATION: reference MLC_MLPERF_MODEL: resnet50 From 77ac5bba68aea423d3779106e96e36675b14e3ad Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 14:51:13 +0100 Subject: [PATCH 16/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index b5154924e..e11e49083 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -72,7 +72,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 - name: Document meta.yaml file run: | From 1d1da6cf718c171bb8c76f4fa96edf2ed534659a Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:02:17 +0100 Subject: [PATCH 17/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index e11e49083..415f657f8 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -46,11 +46,6 @@ jobs: file_info: ${{ fromJSON(needs.get_modified_files.outputs.processed_files).file_info }} steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - name: Process meta.yaml file run: | echo "Processing ${{ matrix.file_info.file }} with run number ${{ matrix.file_info.num_run }}" @@ -62,7 +57,8 @@ jobs: document_modified_scripts: runs-on: ubuntu-latest needs: get_modified_files - if: needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' + if: ${{ needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' && github.event.pull_request.base.ref == 'dev' }} + strategy: fail-fast: false matrix: @@ -73,14 +69,16 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + path: automation-scripts - name: Document meta.yaml file run: | echo "Documenting ${{ matrix.modified_metas.file }}" pip install mlcflow - mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + mlc add repo automation-scripts mlc doc script ${{ matrix.modified_metas.uid}} --quiet + cd automation-scripts git add **/README.md # Use the GitHub actor's name and email git config --global user.name github-actions[bot] From 1742c84fbf2e297bc05c5f7f8f77e772dd1494c3 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:07:20 +0100 Subject: [PATCH 18/26] Update doc.py --- automation/script/doc.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/automation/script/doc.py b/automation/script/doc.py index a2d2ab932..ddbfe450f 100644 --- a/automation/script/doc.py +++ b/automation/script/doc.py @@ -26,8 +26,6 @@ def generate_doc(self_module, input_params): env = input_params.get('env', {}) generic_inputs = self_module.input_flags_converted_to_env - print(input_params) - # Step 2: Search for scripts search_result = self_module.search(input_params.copy()) if search_result['return'] > 0: From 2b86437f88534159c07f50accbaac1d66edd17dd Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:09:02 +0100 Subject: [PATCH 19/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 415f657f8..9de0a72a7 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -79,7 +79,7 @@ jobs: mlc add repo automation-scripts mlc doc script ${{ matrix.modified_metas.uid}} --quiet cd automation-scripts - git add **/README.md + find . -type f -name README.md -exec git add {} + # Use the GitHub actor's name and email git config --global user.name github-actions[bot] git config --global user.email "github-actions[bot]@users.noreply.github.com" From be6c967f2ec330528df6610179be6dfdf78fb35f Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:11:45 +0100 Subject: [PATCH 20/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 9de0a72a7..0e8ea2ac3 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -58,6 +58,8 @@ jobs: runs-on: ubuntu-latest needs: get_modified_files if: ${{ needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' && github.event.pull_request.base.ref == 'dev' }} + permissions: + contents: write strategy: fail-fast: false From 8bafe045fcd4890cc60315c3d7b9d68308f50242 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:22:10 +0100 Subject: [PATCH 21/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 0e8ea2ac3..07ac99472 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -73,6 +73,17 @@ jobs: fetch-depth: 0 path: automation-scripts + - name: Set up Git for commit + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Switch to the PR source branch + run: | + cd automation-scripts + git checkout "${{ github.head_ref }}" + cd - + - name: Document meta.yaml file run: | echo "Documenting ${{ matrix.modified_metas.file }}" From 9c3e29db87000879cc93bd87f9b0753943133616 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:28:42 +0100 Subject: [PATCH 22/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 07ac99472..0201115c5 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -71,18 +71,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.head_ref }} path: automation-scripts - name: Set up Git for commit run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Switch to the PR source branch - run: | - cd automation-scripts - git checkout "${{ github.head_ref }}" - cd - - name: Document meta.yaml file run: | @@ -98,7 +93,7 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" # Commit changes git commit -m '[Automated Commit] Document ${{ matrix.modified_metas.file}} [skip ci]' - git push + git push origin HEAD:${{ github.head_ref }} From 7e80ef5bd8b4e851b39aee57e46b01bcbfce486f Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:30:56 +0100 Subject: [PATCH 23/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index 0201115c5..d4dc8fd19 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -71,7 +71,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.head_ref }} path: automation-scripts - name: Set up Git for commit From c5f11d252c01c7300af492618f6693e5203a31e2 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:33:07 +0100 Subject: [PATCH 24/26] Update run-tests-on-modified-meta.yml --- .github/workflows/run-tests-on-modified-meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index d4dc8fd19..a644537cd 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -92,7 +92,7 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" # Commit changes git commit -m '[Automated Commit] Document ${{ matrix.modified_metas.file}} [skip ci]' - git push origin HEAD:${{ github.head_ref }} + git push origin HEAD:${{ github.event.pull_request.head.ref }} From a098b9300069852c0ac197fce4ffa7882676cd27 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:43:15 +0100 Subject: [PATCH 25/26] Create document-scripts.yml --- .github/workflows/document-scripts.yml | 80 ++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/document-scripts.yml diff --git a/.github/workflows/document-scripts.yml b/.github/workflows/document-scripts.yml new file mode 100644 index 000000000..0024f284a --- /dev/null +++ b/.github/workflows/document-scripts.yml @@ -0,0 +1,80 @@ +# This workflow will automatically update the README for any updated MLC script +name: Document script on modified meta + +on: + push: + branches: [ "dev" ] + paths: + - 'script/**meta.yaml' + +jobs: + get_modified_files: + runs-on: ubuntu-latest + outputs: + processed_files: ${{ steps.modified-files.outputs.processed_files }} + + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pip install pyyaml + + - name: Get changed files + id: modified-files + env: + filter: ${{ github.event.before }} + run: | + changed_files=$(git diff --name-only $filter | grep -E '.*\.yaml$') + echo "$changed_files" | python3 .github/scripts/list_modified_files.py + + document_modified_scripts: + runs-on: ubuntu-latest + needs: get_modified_files + if: ${{ needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' }} + permissions: + contents: write + + strategy: + fail-fast: false + matrix: + modified_metas: ${{ fromJSON(needs.get_modified_files.outputs.processed_files).modified_metas }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + path: automation-scripts + + - name: Set up Git for commit + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Document meta.yaml file + run: | + echo "Documenting ${{ matrix.modified_metas.file }}" + + pip install mlcflow + mlc add repo automation-scripts + mlc doc script ${{ matrix.modified_metas.uid}} --quiet + cd automation-scripts + find . -type f -name README.md -exec git add {} + + # Use the GitHub actor's name and email + git config --global user.name github-actions[bot] + git config --global user.email "github-actions[bot]@users.noreply.github.com" + # Commit changes + git commit -m '[Automated Commit] Document ${{ matrix.modified_metas.file}} [skip ci]' + git push + + + From 3656e7886348cbed300c2d180bac2470898a87ff Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 25 Jun 2025 15:43:35 +0100 Subject: [PATCH 26/26] Update run-tests-on-modified-meta.yml --- .../workflows/run-tests-on-modified-meta.yml | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/.github/workflows/run-tests-on-modified-meta.yml b/.github/workflows/run-tests-on-modified-meta.yml index a644537cd..61f50f293 100644 --- a/.github/workflows/run-tests-on-modified-meta.yml +++ b/.github/workflows/run-tests-on-modified-meta.yml @@ -53,46 +53,3 @@ jobs: pip install mlcflow mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} mlc test script ${{ matrix.file_info.uid}} --test_input_index=${{ matrix.file_info.num_run }} --docker_mlc_repo=${{ github.event.pull_request.head.repo.html_url }} --docker_mlc_repo_branch=${{ github.event.pull_request.head.ref }} --quiet - - document_modified_scripts: - runs-on: ubuntu-latest - needs: get_modified_files - if: ${{ needs.get_modified_files.outputs.processed_files != '[]' && needs.get_modified_files.outputs.processed_files != '' && github.event.pull_request.base.ref == 'dev' }} - permissions: - contents: write - - strategy: - fail-fast: false - matrix: - modified_metas: ${{ fromJSON(needs.get_modified_files.outputs.processed_files).modified_metas }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: automation-scripts - - - name: Set up Git for commit - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Document meta.yaml file - run: | - echo "Documenting ${{ matrix.modified_metas.file }}" - - pip install mlcflow - mlc add repo automation-scripts - mlc doc script ${{ matrix.modified_metas.uid}} --quiet - cd automation-scripts - find . -type f -name README.md -exec git add {} + - # Use the GitHub actor's name and email - git config --global user.name github-actions[bot] - git config --global user.email "github-actions[bot]@users.noreply.github.com" - # Commit changes - git commit -m '[Automated Commit] Document ${{ matrix.modified_metas.file}} [skip ci]' - git push origin HEAD:${{ github.event.pull_request.head.ref }} - - -