Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
8d0c08db
"vscode:/vscode.git/clone" did not exist on "108cf9fc1f8c6bc0360a49ce790699928883b3d3"
Unverified
Commit
8d0c08db
authored
Nov 13, 2020
by
Matti Picus
Committed by
GitHub
Nov 12, 2020
Browse files
[Doc] Build docs and push to branch in CI (#1006)
parent
0e1d814b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
181 additions
and
1 deletion
+181
-1
.circleci/build_docs/build_docs.sh
.circleci/build_docs/build_docs.sh
+13
-0
.circleci/build_docs/commit_docs.sh
.circleci/build_docs/commit_docs.sh
+33
-0
.circleci/build_docs/install_wheels.sh
.circleci/build_docs/install_wheels.sh
+9
-0
.circleci/config.yml
.circleci/config.yml
+56
-0
.circleci/config.yml.in
.circleci/config.yml.in
+40
-0
.circleci/regenerate.py
.circleci/regenerate.py
+30
-1
No files found.
.circleci/build_docs/build_docs.sh
0 → 100755
View file @
8d0c08db
#!/usr/bin/env bash
set
-ex
source
./packaging/pkg_helpers.bash
export
NO_CUDA_PACKAGE
=
1
setup_env 0.8.0
setup_wheel_python
pushd
docs
pip
install
-r
requirements.txt
make html
popd
.circleci/build_docs/commit_docs.sh
0 → 100755
View file @
8d0c08db
#!/usr/bin/env bash
set
-ex
if
[
"
$2
"
==
""
]
;
then
echo
call as
$0
"<src>"
"<target branch>"
echo
where src is the built documentation and
echo
branch should be
"master"
or
"1.7"
or so
exit
1
fi
scr
=
$1
target
=
$2
set
-ex
echo
"committing docs from
${
stc
}
to
${
target
}
"
git checkout gh-pages
rm
-rf
docs/
$target
/
*
cp
-r
${
src
}
/build/html/
*
docs/
$target
if
[
$target
==
"master"
]
;
then
rm
-rf
docs/_static/
*
cp
-r
${
src
}
/build/html/_static/
*
docs/_static
fi
git add docs
||
true
git config user.email
"soumith+bot@pytorch.org"
git config user.name
"pytorchbot"
# If there aren't changes, don't make a commit; push is no-op
git commit
-m
"auto-generating sphinx docs"
||
true
git push
-u
origin gh-pages
.circleci/build_docs/install_wheels.sh
0 → 100755
View file @
8d0c08db
set
-ex
source
./packaging/pkg_helpers.bash
export
NO_CUDA_PACKAGE
=
1
setup_env 0.8.0
setup_wheel_python
setup_pip_pytorch_version
# pytorch is already installed
pip
install
--no-deps
~/workspace/torchaudio
*
.circleci/config.yml
View file @
8d0c08db
...
...
@@ -654,6 +654,46 @@ jobs:
command
:
|
.circleci/torchscript_bc_test/setup_master_envs.sh
.circleci/torchscript_bc_test/validate_objects.sh
build_docs
:
<<
:
*binary_common
docker
:
-
image
:
"
pytorch/manylinux-cuda100"
resource_class
:
2xlarge+
steps
:
-
attach_workspace
:
at
:
~/workspace
-
designate_upload_channel
-
checkout
-
run
:
name
:
Install pytorch-audio
command
:
.circleci/build_docs/install_wheels.sh
-
run
:
name
:
Build docs
command
:
.circleci/build_docs/build_docs.sh
-
persist_to_workspace
:
root
:
docs
paths
:
-
"
*"
upload_docs
:
<<
:
*binary_common
docker
:
-
image
:
"
pytorch/manylinux-cuda100"
resource_class
:
2xlarge+
steps
:
-
attach_workspace
:
at
:
~/workspace
-
designate_upload_channel
-
checkout
-
run
:
name
:
Upload docs
command
:
|
set -ex
echo $PWD
ls ~/workspace
tag=${CIRCLE_TAG:1:5}
target=${tag:-master}
.circleci/build_docs/commit_docs.sh ~/workspace $target
workflows
:
build
:
...
...
@@ -739,6 +779,22 @@ workflows:
-
binary_windows_conda
:
name
:
binary_windows_conda_py3.8
python_version
:
'
3.8'
-
build_docs
:
name
:
build_docs
python_version
:
'
3.8'
requires
:
-
binary_linux_wheel_py3.8
-
upload_docs
:
filters
:
branches
:
only
:
-
nightly
tags
:
only
:
/v[0-9]+(\.[0-9]+)*-rc[0-9]+/
name
:
upload_docs
python_version
:
'
3.8'
requires
:
-
build_docs
unittest
:
jobs
:
-
torchscript_bc_test
:
...
...
.circleci/config.yml.in
View file @
8d0c08db
...
...
@@ -654,6 +654,46 @@ jobs:
command: |
.circleci/torchscript_bc_test/setup_master_envs.sh
.circleci/torchscript_bc_test/validate_objects.sh
build_docs:
<<: *binary_common
docker:
- image: "pytorch/manylinux-cuda100"
resource_class: 2xlarge+
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- checkout
- run:
name: Install pytorch-audio
command: .circleci/build_docs/install_wheels.sh
- run:
name: Build docs
command: .circleci/build_docs/build_docs.sh
- persist_to_workspace:
root: docs
paths:
- "*"
upload_docs:
<<: *binary_common
docker:
- image: "pytorch/manylinux-cuda100"
resource_class: 2xlarge+
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- checkout
- run:
name: Upload docs
command: |
set -ex
echo $PWD
ls ~/workspace
tag=${CIRCLE_TAG:1:5}
target=${tag:-master}
.circleci/build_docs/commit_docs.sh ~/workspace $target
workflows:
build:
...
...
.circleci/regenerate.py
View file @
8d0c08db
...
...
@@ -21,6 +21,8 @@ import os.path
PYTHON_VERSIONS
=
[
"3.6"
,
"3.7"
,
"3.8"
]
DOC_VERSION
=
(
'linux'
,
'3.8'
)
def
build_workflows
(
prefix
=
''
,
upload
=
False
,
filter_branch
=
None
,
indentation
=
6
):
w
=
[]
...
...
@@ -30,6 +32,11 @@ def build_workflows(prefix='', upload=False, filter_branch=None, indentation=6):
for
python_version
in
PYTHON_VERSIONS
:
w
+=
build_workflow_pair
(
btype
,
os_type
,
python_version
,
filter_branch
,
prefix
,
upload
)
if
not
filter_branch
:
# Build on every pull request, but upload only on nightly and tags
w
+=
build_doc_job
(
None
)
w
+=
upload_doc_job
(
'nightly'
)
return
indent
(
indentation
,
w
)
...
...
@@ -67,6 +74,28 @@ def build_workflow_pair(btype, os_type, python_version, filter_branch, prefix=''
return
w
def
build_doc_job
(
filter_branch
):
job
=
{
"name"
:
"build_docs"
,
"python_version"
:
"3.8"
,
"requires"
:
[
"binary_linux_wheel_py3.8"
,],
}
if
filter_branch
:
job
[
"filters"
]
=
gen_filter_branch_tree
(
filter_branch
)
return
[{
"build_docs"
:
job
}]
def
upload_doc_job
(
filter_branch
):
job
=
{
"name"
:
"upload_docs"
,
"python_version"
:
"3.8"
,
"requires"
:
[
"build_docs"
,],
}
if
filter_branch
:
job
[
"filters"
]
=
gen_filter_branch_tree
(
filter_branch
)
return
[{
"upload_docs"
:
job
}]
def
generate_base_workflow
(
base_workflow_name
,
python_version
,
filter_branch
,
os_type
,
btype
):
...
...
@@ -81,7 +110,7 @@ def generate_base_workflow(base_workflow_name, python_version, filter_branch, os
if
filter_branch
:
d
[
"filters"
]
=
gen_filter_branch_tree
(
filter_branch
)
return
{
"binary_{os_type}_{btype}"
.
format
(
os_type
=
os_type
,
btype
=
btype
)
:
d
}
return
{
f
"binary_
{
os_type
}
_
{
btype
}
"
:
d
}
def
gen_filter_branch_tree
(
*
branches
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment