Skip to content

Commit 11b9878

Browse files
committed
feat: support no default fs and post cluster setup script
1 parent 362cda5 commit 11b9878

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ proxy_url = VALUE
463463
| <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 |
464464
| <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 |
465465
| <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 |
466-
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"f574113c680e317e7bca869159e0d168"` | no |
466+
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"6668fae0609d33c3364957cf3e3bccf6"` | no |
467467
| <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 |
468468
| <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 |
469469
| <a name="input_install_cluster_dpdk"></a> [install\_cluster\_dpdk](#input\_install\_cluster\_dpdk) | Install weka cluster with DPDK | `bool` | `true` | no |

function-app/code/functions/clusterize/clusterize.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
417417
// NFS state
418418
nfsStateContainerName := os.Getenv("NFS_STATE_CONTAINER_NAME")
419419
nfsStateBlobName := os.Getenv("NFS_STATE_BLOB_NAME")
420+
setDefaultFs, _ := strconv.ParseBool(os.Getenv("SET_DEFAULT_FS"))
421+
postClusterSetupScript := os.Getenv("POST_CLUSTER_SETUP_SCRIPT")
420422

421423
addFrontend := false
422424
if addFrontendNum > 0 {
@@ -486,6 +488,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
486488
PostClusterCreationScript: postClusterCreationScript,
487489
TieringTargetSSDRetention: tieringTargetSsdRetention,
488490
TieringStartDemote: tieringStartDemote,
491+
SetDefaultFs: setDefaultFs,
492+
PostClusterSetupScript: postClusterSetupScript,
489493
},
490494
Obs: common.AzureObsParams{
491495
Name: obsName,

function-app/code/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/google/go-cmp v0.6.0
1515
github.com/google/uuid v1.6.0
1616
github.com/lithammer/dedent v1.1.0
17-
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb
17+
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2
1818
)
1919

2020
require (

function-app/code/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
5555
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
5656
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
5757
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
58-
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb h1:tAlwwk4/527hAWRCEO/CEKHGoC1/KROOGTnBXfxJpKU=
59-
github.com/weka/go-cloud-lib v0.0.0-20240925210243-4d37183d36eb/go.mod h1:FCQuk2bLvtDHe2Kjsu0oInJP1VOVsuxqPGHGMmVIPMg=
58+
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2 h1:yb0J9EPSfGxbq+9+7BwhuE4svGaAPM0iT7skK/pAA5M=
59+
github.com/weka/go-cloud-lib v0.0.0-20241030124057-ec13a72a73b2/go.mod h1:FCQuk2bLvtDHe2Kjsu0oInJP1VOVsuxqPGHGMmVIPMg=
6060
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
6161
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
6262
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=

functions.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ locals {
166166
SMB_PROTOCOL_GATEWAY_FE_CORES_NUM = var.smb_protocol_gateway_fe_cores_num
167167
S3_PROTOCOL_GATEWAY_FE_CORES_NUM = var.s3_protocol_gateway_fe_cores_num
168168
TRACES_PER_FRONTEND = var.traces_per_ionode
169+
SET_DEFAULT_FS = var.set_default_fs
170+
POST_CLUSTER_SETUP_SCRIPT = var.post_cluster_setup_script
169171

170172
BACKEND_LB_IP = var.create_lb ? azurerm_lb.backend_lb[0].private_ip_address : ""
171173
# state

variables.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ variable "function_app_storage_account_container_prefix" {
404404
variable "function_app_version" {
405405
type = string
406406
description = "Function app code version (hash)"
407-
default = "f574113c680e317e7bca869159e0d168"
407+
default = "6668fae0609d33c3364957cf3e3bccf6"
408408
}
409409

410410
variable "function_app_dist" {
411411
type = string
412412
description = "Function app code dist"
413-
default = "release"
413+
default = "dev"
414414

415415
validation {
416416
condition = contains(["dev", "release"], var.function_app_dist)
@@ -891,3 +891,15 @@ variable "key_vault_purge_protection_enabled" {
891891
default = false
892892
description = "Enable purge protection for the key vault."
893893
}
894+
895+
variable "set_default_fs" {
896+
type = bool
897+
description = "Set the default filesystem which will use the full available capacity"
898+
default = true
899+
}
900+
901+
variable "post_cluster_setup_script" {
902+
type = string
903+
description = "A script to run after the cluster is up"
904+
default = ""
905+
}

0 commit comments

Comments
 (0)