Skip to content

Commit 8093a2f

Browse files
committed
Prepare configuration for re-enabling vector search in Platformsh
1 parent 0a525ab commit 8093a2f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.platform/applications.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@
6868
sed -i '/VectorSearch/d' config/bundles.php
6969
7070
deploy: |
71+
OPENSEARCH_URL="http://opensearch.internal:9200"
72+
# Check the number of nodes in the cluster
73+
NODE_COUNT=$(curl -s "$OPENSEARCH_URL/_cat/nodes?h=name" | wc -l)
74+
75+
if [ "$NODE_COUNT" -eq 1 ]; then
76+
echo "This is a single-node OpenSearch cluster. Proceeding with the settings change."
77+
78+
# Change the setting plugins.ml_commons.only_run_on_ml_node to false
79+
curl -X PUT "$OPENSEARCH_URL/_cluster/settings" \
80+
-H "Content-Type: application/json" \
81+
-d '{ "persistent": { "plugins.ml_commons.only_run_on_ml_node": false}}'
82+
echo "Setting updated successfully."
83+
else
84+
echo "This is a multi-node OpenSearch cluster. No changes made."
85+
fi
86+
# Change the setting plugins.ml_commons.disk_free_space_threshold to -1 to avoid Disk Circuit Breaker
87+
curl -X PUT "$OPENSEARCH_URL/_cluster/settings" \
88+
-H "Content-Type: application/json" \
89+
-d '{ "persistent": { "plugins.ml_commons.disk_free_space_threshold": -1}}'
7190
bin/console --env=prod cache:clear
7291
bin/console doctrine:migrations:migrate -n --allow-no-migration
7392

0 commit comments

Comments
 (0)