Skip to content

Commit

Permalink
update CI and docs to use main branch (pytorch#139)
Browse files Browse the repository at this point in the history
Summary:
The main branch was renamed to main. This updates CI references to point to the new head.

Docs have been manually fixed to point master to main.

Pull Request resolved: pytorch#139

Test Plan:
```
scripts/lint.sh
docs/docs_push.sh
```

Reviewed By: kiukchung

Differential Revision: D30351629

Pulled By: d4l3k

fbshipit-source-id: 4a9bcd97626aaf67d8da78bd61b0081a078a1c88
  • Loading branch information
d4l3k authored and facebook-github-bot committed Aug 16, 2021
1 parent 016cd89 commit 877eb6e
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 32 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Publish Docker Containers
on:
push:
branches:
- master
- torchxcontainer
- main

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docs Build
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
docpush:
runs-on: ubuntu-18.04
needs: docbuild
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Setup Python
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kfp-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: KFP Integration Tests
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kubernetes-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Kubernetes Integration Tests
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pyre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pyre
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python Unittests
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slurm-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Slurm Integration Tests
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ possible.
## Pull Requests
We actively welcome your pull requests.

1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
Expand Down
16 changes: 8 additions & 8 deletions docs/doc_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#
# 1. sphinx generated docs are copied to <repo-root>/<version>
# 2. if a release tag is found on HEAD then redirects are copied to <repo-root>/latest
# 3. if no release tag is found on HEAD then redirects are copied to <repo-root>/master
# 3. if no release tag is found on HEAD then redirects are copied to <repo-root>/main
#
# gh-pages branch should look as follows:
# <repo-root>
# |- 0.1.0rc2
# |- 0.1.0rc3
# |- <versions...>
# |- master (redirects to the most recent ver in trunk, including release)
# |- main (redirects to the most recent ver in trunk, including release)
# |- latest (redirects to the most recent release)
# If the most recent release is 0.1.0 and master is at 0.1.1rc1 then,
# https://pytorch.org/torchx/master -> https://pytorch.org/torchx/0.1.1rc1
# If the most recent release is 0.1.0 and main is at 0.1.1rc1 then,
# https://pytorch.org/torchx/main -> https://pytorch.org/torchx/0.1.1rc1
# https://pytorch.org/torchx/latest -> https://pytorch.org/torchx/0.1.0
#
# Redirects are done via Jekyll redirect-from plugin. See:
Expand All @@ -46,12 +46,12 @@ branch=$(git rev-parse --abbrev-ref HEAD)
commit_id=$(git rev-parse --short HEAD)

if ! release_tag=$(git describe --tags --exact-match HEAD 2>/dev/null); then
echo "No release tag found, building docs for master..."
redirects=(master)
release_tag="master"
echo "No release tag found, building docs for main..."
redirects=(main)
release_tag="main"
else
echo "Release tag $release_tag found, building docs for release..."
redirects=(latest master)
redirects=(latest main)
fi

echo "Installing torchx from $repo_root..."
Expand Down
6 changes: 3 additions & 3 deletions docs/papermill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ WORK_DIR=/tmp/papermill
set -ex
mkdir -p "$WORK_DIR"

# create empty master.tar.gz file and setup symlinks instead of pulling from
# master so we can handle local changes
tar -cJf "$WORK_DIR/master.tar.gz" -T /dev/null
# create empty main.tar.gz file and setup symlinks instead of pulling from
# main so we can handle local changes
tar -cJf "$WORK_DIR/main.tar.gz" -T /dev/null
ROOT="$(pwd)/.."
(cd "$WORK_DIR" && ln -s "$ROOT/torchx" . && ln -s "$ROOT/examples" .)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/js/torchx.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (downloadNote.length >= 1) {

var version = $(".version").text().trim().split(" ")[0].substr(1);

var githubLink = "https://github.com/pytorch/torchx/blob/master/examples/" + tutorialUrlArray.join("/") + ".py",
var githubLink = "https://github.com/pytorch/torchx/blob/main/examples/" + tutorialUrlArray.join("/") + ".py",
notebookLink = $(".reference.download")[1].href,
notebookDownloadPath = notebookLink.split('_downloads')[1],
colabLink = "https://colab.research.google.com/github/pytorch/torchx/blob/gh-pages/" + version + "/_downloads" + notebookDownloadPath;
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
version = f"v{torchx.__version__}"
# The full version, including alpha/beta/rc tags.
# TODO: verify this works as expected
release = "master"
release = "main"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -308,8 +308,8 @@ def handle_item(fieldarg, content):
f"https://github.com/pytorch/torchx/archive/refs/tags/{notebook_version}.tar.gz"
)
else:
notebook_version = "master"
code_url = "https://github.com/pytorch/torchx/archive/refs/heads/master.tar.gz"
notebook_version = "main"
code_url = f"https://github.com/pytorch/torchx/archive/refs/heads/{notebook_version}.tar.gz"

first_notebook_cell = f"""
!pip install torchx[kfp]
Expand Down
10 changes: 5 additions & 5 deletions docs/versions_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="master/_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="main/_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" type="text/css" />
<link rel="stylesheet" href="master/_static/css/pytorch_theme.css" type="text/css" />
<script src="master/_static/js/modernizr.min.js"></script>
<link rel="stylesheet" href="main/_static/css/pytorch_theme.css" type="text/css" />
<script src="main/_static/js/modernizr.min.js"></script>
</head>
Expand Down Expand Up @@ -65,14 +65,14 @@
# fmt: on

TAGS = {
"master": "(unstable)",
"main": "(unstable)",
"latest": "(pre-release)",
"stable": "(stable release)",
}

# map tags to faux versions for sorting
TAGS_VER_PROXY = {
"master": Version("0.0.0.dev2"),
"main": Version("0.0.0.dev2"),
"latest": Version("0.0.0.dev1"),
"stable": Version("0.0.0.dev0"),
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi

git fetch upstream

CHANGED_FILES="$(git diff --diff-filter=ACMRT --name-only upstream/master | grep '\.py$' | tr '\n' ' ')"
CHANGED_FILES="$(git diff --diff-filter=ACMRT --name-only upstream/main | grep '\.py$' | tr '\n' ' ')"

if [ "$CHANGED_FILES" != "" ]
then
Expand Down

0 comments on commit 877eb6e

Please sign in to comment.