-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use re-usable workflows for Tutorials workflows (#1151)
Summary: This is the first attempt at cleaning up GHA workflows. We currently have lots of duplicate code. By using re-usable workflows, we can significantly lower the maintenance burden. Pull Request resolved: #1151 Test Plan: * Nightly: https://github.com/pytorch/botorch/runs/5765190193?check_suite_focus=true * Stable w/ stable Ax: https://github.com/pytorch/botorch/runs/5765197499?check_suite_focus=true * Stable w/ latest Ax: https://github.com/pytorch/botorch/runs/5765197454?check_suite_focus=true * Smoke test: https://github.com/pytorch/botorch/runs/5765209107?check_suite_focus=true Reviewed By: Balandat Differential Revision: D35274005 Pulled By: saitcakmak fbshipit-source-id: 87325067f6db5a6c8e8186c1795521caced5fe68
- Loading branch information
1 parent
1c1bb5b
commit 13f0db7
Showing
4 changed files
with
89 additions
and
98 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Reusable Tutorials Workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
smoke_test: | ||
required: false | ||
type: boolean | ||
default: true | ||
use_stable_pytorch_gpytorch: | ||
required: false | ||
type: boolean | ||
default: false | ||
use_stable_ax: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
tutorials: | ||
name: Run tutorials | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Fetch all history for all tags and branches | ||
# We need to do this so setuptools_scm knows how to set the BoTorch version. | ||
run: git fetch --prune --unshallow | ||
- if: ${{ !inputs.use_stable_pytorch_botorch }} | ||
name: Install latest PyTorch & GPyTorch | ||
run: | | ||
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | ||
pip install git+https://github.com/cornellius-gp/gpytorch.git | ||
- if: ${{ inputs.use_stable_pytorch_botorch }} | ||
name: Install min required PyTorch & GPyTorch | ||
run: | | ||
python setup.py egg_info | ||
req_txt="botorch.egg-info/requires.txt" | ||
min_torch_version=$(grep '\btorch>=' ${req_txt} | sed 's/[^0-9.]//g') | ||
min_gpytorch_version=$(grep '\bgpytorch>=' ${req_txt} | sed 's/[^0-9.]//g') | ||
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" | ||
- if: ${{ !inputs.use_stable_ax }} | ||
name: Install latest Ax | ||
env: | ||
# This is so Ax's setup doesn't install a pinned BoTorch version. | ||
ALLOW_BOTORCH_LATEST: true | ||
run: | | ||
pip install git+https://github.com/facebook/Ax.git | ||
- name: Install BoTorch with tutorials dependencies | ||
env: | ||
ALLOW_BOTORCH_LATEST: true | ||
run: | | ||
pip install .[tutorials] | ||
- if: ${{ inputs.smoke_test }} | ||
name: Run tutorials with smoke test | ||
run: | | ||
python scripts/run_tutorials.py -p "$(pwd)" -s | ||
- if: ${{ !inputs.smoke_test }} | ||
name: Run tutorials without smoke test | ||
run: | | ||
python scripts/run_tutorials.py -p "$(pwd)" |
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