Skip to content

Commit

Permalink
feat: support no default fs and post cluster setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Nov 5, 2024
1 parent 362cda5 commit 11b9878
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ proxy_url = VALUE
| <a name="input_function_app_storage_account_prefix"></a> [function\_app\_storage\_account\_prefix](#input\_function\_app\_storage\_account\_prefix) | Weka storage account name prefix | `string` | `"weka"` | no |
| <a name="input_function_app_subnet_delegation_cidr"></a> [function\_app\_subnet\_delegation\_cidr](#input\_function\_app\_subnet\_delegation\_cidr) | Subnet delegation enables you to designate a specific subnet for an Azure PaaS service. | `string` | `"10.0.1.0/25"` | no |
| <a name="input_function_app_subnet_delegation_id"></a> [function\_app\_subnet\_delegation\_id](#input\_function\_app\_subnet\_delegation\_id) | Required to specify if subnet\_name were used to specify pre-defined subnets for weka. Function subnet delegation requires an additional subnet, and in the case of pre-defined networking this one also should be pre-defined | `string` | `""` | no |
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"f574113c680e317e7bca869159e0d168"` | no |
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"6668fae0609d33c3364957cf3e3bccf6"` | no |
| <a name="input_get_weka_io_token"></a> [get\_weka\_io\_token](#input\_get\_weka\_io\_token) | The token to download the Weka release from get.weka.io. | `string` | `""` | no |
| <a name="input_hotspare"></a> [hotspare](#input\_hotspare) | Number of hotspares to set on weka cluster. Refer to https://docs.weka.io/overview/ssd-capacity-management#hot-spare | `number` | `1` | no |
| <a name="input_install_cluster_dpdk"></a> [install\_cluster\_dpdk](#input\_install\_cluster\_dpdk) | Install weka cluster with DPDK | `bool` | `true` | no |
Expand Down
4 changes: 4 additions & 0 deletions function-app/code/functions/clusterize/clusterize.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
// NFS state
nfsStateContainerName := os.Getenv("NFS_STATE_CONTAINER_NAME")
nfsStateBlobName := os.Getenv("NFS_STATE_BLOB_NAME")
setDefaultFs, _ := strconv.ParseBool(os.Getenv("SET_DEFAULT_FS"))
postClusterSetupScript := os.Getenv("POST_CLUSTER_SETUP_SCRIPT")

addFrontend := false
if addFrontendNum > 0 {
Expand Down Expand Up @@ -486,6 +488,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
PostClusterCreationScript: postClusterCreationScript,
TieringTargetSSDRetention: tieringTargetSsdRetention,
TieringStartDemote: tieringStartDemote,
SetDefaultFs: setDefaultFs,
PostClusterSetupScript: postClusterSetupScript,
},
Obs: common.AzureObsParams{
Name: obsName,
Expand Down
2 changes: 1 addition & 1 deletion function-app/code/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/lithammer/dedent v1.1.0
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2
)

require (
Expand Down
4 changes: 2 additions & 2 deletions function-app/code/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb h1:tAlwwk4/527hAWRCEO/CEKHGoC1/KROOGTnBXfxJpKU=
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb/go.mod h1:FCQuk2bLvtDHe2Kjsu0oInJP1VOVsuxqPGHGMmVIPMg=
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2 h1:yb0J9EPSfGxbq+9+7BwhuE4svGaAPM0iT7skK/pAA5M=
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2/go.mod h1:FCQuk2bLvtDHe2Kjsu0oInJP1VOVsuxqPGHGMmVIPMg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
Expand Down
2 changes: 2 additions & 0 deletions functions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ locals {
SMB_PROTOCOL_GATEWAY_FE_CORES_NUM = var.smb_protocol_gateway_fe_cores_num
S3_PROTOCOL_GATEWAY_FE_CORES_NUM = var.s3_protocol_gateway_fe_cores_num
TRACES_PER_FRONTEND = var.traces_per_ionode
SET_DEFAULT_FS = var.set_default_fs
POST_CLUSTER_SETUP_SCRIPT = var.post_cluster_setup_script

BACKEND_LB_IP = var.create_lb ? azurerm_lb.backend_lb[0].private_ip_address : ""
# state
Expand Down
16 changes: 14 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ variable "function_app_storage_account_container_prefix" {
variable "function_app_version" {
type = string
description = "Function app code version (hash)"
default = "f574113c680e317e7bca869159e0d168"
default = "6668fae0609d33c3364957cf3e3bccf6"
}

variable "function_app_dist" {
type = string
description = "Function app code dist"
default = "release"
default = "dev"

validation {
condition = contains(["dev", "release"], var.function_app_dist)
Expand Down Expand Up @@ -891,3 +891,15 @@ variable "key_vault_purge_protection_enabled" {
default = false
description = "Enable purge protection for the key vault."
}

variable "set_default_fs" {
type = bool
description = "Set the default filesystem which will use the full available capacity"
default = true
}

variable "post_cluster_setup_script" {
type = string
description = "A script to run after the cluster is up"
default = ""
}

0 comments on commit 11b9878

Please sign in to comment.