Skip to content

Commit

Permalink
Merge branch 'main' into aman/issue_99
Browse files Browse the repository at this point in the history
  • Loading branch information
amanpruthi committed Jun 10, 2024
2 parents 7dd23e7 + 9c6a775 commit 2c24b3e
Show file tree
Hide file tree
Showing 18 changed files with 541 additions and 54 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/dispatcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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
help
permission: maintain
issue-type: pull-request
event-type-suffix: -command
Empty file.
27 changes: 27 additions & 0 deletions .github/workflows/handler-help.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request Help Handler

on:
repository_dispatch:
types:
- help-command

jobs:
help:
name: Run help
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
token: ${{ secrets.WANDB_RELEASE_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: |
> | Command | Description |
> | ------- | ----------- |
> | /test [destroy=false] | Run the Terraform test workflow on the modules in the tests/ The named argument "destroy=false" will disable the destruction of test infrastructure for debugging purposes. |
> | /destroy | Destroy any resources that may still be in Terraform state from previous tests |
> | /help | Shows this help message |
reactions: confused
103 changes: 103 additions & 0 deletions .github/workflows/handler-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Pull Request Test Handler

on:
repository_dispatch:
types:
- test-command

env:
GOOGLE_SERVICE_ACCOUNT: "[email protected]"
TF_TOKEN_app_terraform_io: ${{ 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: Create URL to the run output
id: vars
run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

- name: Display Action URL
if: ${{ always() }}
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.WANDB_RELEASE_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: |
${{ format('### Public DNS Terraform Google - Test Report', job.status == 'success' && ':white_check_mark:' || ':x:') }}
${{ format(':link: [Action Summary Page]({0})', steps.vars.outputs.run-url) }}
- 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

- 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() && github.event.client_payload.slash_command.args.named.destroy != 'false' }}
run: terraform destroy -auto-approve -input=false -no-color

- name: Update comment
if: ${{ always() }}
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.WANDB_RELEASE_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: |
${{ format('- {0} Terraform Init', steps.init.outcome == 'success' && ':white_check_mark:' || ':x:') }}
${{ format('- {0} Terraform Validate', steps.validate.outcome == 'success' && ':white_check_mark:' || ':x:') }}
${{ format('- {0} Terraform Apply', steps.apply.outcome == 'success' && ':white_check_mark:' || ':x:') }}
${{ github.event.client_payload.slash_command.args.named.destroy != 'false' && format('- {0} Terraform Destroy', steps.destroy.outcome == 'success' && ':white_check_mark:' || ':x:') || '' }}
24 changes: 24 additions & 0 deletions .github/workflows/tf-lint.yaml
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://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Run tflint
run: tflint
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@

All notable changes to this project will be documented in this file.

## [3.2.0](https://github.com/wandb/terraform-google-wandb/compare/v3.1.1...v3.2.0) (2024-06-07)


### Features

* Track the otel and stackdriver sa issue ([#134](https://github.com/wandb/terraform-google-wandb/issues/134)) ([08abe84](https://github.com/wandb/terraform-google-wandb/commit/08abe848938ba80d48c2e747b5e9f229dd01eda4))

### [3.1.1](https://github.com/wandb/terraform-google-wandb/compare/v3.1.0...v3.1.1) (2024-06-05)


### Bug Fixes

* Consistent object type for redis ([#133](https://github.com/wandb/terraform-google-wandb/issues/133)) ([34c5d94](https://github.com/wandb/terraform-google-wandb/commit/34c5d94da5ba75d9d5c7ad6ebbd6aef66bf702c4))

## [3.1.0](https://github.com/wandb/terraform-google-wandb/compare/v3.0.5...v3.1.0) (2024-06-05)


### Features

* added support for stackdriver and otel metrics ([#126](https://github.com/wandb/terraform-google-wandb/issues/126)) ([1e8777a](https://github.com/wandb/terraform-google-wandb/commit/1e8777af0f6bf6e8260a0faa488302f631b716b3))

### [3.0.5](https://github.com/wandb/terraform-google-wandb/compare/v3.0.4...v3.0.5) (2024-06-05)


### Bug Fixes

* Need the global redis helm values to not be null even when disabled ([#131](https://github.com/wandb/terraform-google-wandb/issues/131)) ([e8c4602](https://github.com/wandb/terraform-google-wandb/commit/e8c46022cbb5d9ca76f62ad14bded42279e5dfb6))

### [3.0.4](https://github.com/wandb/terraform-google-wandb/compare/v3.0.3...v3.0.4) (2024-04-12)


### Bug Fixes

* Pass through env vars for services ([#117](https://github.com/wandb/terraform-google-wandb/issues/117)) ([35e15c0](https://github.com/wandb/terraform-google-wandb/commit/35e15c096372e549656877137c08529e2b32bcec))

### [3.0.3](https://github.com/wandb/terraform-google-wandb/compare/v3.0.2...v3.0.3) (2024-04-10)


### Bug Fixes

* Remove passthrough vars for old module ([#119](https://github.com/wandb/terraform-google-wandb/issues/119)) ([5b61465](https://github.com/wandb/terraform-google-wandb/commit/5b614651a50562e82a7506b76b0fece2035bf68c))

### [3.0.2](https://github.com/wandb/terraform-google-wandb/compare/v3.0.1...v3.0.2) (2024-04-10)


### Bug Fixes

* Conditionally set oidc envs ([#118](https://github.com/wandb/terraform-google-wandb/issues/118)) ([0df0ec8](https://github.com/wandb/terraform-google-wandb/commit/0df0ec8fb47fb18bf8cd4d6f8dc108f3e2ee5458))

### [3.0.1](https://github.com/wandb/terraform-google-wandb/compare/v3.0.0...v3.0.1) (2024-03-22)


Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ module "wandb" {

## Examples

We have included documentation and reference examples for additional common
installation scenarios for Weights & Biases, as well as examples for supporting
We have included documentation and reference examples for common
installation scenarios, as well as examples for supporting
resources that lack official modules.

- [Public Instance with HTTPS using Cloud DNS](examples/public-dns-with-cloud-dns)
Expand All @@ -67,7 +67,9 @@ resources that lack official modules.

## Providers

No providers.
| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | ~> 4.82 |

## Modules

Expand All @@ -87,7 +89,9 @@ No providers.

## Resources

No resources.
| Name | Type |
|------|------|
| [google_client_config.current](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/client_config) | data source |

## Inputs

Expand All @@ -104,6 +108,7 @@ No resources.
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | If the instance should have deletion protection enabled. The database / Bucket can't be deleted when this value is set to `true`. | `bool` | `true` | no |
| <a name="input_disable_code_saving"></a> [disable\_code\_saving](#input\_disable\_code\_saving) | Boolean indicating if code saving is disabled | `bool` | `false` | no |
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Domain for accessing the Weights & Biases UI. | `string` | `null` | no |
| <a name="input_enable_stackdriver"></a> [enable\_stackdriver](#input\_enable\_stackdriver) | n/a | `bool` | `false` | no |
| <a name="input_force_ssl"></a> [force\_ssl](#input\_force\_ssl) | Enforce SSL through the usage of the Cloud SQL Proxy (cloudsql://) in the DB connection string | `bool` | `false` | no |
| <a name="input_gke_machine_type"></a> [gke\_machine\_type](#input\_gke\_machine\_type) | Specifies the machine type to be allocated for the database | `string` | `"n1-standard-4"` | no |
| <a name="input_gke_node_count"></a> [gke\_node\_count](#input\_gke\_node\_count) | n/a | `number` | `2` | no |
Expand Down Expand Up @@ -131,7 +136,8 @@ No resources.
| <a name="input_wandb_image"></a> [wandb\_image](#input\_wandb\_image) | Docker repository of to pull the wandb image from. | `string` | `"wandb/local"` | no |
| <a name="input_wandb_version"></a> [wandb\_version](#input\_wandb\_version) | The version of Weights & Biases local to deploy. | `string` | `"latest"` | no |
| <a name="input_weave_wandb_env"></a> [weave\_wandb\_env](#input\_weave\_wandb\_env) | Extra environment variables for W&B | `map(string)` | `{}` | no |
| <a name="input_workload_account_id"></a> [workload\_account\_id](#input\_workload\_account\_id) | n/a | `string` | `"workload-identity"` | no |
| <a name="input_workload_account_id"></a> [workload\_account\_id](#input\_workload\_account\_id) | n/a | `string` | `"stackdriver"` | no |


## Outputs

Expand Down
30 changes: 16 additions & 14 deletions examples/public-dns-with-cloud-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,26 @@ Note: The domain and subdomain association might take a few minutes to reflect.
- Now, create a file called `terraform.tfvars` under the current directory
- `terraform.tfvars` should have the following variables included,
```markdown
project_id = "<id-of-the-project-in-gcp>"
region = "<gcp-region-to-deploy>"
zone = "<gcp-zone-to-deploy>"
namespace = "<unique-name-for-the-namespace>"
license = "<W&B-license-key>"
subdomain = "<subdomain-for-accessing-the-UI>"
domain = "<domain-for-accessing-the-UI>"
project_id = "<id-of-the-project-in-gcp>"
region = "<gcp-region-to-deploy>"
zone = "<gcp-zone-to-deploy>"
namespace = "<unique-name-for-the-namespace>"
license = "<W&B-license-key>"
subdomain = "<subdomain-for-accessing-the-UI>"
domain_name = "<domain-for-accessing-the-UI>"
allowed_inbound_cidrs = ["<allowed ip ranges>"]
```
Refer to sections above to see how you can obtain these values
An example `terraform.tfvars` file would look like this,
```markdown
project_id = "playground-111"
region = "us-west4"
zone = "us-west4-a"
namespace = "venky-unique-3"
license = "eyJhbGciOiJS6InUzhEUXM1M0xQY09yNnZhaTdoSlduYnF1bTRZTlZWd1VwSWM9In0.eyJjb25jdXJyZW50QWdlbnRzIjoxMCwiZGVwbG95bWVudElkIjoiNGU0YWNiZmYtY2E5NS00MmRiLThmYmItMjliNmY5NTI2OWE0IiwibWF4VXNlcnMiOjQsIm1heFN0b3JhZ2VHYiI6MTAwMDAwMCwibWF4VGVhbXMiOjEsImV4cGlyZXNBdCI6IjIwMjItMTAtMjBUMTY6MjY6NTUuNzA3WiIsImZsYWdzIjpbIlNDQUxBQkxFIiwibXlzcWwiLCJzMyIsInJlZGlzIiwiTk9USUZJQ0FUSU9OUyIsInNsYWNrIiwibm90aWZpY2F0aW9ucyIsIk1BTkFHRU1FTlQiLCJvcmdfZGFzaCIsImF1dGgwIl0sInRyaWFsIjpmYWxzZSwiYWNjZXNzS2V5IjoiNzk3M2FkOWItNThmOC00OTUxLWJhOTctOGQ2NGFkYzI1ZThlIiwic2VhdHMiOjQsInRlYW1zIjoxLCJzdG9yYWdlR2lncyI6MTAwMDAwMCwiZXhwIjoxNjY2MjgzMjE1fQ.O_6D3Av9QoWI16ybg54KFvs7eGWugSXPxmfhobtZe3TBFvd8PwmSCAmMojmKWsqg6KNjLJ9sjxOP_3Pj9OAdrkx5WzU0KTcIByXD2hS9VwyYUOYEohBn65oCLnQJLYphXJBrB9JVS0GSUGxR1AzwnUK1PuKZ6jQFrpt-feQOD3rvCdyM1eBQ73rdHk6zfEBmdiZ7C4LiRLV8OEMxUfwxASvVF_cFUEeVQx82AaxRwfPBLZxXTL4qlQOIFjAKwGVyDMEWq04BhQ_ASdyND45w5qXiUOlvFOergrFyGBSHg-9yDT4fhdkDw5puGthDaMFsn02rr0eYHuxKFWSY958aig"
subdomain = "venky"
domain = "wandb.ml"
project_id = "playground-111"
region = "us-west4"
zone = "us-west4-a"
namespace = "venky-unique-3"
license = "W&B-license-key goes here"
subdomain = "venky"
domain_name = "wandb.ml"
allowed_inbound_cidrs = ["0.0.0.0/0"]
```

### Initializing the terraform
Expand Down
Loading

0 comments on commit 2c24b3e

Please sign in to comment.