Skip to content

Commit eb28a5c

Browse files
author
Kiuk Chung
committed
fbshipit-source-id: ef660a2b23984d28bd9bbc3e906e003a85e9df8b
1 parent 054d9cc commit eb28a5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2551
-0
lines changed

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <[email protected]>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing to TorchX
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Our Development Process
6+
... (in particular how this is synced with internal changes to the project)
7+
8+
## Pull Requests
9+
We actively welcome your pull requests.
10+
11+
1. Fork the repo and create your branch from `master`.
12+
2. If you've added code that should be tested, add tests.
13+
3. If you've changed APIs, update the documentation.
14+
4. Ensure the test suite passes.
15+
5. Make sure your code lints (run `scripts/formatter_python.sh`).
16+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
17+
18+
## Contributor License Agreement ("CLA")
19+
In order to accept your pull request, we need you to submit a CLA. You only need
20+
to do this once to work on any of Facebook's open source projects.
21+
22+
Complete your CLA here: <https://code.facebook.com/cla>
23+
24+
## Issues
25+
We use GitHub issues to track public bugs. Please ensure your description is
26+
clear and has sufficient instructions to be able to reproduce the issue.
27+
28+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
29+
disclosure of security bugs. In those cases, please go through the process
30+
outlined on that page and do not file a public issue.
31+
32+
## License
33+
By contributing to TorchX, you agree that your contributions will be licensed
34+
under the LICENSE file in the root directory of this source tree.

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019-present, Facebook, Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)
2+
3+
# TorchX
4+
5+
6+
For the latest documentation, please refer to our [website](https://pytorch.org/torchx).
7+
8+
9+
## Requirements
10+
TorchX SDK (torchx):
11+
* python3 (3.8+)
12+
* torch
13+
14+
TorchX Kubeflow Pipelines Support (torchx-kfp):
15+
* torchx
16+
* kfp
17+
18+
## Installation
19+
```bash
20+
# install torchx sdk
21+
pip install torchx
22+
23+
# install torchx kubeflow pipelines (kfp) support
24+
pip intall torchx-kfp
25+
```
26+
27+
## Quickstart
28+
<TODO PLACEHOLDER>
29+
30+
## Contributing
31+
32+
We welcome PRs! See the [CONTRIBUTING](CONTRIBUTING.md) file.
33+
34+
## License
35+
TorchX is BSD licensed, as found in the [LICENSE](LICENSE) file.

docs/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
# Minimal makefile for Sphinx documentation
3+
# Usage:
4+
# make html
5+
#
6+
7+
# You can set these variables from the command line.
8+
SPHINXOPTS =
9+
SPHINXBUILD = sphinx-build
10+
SPHINXPROJ = torchx
11+
SOURCEDIR = source
12+
BUILDDIR = build
13+
VERSION := $(shell python -c "import torchx; print(torchx.__version__)")
14+
15+
# Put it first so that "make" without argument is like "make help".
16+
help:
17+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
19+
redirects:
20+
python source/scripts/create_redirect_md.py --source_dir "$(SOURCEDIR)" --build_dir "$(BUILDDIR)/redirects"
21+
22+
clean:
23+
@echo "Deleting build directory"
24+
rm -rf "$(BUILDDIR)"
25+
26+
.PHONY: help Makefile redirects clean
27+
28+
# Catch-all target: route all unknown targets to Sphinx using the new
29+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
30+
%: Makefile redirects
31+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)/$(VERSION)" $(SPHINXOPTS) $(O)

