Skip to content

Commit a35f24c

Browse files
committed
chore: remove routes deletion
1 parent 5166275 commit a35f24c

File tree

3 files changed

+11
-59
lines changed

3 files changed

+11
-59
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ proxy_url = VALUE
471471
| <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 |
472472
| <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 |
473473
| <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 |
474-
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"dfbf0e60f92791206b77092d24711251"` | no |
474+
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"817d5d8a75ab065bb20135f95500e0da"` | no |
475475
| <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 |
476476
| <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 |
477477
| <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/scale_up/init_script.go

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -65,62 +65,6 @@ EOF
6565
6666
netplan apply
6767
68-
if [[ $NICS_NUM -gt 1 ]]; then
69-
are_routes_ready='ip route | grep eth1'
70-
for(( i=2; i<$NICS_NUM; i++ )); do
71-
are_routes_ready=$are_routes_ready' && ip route | grep eth'"$i"
72-
done
73-
cat >>/usr/sbin/remove-routes.sh <<EOF
74-
#!/bin/bash
75-
set -ex
76-
retry_max=24
77-
for(( i=0; i<\$retry_max; i++ )); do
78-
if eval "$are_routes_ready"; then
79-
for(( j=1; j<$NICS_NUM; j++ )); do
80-
/usr/sbin/ip route del $SUBNET_RANGE dev eth\$j
81-
done
82-
break
83-
fi
84-
ip route
85-
sleep 5
86-
done
87-
if [ \$i -eq \$retry_max ]; then
88-
echo "Routes are not ready on time"
89-
host_routes=$(ip route)
90-
weka_resources=$(weka local resources || "no weka resources")
91-
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"error\", \"message\": \"Routes are not ready on time. Routes: $host_routes WEKA resources: $weka_resources\"}"
92-
shutdown -h now
93-
exit 1
94-
fi
95-
echo "Routes were removed successfully"
96-
EOF
97-
98-
chmod +x /usr/sbin/remove-routes.sh
99-
100-
cat >/etc/systemd/system/remove-routes.service <<EOF
101-
[Unit]
102-
Description=Remove specific routes
103-
After=network-online.target
104-
Wants=network-online.target
105-
106-
[Service]
107-
Type=oneshot
108-
ExecStart=/bin/bash /usr/sbin/remove-routes.sh
109-
110-
[Install]
111-
WantedBy=multi-user.target
112-
EOF
113-
114-
ip route # show routes before removing
115-
systemctl daemon-reload
116-
systemctl enable remove-routes.service
117-
systemctl start remove-routes.service
118-
systemctl status remove-routes.service || true # show status of remove-routes.service
119-
ip route # show routes after removing
120-
fi
121-
122-
echo "$(date -u): routes configured"
123-
12468
disk_size_str="${DISK_SIZE}G"
12569
while ! [ "$(lsblk | grep $disk_size_str | awk '{print $1}')" ] ; do
12670
echo "waiting for disk to be ready"
@@ -165,11 +109,19 @@ if [ $retry -gt 0 ]; then
165109
report "{\"hostname\": \"$HOSTNAME\", \"type\": \"debug\", \"message\": \"$msg\"}"
166110
fi
167111
112+
# debug info
113+
ip route
114+
ip addr show
115+
168116
echo "$(date -u): running deploy script"
169117
170118
chmod +x /tmp/deploy.sh
171119
/tmp/deploy.sh 2>&1 | tee /tmp/weka_deploy.log
172120
121+
# debug info
122+
ip route
123+
ip addr show
124+
173125
# Install WEKA maintenance event monitor
174126
echo "$(date -u): installing weka maintenance event monitor"
175127

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ variable "function_app_storage_account_container_prefix" {
410410
variable "function_app_version" {
411411
type = string
412412
description = "Function app code version (hash)"
413-
default = "dfbf0e60f92791206b77092d24711251"
413+
default = "817d5d8a75ab065bb20135f95500e0da"
414414
}
415415

416416
variable "function_app_dist" {
417417
type = string
418418
description = "Function app code dist"
419-
default = "release"
419+
default = "dev"
420420

421421
validation {
422422
condition = contains(["dev", "release"], var.function_app_dist)

0 commit comments

Comments
 (0)