forked from pytorch/executorch
-
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.
- Loading branch information
Showing
456 changed files
with
848,489 additions
and
3,650 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
c8a648d4dffb9f0133ff4a2ea0e660b42105d3ad | ||
19eff28ff3f19b50da46f5a9ff5f4d4d213806fe |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -57,6 +57,7 @@ COPY ./common/utils.sh utils.sh | |
RUN bash ./install_cache.sh && rm install_cache.sh utils.sh | ||
ENV SCCACHE_BUCKET ossci-compiler-cache-circleci-v2 | ||
ENV SCCACHE_S3_KEY_PREFIX executorch | ||
ENV SCCACHE_REGION us-east-1 | ||
|
||
ARG TORCH_VERSION | ||
COPY ./common/install_pytorch.sh install_pytorch.sh | ||
|
@@ -82,5 +83,7 @@ COPY --chown=ci-user:ci-user ./arm /opt/arm | |
# Set up ARM SDK if needed | ||
RUN if [ -n "${ARM_SDK}" ]; then git config --global user.email "[email protected]"; git config --global user.name "OSS CI"; bash /opt/arm/setup.sh --i-agree-to-the-contained-eula /opt/arm-sdk; chown -R ci-user:ci-user /opt/arm-sdk; fi | ||
|
||
ARG QNN_SDK | ||
|
||
USER ci-user | ||
CMD ["bash"] |
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,62 @@ | ||
#!/usr/bin/env python3 | ||
"""Check whether a PR has required labels.""" | ||
|
||
import sys | ||
from typing import Any | ||
|
||
from github_utils import gh_delete_comment, gh_post_pr_comment | ||
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo | ||
from label_utils import has_required_labels, is_label_err_comment, LABEL_ERR_MSG | ||
from trymerge import GitHubPR | ||
|
||
|
||
def delete_all_label_err_comments(pr: "GitHubPR") -> None: | ||
for comment in pr.get_comments(): | ||
if is_label_err_comment(comment): | ||
gh_delete_comment(pr.org, pr.project, comment.database_id) | ||
|
||
|
||
def add_label_err_comment(pr: "GitHubPR") -> None: | ||
# Only make a comment if one doesn't exist already | ||
if not any(is_label_err_comment(comment) for comment in pr.get_comments()): | ||
gh_post_pr_comment(pr.org, pr.project, pr.pr_num, LABEL_ERR_MSG) | ||
|
||
|
||
def parse_args() -> Any: | ||
from argparse import ArgumentParser | ||
|
||
parser = ArgumentParser("Check PR labels") | ||
parser.add_argument("pr_num", type=int) | ||
# add a flag to return a non-zero exit code if the PR does not have the required labels | ||
parser.add_argument( | ||
"--exit-non-zero", | ||
action="store_true", | ||
help="Return a non-zero exit code if the PR does not have the required labels", | ||
) | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def main() -> None: | ||
args = parse_args() | ||
repo = GitRepo(get_git_repo_dir(), get_git_remote_name()) | ||
org, project = repo.gh_owner_and_name() | ||
pr = GitHubPR(org, project, args.pr_num) | ||
|
||
try: | ||
if not has_required_labels(pr): | ||
print(LABEL_ERR_MSG, flush=True) | ||
add_label_err_comment(pr) | ||
if args.exit_non_zero: | ||
raise RuntimeError("PR does not have required labels") | ||
else: | ||
delete_all_label_err_comments(pr) | ||
except Exception as e: | ||
if args.exit_non_zero: | ||
raise RuntimeError(f"Error checking labels: {e}") from e | ||
|
||
sys.exit(0) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Oops, something went wrong.