Skip to content

Commit 9325a74

Browse files
committed
chore: update management ip fetch
1 parent 3d69934 commit 9325a74

File tree

5 files changed

+18
-119
lines changed

5 files changed

+18
-119
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ proxy_url = VALUE
466466
| <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 |
467467
| <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 |
468468
| <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 |
469-
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"bef288291e94411aa8c388613e355c4a"` | no |
469+
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"e087d93911df7dbd1c19adf8846428a2"` | no |
470470
| <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 |
471471
| <a name="input_hotspare"></a> [hotspare](#input\_hotspare) | Number of hotspares to set on weka cluster. Refer to https://docs.weka.io/weka-system-overview/ssd-capacity-management#hot-spare | `number` | `1` | no |
472472
| <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/go.mod

Lines changed: 5 additions & 5 deletions
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-20241121111254-108c4c653f1f
17+
github.com/weka/go-cloud-lib v0.0.0-20250410084411-112c24a8250a
1818
)
1919

2020
require (
@@ -30,11 +30,11 @@ require (
3030
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
3131
github.com/rs/xid v1.4.0 // indirect
3232
github.com/rs/zerolog v1.29.0 // indirect
33-
golang.org/x/crypto v0.31.0 // indirect
34-
golang.org/x/net v0.33.0 // indirect
33+
golang.org/x/crypto v0.35.0 // indirect
34+
golang.org/x/net v0.36.0 // indirect
3535
golang.org/x/oauth2 v0.6.0 // indirect
36-
golang.org/x/sys v0.28.0 // indirect
37-
golang.org/x/text v0.21.0 // indirect
36+
golang.org/x/sys v0.30.0 // indirect
37+
golang.org/x/text v0.22.0 // indirect
3838
google.golang.org/appengine v1.6.7 // indirect
3939
google.golang.org/protobuf v1.33.0 // indirect
4040
)

function-app/code/go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,26 @@ 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-20241121111254-108c4c653f1f h1:oTveR7UcBF3mIfJFS1Iu2N1GpGzRQKXrv+uyl+Kjmaw=
59-
github.com/weka/go-cloud-lib v0.0.0-20241121111254-108c4c653f1f/go.mod h1:FCQuk2bLvtDHe2Kjsu0oInJP1VOVsuxqPGHGMmVIPMg=
58+
github.com/weka/go-cloud-lib v0.0.0-20250410084411-112c24a8250a h1:jhFW17Y0x+diF98VOBv1JT0rlFca0XLGyoDH1GxuYds=
59+
github.com/weka/go-cloud-lib v0.0.0-20250410084411-112c24a8250a/go.mod h1:fH7HSVgxKq5g9cuw/AD47tCrP6700TrZFx6c3vluNws=
6060
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
61-
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
62-
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
61+
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
62+
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
6363
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
64-
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
65-
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
64+
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
65+
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
6666
golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=
6767
golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
6868
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
6969
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7070
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7171
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
72-
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
73-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
72+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
73+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
7474
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
7575
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
76-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
77-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
76+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
77+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
7878
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
7979
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
8080
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
echo "$(date -u): running validation for setting protocol script"
2-
3-
41
# get token for key vault access
52
access_token=$(curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net' -H Metadata:true | jq -r '.access_token')
63
# get key vault secret
@@ -11,101 +8,9 @@ function report {
118
curl ${report_function_url}?code="$function_app_key" -H 'Content-Type:application/json' -d "$json_data"
129
}
1310

14-
filesystem_name="default"
15-
function wait_for_weka_fs(){
16-
max_retries=30 # 30 * 10 = 5 minutes
17-
for (( i=0; i < max_retries; i++ )); do
18-
if [[ "$(weka fs | grep -c $filesystem_name)" -ge 1 ]]; then
19-
echo "$(date -u): weka filesystem $filesystem_name is up"
20-
break
21-
fi
22-
echo "$(date -u): waiting for weka filesystem $filesystem_name to be up"
23-
sleep 10
24-
done
25-
if (( i > max_retries )); then
26-
err_msg="timeout: weka filesystem $filesystem_name is not up after $max_retries attempts."
27-
echo "$(date -u): $err_msg"
28-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"$err_msg\"}"
29-
return 1
30-
fi
31-
}
32-
33-
function create_config_fs(){
34-
config_filesystem_name=".config_fs"
35-
size="10GB"
36-
37-
if [ "$(weka fs | grep -c $config_filesystem_name)" -ge 1 ]; then
38-
echo "$(date -u): weka filesystem $config_filesystem_name exists"
39-
return 0
40-
fi
41-
42-
echo "$(date -u): trying to create filesystem $config_filesystem_name"
43-
output=$(weka fs create $config_filesystem_name default $size 2>&1)
44-
# possiible outputs:
45-
# FSId: 1 (means success)
46-
# error: The given filesystem ".config_fs" already exists.
47-
# error: Not enough available drive capacity for filesystem. requested "10.00 GB", but only "0 B" are free
48-
if [ $? -eq 0 ]; then
49-
echo "$(date -u): weka filesystem $config_filesystem_name is created"
50-
return 0
51-
fi
52-
53-
if [[ $output == *"already exists"* ]]; then
54-
echo "$(date -u): weka filesystem $config_filesystem_name already exists"
55-
break
56-
elif [[ $output == *"Not enough available drive capacity for filesystem"* ]]; then
57-
err_msg="Not enough available drive capacity for filesystem $config_filesystem_name for size $size"
58-
echo "$(date -u): $err_msg"
59-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"$err_msg\"}"
60-
return 1
61-
else
62-
echo "$(date -u): output: $output"
63-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"cannot create weka filesystem $config_filesystem_name\"}"
64-
return 1
65-
fi
66-
}
67-
68-
69-
# make sure weka cluster is already up
70-
max_retries=60
71-
for (( i=0; i < max_retries; i++ )); do
72-
if [ $(weka status | grep 'status: OK' | wc -l) -ge 1 ]; then
73-
echo "$(date -u): weka cluster is up"
74-
break
75-
fi
76-
echo "$(date -u): waiting for weka cluster to be up"
77-
sleep 30
78-
done
79-
if (( i > max_retries )); then
80-
err_msg="timeout: weka cluster is not up after $max_retries attempts."
81-
echo "$(date -u): $err_msg"
82-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"$err_msg\"}"
83-
exit 1
84-
fi
85-
86-
cluster_size="${gateways_number}"
87-
88-
current_mngmnt_ip=$(weka local resources | grep 'Management IPs' | awk '{print $NF}')
89-
# get container id
90-
for ((i=0; i<20; i++)); do
91-
container_id=$(weka cluster container | grep frontend0 | grep ${gateways_name} | grep $current_mngmnt_ip | grep UP | awk '{print $1}')
92-
if [ -n "$container_id" ]; then
93-
echo "$(date -u): frontend0 container id: $container_id"
94-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"progress\", \"message\": \"frontend0 container $container_id is up\"}"
95-
break
96-
fi
97-
echo "$(date -u): waiting for frontend0 container to be up"
98-
sleep 5
99-
done
100-
101-
if [ -z "$container_id" ]; then
102-
err_msg="Failed to get the frontend0 container ID."
103-
echo "$(date -u): $err_msg"
104-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"$err_msg\"}"
105-
exit 1
106-
fi
10711

10812
# wait for all containers to be ready
13+
cluster_size="${gateways_number}"
10914
max_retries=60
11015
for (( retry=1; retry<=max_retries; retry++ )); do
11116
# get all UP gateway container ids
@@ -128,10 +33,4 @@ if (( retry > max_retries )); then
12833
exit 1
12934
fi
13035

131-
132-
if [[ ${smbw_enabled} == true || ${protocol} == "s3" ]]; then
133-
wait_for_weka_fs || exit 1
134-
create_config_fs || exit 1
135-
fi
136-
13736
echo "$(date -u): Done running validation for protocol"

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ variable "function_app_storage_account_container_prefix" {
404404
variable "function_app_version" {
405405
type = string
406406
description = "Function app code version (hash)"
407-
default = "bef288291e94411aa8c388613e355c4a"
407+
default = "e087d93911df7dbd1c19adf8846428a2"
408408
}
409409

410410
variable "function_app_dist" {

0 commit comments

Comments
 (0)