Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure tflint & tf format pipelines #94

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/tf-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Terraform Lint and Format Check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
terraform_checks:
name: Run Terraform Lint and Format Check
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

- name: Check Terraform formatting
run: terraform fmt -check -recursive
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ resources that lack official modules.
|------|-------------|------|---------|:--------:|
| <a name="input_allowed_ip_ranges"></a> [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | Allowed public IP addresses or CIDR ranges. | `list(string)` | `[]` | no |
| <a name="input_allowed_subscriptions"></a> [allowed\_subscriptions](#input\_allowed\_subscriptions) | List of allowed customer subscriptions coma seperated values | `string` | `""` | no |
| <a name="input_app_wandb_env"></a> [app\_wandb\_env](#input\_app\_wandb\_env) | Extra environment variables for W&B | `map(string)` | `{}` | no |
| <a name="input_azuremonitor"></a> [azuremonitor](#input\_azuremonitor) | # To support otel azure monitor sql and redis metrics need operator-wandb chart minimum version 0.14.0 | `bool` | `false` | no |
| <a name="input_blob_container"></a> [blob\_container](#input\_blob\_container) | Use an existing bucket. | `string` | `""` | no |
| <a name="input_bucket_path"></a> [bucket\_path](#input\_bucket\_path) | path of where to store data for the instance-level bucket | `string` | `""` | no |
Expand All @@ -101,7 +100,6 @@ resources that lack official modules.
| <a name="input_cluster_sku_tier"></a> [cluster\_sku\_tier](#input\_cluster\_sku\_tier) | The Azure AKS SKU Tier to use for this cluster (https://learn.microsoft.com/en-us/azure/aks/free-standard-pricing-tiers) | `string` | `"Free"` | no |
| <a name="input_controller_image_tag"></a> [controller\_image\_tag](#input\_controller\_image\_tag) | Tag of the controller image to deploy | `string` | `"1.14.0"` | no |
| <a name="input_create_private_link"></a> [create\_private\_link](#input\_create\_private\_link) | Use for the azure private link. | `bool` | `false` | no |
| <a name="input_create_redis"></a> [create\_redis](#input\_create\_redis) | Boolean indicating whether to provision an redis instance (true) or not (false). | `bool` | `false` | no |
| <a name="input_database_availability_mode"></a> [database\_availability\_mode](#input\_database\_availability\_mode) | n/a | `string` | `"SameZone"` | no |
| <a name="input_database_sku_name"></a> [database\_sku\_name](#input\_database\_sku\_name) | Specifies the SKU Name for this MySQL Server. Defaults to null and value from deployment-size.tf is used | `string` | `null` | no |
| <a name="input_database_version"></a> [database\_version](#input\_database\_version) | Version for MySQL | `string` | `"5.7"` | no |
Expand All @@ -120,10 +118,6 @@ resources that lack official modules.
| <a name="input_node_max_pods"></a> [node\_max\_pods](#input\_node\_max\_pods) | Maximum number of pods per node | `number` | `30` | no |
| <a name="input_node_pool_num_zones"></a> [node\_pool\_num\_zones](#input\_node\_pool\_num\_zones) | Number of availability zones to use for the node pool when node\_pool\_zones is not set. If neither are set, 3 zones will be used | `number` | `2` | no |
| <a name="input_node_pool_zones"></a> [node\_pool\_zones](#input\_node\_pool\_zones) | Availability zones for the node pool | `list(string)` | `null` | no |
| <a name="input_oidc_auth_method"></a> [oidc\_auth\_method](#input\_oidc\_auth\_method) | OIDC auth method | `string` | `"implicit"` | no |
| <a name="input_oidc_client_id"></a> [oidc\_client\_id](#input\_oidc\_client\_id) | The Client ID of application in your identity provider | `string` | `""` | no |
| <a name="input_oidc_issuer"></a> [oidc\_issuer](#input\_oidc\_issuer) | A url to your Open ID Connect identity provider, i.e. https://cognito-idp.us-east-1.amazonaws.com/us-east-1_uiIFNdacd | `string` | `""` | no |
| <a name="input_oidc_secret"></a> [oidc\_secret](#input\_oidc\_secret) | The Client secret of application in your identity provider | `string` | `""` | no |
| <a name="input_operator_chart_version"></a> [operator\_chart\_version](#input\_operator\_chart\_version) | Version of the operator chart to deploy | `string` | `"1.3.4"` | no |
| <a name="input_other_wandb_env"></a> [other\_wandb\_env](#input\_other\_wandb\_env) | Extra environment variables for W&B | `map(any)` | `{}` | no |
| <a name="input_parquet_wandb_env"></a> [parquet\_wandb\_env](#input\_parquet\_wandb\_env) | Extra environment variables for W&B | `map(string)` | `{}` | no |
Expand All @@ -135,9 +129,6 @@ resources that lack official modules.
| <a name="input_subdomain"></a> [subdomain](#input\_subdomain) | Subdomain for accessing the Weights & Biases UI. Default creates record at Route53 Route. | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Map of tags for resource | `map(string)` | `{}` | no |
| <a name="input_use_internal_queue"></a> [use\_internal\_queue](#input\_use\_internal\_queue) | Uses an internal redis queue instead of using azure queue. | `bool` | `false` | no |
| <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 |

## Outputs

Expand Down
8 changes: 4 additions & 4 deletions modules/clickhouse/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ locals {
}

resource "azurerm_private_endpoint" "clickhouse" {
name = "${var.namespace}-clickhouse-pe"
location = var.location
resource_group_name = var.resource_group_name
subnet_id = var.private_subnet_id
name = "${var.namespace}-clickhouse-pe"
location = var.location
resource_group_name = var.resource_group_name
subnet_id = var.private_subnet_id
custom_network_interface_name = "${var.namespace}-clickhouse-nic"

private_service_connection {
Expand Down
4 changes: 2 additions & 2 deletions modules/clickhouse/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ variable "clickhouse_private_endpoint_service_name" {
default = ""

validation {
condition = can(regex("\\.azure\\.privatelinkservice$", var.clickhouse_private_endpoint_service_name))
condition = can(regex("\\.azure\\.privatelinkservice$", var.clickhouse_private_endpoint_service_name))
error_message = "ClickHouse Service name must end in '.azure.privatelinkservice'."
}
}
Expand All @@ -40,7 +40,7 @@ variable "clickhouse_region" {
default = ""

validation {
condition = length(var.clickhouse_region) > 0
condition = length(var.clickhouse_region) > 0
error_message = "Clickhouse Region should always be set if the private endpoint service name is specified."
}
}
59 changes: 0 additions & 59 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,11 @@ variable "size" {
type = string
}

variable "wandb_version" {
description = "The version of Weights & Biases local to deploy."
type = string
default = "latest"
}

variable "wandb_image" {
description = "Docker repository of to pull the wandb image from."
type = string
default = "wandb/local"
}

variable "license" {
type = string
description = "Your wandb/local license"
}

variable "oidc_issuer" {
type = string
description = "A url to your Open ID Connect identity provider, i.e. https://cognito-idp.us-east-1.amazonaws.com/us-east-1_uiIFNdacd"
default = ""
}

variable "oidc_client_id" {
type = string
description = "The Client ID of application in your identity provider"
default = ""
}

variable "oidc_secret" {
type = string
description = "The Client secret of application in your identity provider"
default = ""
sensitive = true
}

variable "oidc_auth_method" {
type = string
description = "OIDC auth method"
default = "implicit"
validation {
condition = contains(["pkce", "implicit"], var.oidc_auth_method)
error_message = "Invalid OIDC auth method."
}
}

variable "other_wandb_env" {
type = map(any)
description = "Extra environment variables for W&B"
Expand Down Expand Up @@ -154,12 +113,6 @@ variable "database_sku_name" {
##########################################
# Redis #
##########################################
variable "create_redis" {
type = bool
description = "Boolean indicating whether to provision an redis instance (true) or not (false)."
default = false
}

variable "redis_capacity" {
type = number
description = "Number indicating size of an redis instance. Defaults to null and value from deployment-size.tf is used"
Expand Down Expand Up @@ -277,18 +230,6 @@ variable "allowed_ip_ranges" {
default = []
}

variable "weave_wandb_env" {
type = map(string)
description = "Extra environment variables for W&B"
default = {}
}

variable "app_wandb_env" {
type = map(string)
description = "Extra environment variables for W&B"
default = {}
}

variable "parquet_wandb_env" {
type = map(string)
description = "Extra environment variables for W&B"
Expand Down