docs/doc_push.sh

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) Facebook, Inc. and its affiliates.
4+
# All rights reserved.
5+
#
6+
# This source code is licensed under the BSD-style license found in the
7+
# LICENSE file in the root directory of this source tree.
8+
9+
#
10+
# Builds docs from the checkedout HEAD
11+
# and pushes the artifacts to gh-pages branch in github.com/pytorch/torchx
12+
#
13+
# 1. sphinx generated docs are copied to <repo-root>/<version>
14+
# 2. if a release tag is found on HEAD then redirects are copied to <repo-root>/latest
15+
# 3. if no release tag is found on HEAD then redirects are copied to <repo-root>/master
16+
#
17+
# gh-pages branch should look as follows:
18+
# <repo-root>
19+
# |- 0.1.0rc2
20+
# |- 0.1.0rc3
21+
# |- <versions...>
22+
# |- master (redirects to the most recent ver in trunk, including release)
23+
# |- latest (redirects to the most recent release)
24+
# If the most recent release is 0.1.0 and master is at 0.1.1rc1 then,
25+
# https://pytorch.org/torchx/master -> https://pytorch.org/torchx/0.1.1rc1
26+
# https://pytorch.org/torchx/latest -> https://pytorch.org/torchx/0.1.0
27+
#
28+
# Redirects are done via Jekyll redirect-from plugin. See:
29+
# sources/scripts/create_redirect_md.py
30+
# Makefile (redirect target)
31+
# (on gh-pages branch) _layouts/docs_redirect.html
32+
33+
dry_run=0
34+
for arg in "$@"; do
35+
shift
36+
case "$arg" in
37+
"--dry-run") dry_run=1 ;;
38+
"--help") echo "Usage $0 [--dry-run]"; exit 0 ;;
39+
esac
40+
done
41+
42+
repo_root=$(git rev-parse --show-toplevel)
43+
branch=$(git rev-parse --abbrev-ref HEAD)
44+
commit_id=$(git rev-parse --short HEAD)
45+
46+
if ! release_tag=$(git describe --tags --exact-match HEAD 2>/dev/null); then
47+
echo "No release tag found, building docs for master..."
48+
redirects=(master)
49+
release_tag="master"
50+
else
51+
echo "Release tag $release_tag found, building docs for release..."
52+
redirects=(latest master)
53+
fi
54+
55+
echo "Installing torchx from $repo_root/torchx..."
56+
cd "$repo_root/torchx" || exit
57+
pip uninstall -y torchx
58+
python setup.py install
59+
60+
torchx_ver=$(python -c "import torchx; print(torchx.__version__)")
61+
62+
echo "Building torchx-$torchx_ver docs..."
63+
docs_dir=$repo_root/docs
64+
build_dir=$docs_dir/build
65+
cd "$docs_dir" || exit
66+
pip install -r requirements.txt
67+
make clean html
68+
echo "Doc build complete"
69+
70+
if [ $dry_run -eq 1 ]; then
71+
echo "*** dry-run mode, building only. See build artifacts in: $build_dir"
72+
exit
73+
fi
74+
75+
tmp_dir=/tmp/torchx_docs_tmp
76+
rm -rf "${tmp_dir:?}"
77+
78+
echo "Checking out gh-pages branch..."
79+
gh_pages_dir="$tmp_dir/torchx_gh_pages"
80+
git clone -b gh-pages --single-branch [email protected]:pytorch/torchx.git $gh_pages_dir
81+
82+
echo "Copying doc pages for $torchx_ver into $gh_pages_dir..."
83+
rm -rf "${gh_pages_dir:?}/${torchx_ver:?}"
84+
cp -R "$build_dir/$torchx_ver/html" "$gh_pages_dir/$torchx_ver"
85+
86+
for redirect in "${redirects[@]}"; do
87+
echo "Copying redirects for $redirect -> $torchx_ver..."
88+
rm -rf "${gh_pages_dir:?}/${redirect:?}"
89+
cp -R "$build_dir/redirects" "$gh_pages_dir/$redirect"
90+
done
91+
92+
if [ "$release_tag" != "master" ]; then
93+
echo "Copying redirects for default(latest) -> $torchx_ver..."
94+
cp -R "$build_dir/redirects/." "$gh_pages_dir"
95+
fi
96+
97+
cd $gh_pages_dir || exit
98+
git add .
99+
git commit --quiet -m "[doc_push][$release_tag] built from $commit_id ($branch). Redirects: ${redirects[*]} -> $torchx_ver."

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx
2+
-e git+http://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
3+
sphinxcontrib.katex
4+
matplotlib

docs/source/_static/img/efs-setup.jpg

169 KB
Loading
Lines changed: 33 additions & 0 deletions
Loading
1010 Bytes
Loading

0 commit comments

Comments
 (0)