-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This moves the tvm-bot pr commenting logic from apache/tvm to an AWS Lambda function. This keeps it out of the queue and also gives us better guarantees about runtime (PR comments previously would take up to a minute to show up, with this they are pretty much instant), and this doesn't show up in the CI jobs box on PRs. There is lots of copy paste from `tvm/ci/scripts` into `tvm_bot/tvm_bot` with some minor changes to work with lambda. The main infra changes are in the folder atop that in `ci/terraform`, which adds a lambda function with an API gateway that exposes a URL that GitHub can send webhooks to. This PR is just a start so it skips the more complicated parts that generate PR-specific bits, like the docs URL and the skipped tests list. The commenting is also still gated to members of the OSS team.
- Loading branch information
Showing
38 changed files
with
4,640 additions
and
9 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
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
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,33 @@ | ||
name: test tvm_bot | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- terraform/tvm_bot/** | ||
pull_request_target: | ||
branches: | ||
- main | ||
paths: | ||
- terraform/tvm_bot/** | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./terraform/tvm_bot | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Install dependencies | ||
run: | | ||
set -eux | ||
pip install -r requirements.txt | ||
- name: Run unit tests | ||
run: | | ||
set -eux | ||
PYTHONPATH=$(pwd) pytest --tb=native |
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ coverage.xml | |
.pytest_cache/ | ||
.testmondata | ||
|
||
*.env |
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# terraform | ||
|
||
This folder handles the Terraform configuration for TVM Jenkins Infrastructure. | ||
|
||
## Local Usage | ||
|
||
```bash | ||
# if anything is broken, remove all terraform local files | ||
git clean -xfd . | ||
|
||
# set credentials | ||
export AWS_ACCESS_KEY_ID=... | ||
export AWS_SECRET_ACCESS_KEY=... | ||
|
||
# get terraform state | ||
terraform init | ||
|
||
# the workspace must be selected or else 'plan' will not read the correct state | ||
terraform workspace new tvm-ci-prod | ||
terraform workspace select tvm-ci-prod | ||
|
||
# run the actual plan against AWS | ||
terraform plan -var-file=vars/tvm-ci-prod.auto.tfvars | ||
``` |
Oops, something went wrong.