diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 36604bdb..59f59012 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -21,7 +21,7 @@ jobs: path-to-signatures: 'cla-bot/v1/cla.json' # branch should not be protected branch: 'main' - allowlist: user1,bot*,actions-user* + allowlist: user1,bot* remote-organization-name: mlcommons remote-repository-name: systems diff --git a/.github/workflows/version_and_release.yml b/.github/workflows/version_and_release.yml index 0c59c6c5..e69de29b 100644 --- a/.github/workflows/version_and_release.yml +++ b/.github/workflows/version_and_release.yml @@ -1,61 +0,0 @@ -name: Update version and publish release -on: - push: - branches: - - main -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Set Up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Install protolock - run: | - go install github.com/nilslice/protolock/cmd/protolock@latest - protolock - - name: Check broken compatibility and update version - run: | - python3 version.py - echo "RELEASE_TAG=$(cat VERSION)" >> $GITHUB_ENV - - name: Commit changes - uses: EndBug/add-and-commit@v9 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - author_name: GitHub Actions - author_email: actions@github.com - message: Release ${{ env.RELEASE_TAG }} - add: "['VERSION', 'proto.lock']" - push: "-o ci.skip" - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: Release ${{ env.RELEASE_TAG }} - body: | - Release ${{ env.RELEASE_TAG }} - draft: false - prerelease: false - - name: Build wheel - run: | - pip install --upgrade build - python3 -m build - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/chakra-${{ env.RELEASE_TAG }}-py3-none-any.whl - asset_name: chakra.whl - asset_content_type: application/whl \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0577335c..eb9278c8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ __pycache__/ *.egg *.et *.dot -.pyre \ No newline at end of file +.pyre diff --git a/VERSION b/VERSION index 60a2d3e9..e69de29b 100644 --- a/VERSION +++ b/VERSION @@ -1 +0,0 @@ -0.4.0 \ No newline at end of file diff --git a/proto.lock b/proto.lock index 4fc746f3..e69de29b 100644 --- a/proto.lock +++ b/proto.lock @@ -1,585 +0,0 @@ -{ - "definitions": [ - { - "protopath": "et_def:/:et_def.proto", - "def": { - "enums": [ - { - "name": "NodeType", - "enum_fields": [ - { - "name": "INVALID_NODE" - }, - { - "name": "METADATA_NODE", - "integer": 1 - }, - { - "name": "MEM_LOAD_NODE", - "integer": 2 - }, - { - "name": "MEM_STORE_NODE", - "integer": 3 - }, - { - "name": "COMP_NODE", - "integer": 4 - }, - { - "name": "COMM_SEND_NODE", - "integer": 5 - }, - { - "name": "COMM_RECV_NODE", - "integer": 6 - }, - { - "name": "COMM_COLL_NODE", - "integer": 7 - } - ] - }, - { - "name": "CollectiveCommType", - "enum_fields": [ - { - "name": "ALL_REDUCE" - }, - { - "name": "REDUCE", - "integer": 1 - }, - { - "name": "ALL_GATHER", - "integer": 2 - }, - { - "name": "GATHER", - "integer": 3 - }, - { - "name": "SCATTER", - "integer": 4 - }, - { - "name": "BROADCAST", - "integer": 5 - }, - { - "name": "ALL_TO_ALL", - "integer": 6 - }, - { - "name": "REDUCE_SCATTER", - "integer": 7 - }, - { - "name": "REDUCE_SCATTER_BLOCK", - "integer": 8 - }, - { - "name": "BARRIER", - "integer": 9 - } - ] - } - ], - "messages": [ - { - "name": "AttributeProto", - "fields": [ - { - "id": 1, - "name": "name", - "type": "string" - }, - { - "id": 2, - "name": "doc_string", - "type": "string" - }, - { - "id": 3, - "name": "double_val", - "type": "double", - "oneof_parent": "value" - }, - { - "id": 4, - "name": "double_list", - "type": "DoubleList", - "oneof_parent": "value" - }, - { - "id": 5, - "name": "float_val", - "type": "float", - "oneof_parent": "value" - }, - { - "id": 6, - "name": "float_list", - "type": "FloatList", - "oneof_parent": "value" - }, - { - "id": 7, - "name": "int32_val", - "type": "int32", - "oneof_parent": "value" - }, - { - "id": 8, - "name": "int32_list", - "type": "Int32List", - "oneof_parent": "value" - }, - { - "id": 9, - "name": "int64_val", - "type": "int64", - "oneof_parent": "value" - }, - { - "id": 10, - "name": "int64_list", - "type": "Int64List", - "oneof_parent": "value" - }, - { - "id": 11, - "name": "uint32_val", - "type": "uint32", - "oneof_parent": "value" - }, - { - "id": 12, - "name": "uint32_list", - "type": "Uint32List", - "oneof_parent": "value" - }, - { - "id": 13, - "name": "uint64_val", - "type": "uint64", - "oneof_parent": "value" - }, - { - "id": 14, - "name": "uint64_list", - "type": "Uint64List", - "oneof_parent": "value" - }, - { - "id": 15, - "name": "sint32_val", - "type": "sint32", - "oneof_parent": "value" - }, - { - "id": 16, - "name": "sint32_list", - "type": "Sint32List", - "oneof_parent": "value" - }, - { - "id": 17, - "name": "sint64_val", - "type": "sint64", - "oneof_parent": "value" - }, - { - "id": 18, - "name": "sint64_list", - "type": "Sint64List", - "oneof_parent": "value" - }, - { - "id": 19, - "name": "fixed32_val", - "type": "fixed32", - "oneof_parent": "value" - }, - { - "id": 20, - "name": "fixed32_list", - "type": "Fixed32List", - "oneof_parent": "value" - }, - { - "id": 21, - "name": "fixed64_val", - "type": "fixed64", - "oneof_parent": "value" - }, - { - "id": 22, - "name": "fixed64_list", - "type": "Fixed64List", - "oneof_parent": "value" - }, - { - "id": 23, - "name": "sfixed32_val", - "type": "sfixed32", - "oneof_parent": "value" - }, - { - "id": 24, - "name": "sfixed32_list", - "type": "Sfixed32List", - "oneof_parent": "value" - }, - { - "id": 25, - "name": "sfixed64_val", - "type": "sfixed64", - "oneof_parent": "value" - }, - { - "id": 26, - "name": "sfixed64_list", - "type": "Sfixed64List", - "oneof_parent": "value" - }, - { - "id": 27, - "name": "bool_val", - "type": "bool", - "oneof_parent": "value" - }, - { - "id": 28, - "name": "bool_list", - "type": "BoolList", - "oneof_parent": "value" - }, - { - "id": 29, - "name": "string_val", - "type": "string", - "oneof_parent": "value" - }, - { - "id": 30, - "name": "string_list", - "type": "StringList", - "oneof_parent": "value" - }, - { - "id": 31, - "name": "bytes_val", - "type": "bytes", - "oneof_parent": "value" - }, - { - "id": 32, - "name": "bytes_list", - "type": "BytesList", - "oneof_parent": "value" - } - ] - }, - { - "name": "DoubleList", - "fields": [ - { - "id": 1, - "name": "values", - "type": "double", - "is_repeated": true - } - ] - }, - { - "name": "FloatList", - "fields": [ - { - "id": 1, - "name": "values", - "type": "float", - "is_repeated": true - } - ] - }, - { - "name": "Int32List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "int32", - "is_repeated": true - } - ] - }, - { - "name": "Int64List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "int64", - "is_repeated": true - } - ] - }, - { - "name": "Uint32List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "uint32", - "is_repeated": true - } - ] - }, - { - "name": "Uint64List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "uint64", - "is_repeated": true - } - ] - }, - { - "name": "Sint32List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "sint32", - "is_repeated": true - } - ] - }, - { - "name": "Sint64List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "sint64", - "is_repeated": true - } - ] - }, - { - "name": "Fixed32List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "fixed32", - "is_repeated": true - } - ] - }, - { - "name": "Fixed64List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "fixed64", - "is_repeated": true - } - ] - }, - { - "name": "Sfixed32List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "sfixed32", - "is_repeated": true - } - ] - }, - { - "name": "Sfixed64List", - "fields": [ - { - "id": 1, - "name": "values", - "type": "sfixed64", - "is_repeated": true - } - ] - }, - { - "name": "BoolList", - "fields": [ - { - "id": 1, - "name": "values", - "type": "bool", - "is_repeated": true - } - ] - }, - { - "name": "StringList", - "fields": [ - { - "id": 1, - "name": "values", - "type": "string", - "is_repeated": true - } - ] - }, - { - "name": "BytesList", - "fields": [ - { - "id": 1, - "name": "values", - "type": "bytes", - "is_repeated": true - } - ] - }, - { - "name": "GlobalMetadata", - "fields": [ - { - "id": 1, - "name": "version", - "type": "string" - }, - { - "id": 2, - "name": "attr", - "type": "AttributeProto", - "is_repeated": true - } - ] - }, - { - "name": "Node", - "fields": [ - { - "id": 1, - "name": "id", - "type": "uint64" - }, - { - "id": 2, - "name": "name", - "type": "string" - }, - { - "id": 3, - "name": "type", - "type": "NodeType" - }, - { - "id": 4, - "name": "ctrl_deps", - "type": "uint64", - "is_repeated": true - }, - { - "id": 5, - "name": "data_deps", - "type": "uint64", - "is_repeated": true - }, - { - "id": 6, - "name": "start_time_micros", - "type": "uint64" - }, - { - "id": 7, - "name": "duration_micros", - "type": "uint64" - }, - { - "id": 8, - "name": "inputs", - "type": "IOInfo" - }, - { - "id": 9, - "name": "outputs", - "type": "IOInfo" - }, - { - "id": 10, - "name": "attr", - "type": "AttributeProto", - "is_repeated": true - } - ] - }, - { - "name": "IOInfo", - "fields": [ - { - "id": 1, - "name": "values", - "type": "string" - }, - { - "id": 2, - "name": "shapes", - "type": "string" - }, - { - "id": 3, - "name": "types", - "type": "string" - } - ] - }, - { - "name": "Tensor", - "fields": [ - { - "id": 1, - "name": "tensor_id", - "type": "uint64" - }, - { - "id": 2, - "name": "storage_id", - "type": "uint64" - }, - { - "id": 3, - "name": "offset", - "type": "uint64" - }, - { - "id": 4, - "name": "num_elem", - "type": "uint64" - }, - { - "id": 5, - "name": "elem_bytes", - "type": "uint64" - }, - { - "id": 6, - "name": "device", - "type": "string" - } - ] - } - ], - "package": { - "name": "ChakraProtoMsg" - } - } - } - ] -} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 71068d60..2b879726 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "chakra" requires-python = ">=3.7" -dynamic = ["version"] +version = "0.0.4" readme = "README.md" license = {file = "LICENSE.md"} authors = [ @@ -63,6 +63,3 @@ exclude = [ ] reportMissingImports = false reportAttributeAccessIssue = false - -[tool.setuptools.dynamic] -version = {file = ["VERSION"]} \ No newline at end of file diff --git a/version.py b/version.py index 33adc081..e69de29b 100644 --- a/version.py +++ b/version.py @@ -1,111 +0,0 @@ -"""Build utilities""" - -import argparse -import os -import os.path -import subprocess -from typing import List - - -def main(args: List[str] = None): # type: ignore - """Build utilities - args: - --version-change: piece to change in semantic version number - --build-file: the builder number filename which should cotain an single int - that will be inremented by this utility - """ - parser = argparse.ArgumentParser( - prog="build", - description="Build Utilities", - epilog="Required", - ) - parser.add_help = True - parser.add_argument( - "--version-change", - type=str, - choices=["major", "minor", "patch"], - required=False, - help=""" - --version-change == major - Major version X (X.y.z | X > 0) MUST be incremented if any backward incompatible changes - are introduced to the public API. - It MAY also include minor and patch level changes. - Patch and minor versions MUST be reset to 0 when major version is incremented. - --version-change == minor - Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backward compatible functionality - is introduced to the public API. - It MUST be incremented if any public API functionality is marked as deprecated. - It MAY be incremented if substantial new functionality or improvements are introduced - within the private code. - It MAY include patch level changes. - Patch version MUST be reset to 0 when minor version is incremented. - --version-change == patch - Patch version Z (x.y.Z | x > 0) MUST be incremented if only backward compatible bug fixes are introduced. - A bug fix is defined as an internal change that fixes incorrect behavior. - """, - ) - parser.add_argument( - "--package", - type=str, - required=False, - default=None, - help="""Name of the package that will form part of the pre-release tag. - If not supplied then no pre-release tag will be appended to the artifact. - If supplied then a build number will also be added to the end of the - pre-release tag""", - ) - parser.add_argument( - "--build", - type=str, - required=False, - default=None, - help="""Name of the file that contains the existing build number. - If it does not exist a new one will be created with the build number starting at 1.""", - ) - - args = parser.parse_args(args) if args is not None else parser.parse_args() # type: ignore - - if os.path.exists("VERSION") is True: - with open("VERSION", "rt", encoding="ascii") as fp: - version_number = fp.read() - else: - version_number = "0.0.1" - try: - major, minor, patch = version_number.split(".") - except Exception: - major, minor, patch = "0.0.1".split(".") - major = int(major) - minor = int(minor) - patch = int(patch) - original_version_number = f"{major}.{minor}.{patch}" - print(f"args.version_change: {args.version_change}") - if args.version_change == "major": - major += 1 - minor = 0 - patch = 0 - elif args.version_change == "minor": - minor += 1 - patch = 0 - elif args.version_change == "patch": - patch += 1 - new_version_number = f"{major}.{minor}.{patch}" - print(f"current version:{original_version_number} change:{args.version_change} next version:{new_version_number}") - if original_version_number != new_version_number: - with open("VERSION", "w", encoding="ascii") as fp: - fp.write(new_version_number) - - -if __name__ == "__main__": - protolock_status = subprocess.run(["protolock", "status", "--strict"], stdout=subprocess.PIPE).stdout.decode( - "utf-8" - ) - version_change = "patch" - if protolock_status != "": - version_change = "minor" - print("Backward compatibility is broken!!!") - print(protolock_status) - else: - version_change = "patch" - print("Backward compatibility not broken") - main(["--version-change=" + version_change]) - subprocess.run(["protolock", "commit", "--force"], stdout=subprocess.PIPE)