diff --git a/.circleci/docker/common/install_katex.sh b/.circleci/docker/common/install_docs_reqs.sh similarity index 94% rename from .circleci/docker/common/install_katex.sh rename to .circleci/docker/common/install_docs_reqs.sh index 1024d517440417..1adc9e8009a021 100644 --- a/.circleci/docker/common/install_katex.sh +++ b/.circleci/docker/common/install_docs_reqs.sh @@ -17,6 +17,8 @@ if [ -n "$KATEX" ]; then apt-get install -y --no-install-recommends yarn yarn global add katex --prefix /usr/local + sudo apt-get -y install doxygen + apt-get autoclean && apt-get clean rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/.circleci/docker/ubuntu-cuda/Dockerfile b/.circleci/docker/ubuntu-cuda/Dockerfile index 241b91cff394d1..2ca2eb3030c6ae 100644 --- a/.circleci/docker/ubuntu-cuda/Dockerfile +++ b/.circleci/docker/ubuntu-cuda/Dockerfile @@ -20,8 +20,8 @@ RUN bash ./install_user.sh && rm install_user.sh # Install katex ARG KATEX -ADD ./common/install_katex.sh install_katex.sh -RUN bash ./install_katex.sh && rm install_katex.sh +ADD ./common/install_docs_reqs.sh install_docs_reqs.sh +RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh # Install conda and other packages (e.g., numpy, pytest) ENV PATH /opt/conda/bin:$PATH diff --git a/.circleci/docker/ubuntu/Dockerfile b/.circleci/docker/ubuntu/Dockerfile index d5940c7a1d55e3..b4aebe90881227 100644 --- a/.circleci/docker/ubuntu/Dockerfile +++ b/.circleci/docker/ubuntu/Dockerfile @@ -30,8 +30,8 @@ RUN bash ./install_user.sh && rm install_user.sh # Install katex ARG KATEX -ADD ./common/install_katex.sh install_katex.sh -RUN bash ./install_katex.sh && rm install_katex.sh +ADD ./common/install_docs_reqs.sh install_docs_reqs.sh +RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh # Install conda and other packages (e.g., numpy, pytest) ENV PATH /opt/conda/bin:$PATH diff --git a/.circleci/scripts/cpp_doc_push_script.sh b/.circleci/scripts/cpp_doc_push_script.sh index 1ade86b3126447..4c22677e94bd32 100755 --- a/.circleci/scripts/cpp_doc_push_script.sh +++ b/.circleci/scripts/cpp_doc_push_script.sh @@ -51,8 +51,6 @@ git clone https://github.com/pytorch/cppdocs set -ex -sudo apt-get -y install doxygen - # Generate ATen files pushd "${pt_checkout}" pip install -r requirements.txt diff --git a/.github/scripts/tryrebase.py b/.github/scripts/tryrebase.py index ea390b3b792b9b..2aa17c57ac8fc3 100755 --- a/.github/scripts/tryrebase.py +++ b/.github/scripts/tryrebase.py @@ -13,13 +13,17 @@ def parse_args() -> Any: from argparse import ArgumentParser parser = ArgumentParser("Rebase PR into branch") parser.add_argument("--dry-run", action="store_true") + parser.add_argument("--stable", action ="store_true") parser.add_argument("pr_num", type=int) return parser.parse_args() -def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None: +def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None: branch = f"pull/{pr.pr_num}/head" - onto_branch = pr.default_branch() + if stable: + onto_branch = "viable/strict" + else: + onto_branch = pr.default_branch() remote_url = f"https://github.com/{pr.info['headRepository']['nameWithOwner']}.git" refspec = f"{branch}:{pr.head_ref()}" @@ -39,11 +43,14 @@ def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None: "git pull --rebase`)", dry_run=dry_run) -def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None: +def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None: if subprocess.run([sys.executable, "-m", "ghstack", "--help"], capture_output=True).returncode != 0: subprocess.run([sys.executable, "-m", "pip", "install", "ghstack"]) orig_ref = f"{re.sub(r'/head$', '/orig', pr.head_ref())}" - onto_branch = pr.default_branch() + if stable: + onto_branch = "viable/strict" + else: + onto_branch = pr.default_branch() repo.fetch(orig_ref, orig_ref) repo._run_git("rebase", onto_branch, orig_ref) @@ -102,9 +109,9 @@ def main() -> None: try: if pr.is_ghstack_pr(): - rebase_ghstack_onto(pr, repo, dry_run=args.dry_run) + rebase_ghstack_onto(pr, repo, dry_run=args.dry_run, stable=args.stable) return - rebase_onto(pr, repo, dry_run=args.dry_run) + rebase_onto(pr, repo, dry_run=args.dry_run, stable=args.stable) except Exception as e: msg = f"Rebase failed due to {e}" run_url = os.getenv("GH_RUN_URL") diff --git a/.github/workflows/tryrebase.yml b/.github/workflows/tryrebase.yml index d45018c1ad6ddc..93f75bc3579133 100644 --- a/.github/workflows/tryrebase.yml +++ b/.github/workflows/tryrebase.yml @@ -30,5 +30,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }} PR_NUM: ${{ github.event.client_payload.pr_num }} GH_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + STABLE: ${{ github.event.client_payload.stable}} run: | - python3 .github/scripts/tryrebase.py "${PR_NUM}" + set -ex + if [ -n "${STABLE}" ]; then + python3 .github/scripts/tryrebase.py --stable "${PR_NUM}" + else + python3 .github/scripts/tryrebase.py "${PR_NUM}" + fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45be7d2e6dc6b3..d96c623948361b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1314,4 +1314,4 @@ your PRs, but it will still be present for the select CircleCI jobs listed above. ## Dev Infra Office Hours -[Dev Infra Office Hours](https://github.com/pytorch/pytorch/wiki/Dev-Infra-Office-Hours) are hosted every Friday to answer any questions regarding developer experience, Green HUD, and CI. +[Dev Infra Office Hours](https://github.com/pytorch/pytorch/wiki/Dev-Infra-Office-Hours) are hosted every Friday to answer any further questions regarding developer experience, green HUD, and CI.