-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add helpers.sh settings.sh stop.sh to make keycloak and quickstart.sh…
… work better on apple silicon and be more readable
- Loading branch information
1 parent
6f4519e
commit 17548d0
Showing
5 changed files
with
82 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# This script is sourced by quickstart.sh and quickstop.sh | ||
export DOCKER_SCAN_SUGGEST=false | ||
export DOCKER_DEFAULT_PLATFORM=linux/amd64 | ||
export DOCKER_DEFAULT_PLATFORM2=linux/amd64 | ||
export DOCKER_AMD64_PLATFORM=linux/amd64 | ||
|
||
offline_lab=false | ||
observability=false | ||
local_deploy=true | ||
vector_search=false | ||
active_search_management=false | ||
shutdown=false | ||
apple_silicon=false | ||
|
||
SOLR_USER=solr | ||
SOLR_PASS=SolrRocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
#!/bin/bash | ||
|
||
source settings.sh # settings.sh is located in the chorus root directory, and since this script is called from there, no "../" prefix here is necessary | ||
source helpers.sh # helpers.sh, ditto | ||
|
||
DATA_DIR="./solr/data" | ||
S3_PRODUCT_VECTORS_LOCATION="https://o19s-public-datasets.s3.amazonaws.com/chorus/product-vectors-2023-02-08" | ||
|
||
if [ ! -f ./solr/data/products-vectors-1.json ]; then | ||
echo -e "${MAJOR}Downloading the products-vectors-1.json.${RESET}" | ||
curl --progress-bar -o ./solr/data/products-vectors-1.json -k https://o19s-public-datasets.s3.amazonaws.com/chorus/product-vectors-2023-02-08/products-vectors-1.json | ||
fi | ||
if [ ! -f ./solr/data/products-vectors-2.json ]; then | ||
echo -e "${MAJOR}Downloading the products-vectors-2.json.${RESET}" | ||
curl --progress-bar -o ./solr/data/products-vectors-2.json -k https://o19s-public-datasets.s3.amazonaws.com/chorus/product-vectors-2023-02-08/products-vectors-2.json | ||
fi | ||
if [ ! -f ./solr/data/products-vectors-3.json ]; then | ||
echo -e "${MAJOR}Downloading the products-vectors-3.json.${RESET}" | ||
curl --progress-bar -o ./solr/data/products-vectors-3.json -k https://o19s-public-datasets.s3.amazonaws.com/chorus/product-vectors-2023-02-08/products-vectors-3.json | ||
fi | ||
if [ ! -f ./solr/data/products-vectors-4.json ]; then | ||
echo -e "${MAJOR}Downloading the products-vectors-4.json.${RESET}" | ||
curl --progress-bar -o ./solr/data/products-vectors-4.json -k https://o19s-public-datasets.s3.amazonaws.com/chorus/product-vectors-2023-02-08/products-vectors-4.json | ||
fi | ||
for i in {1..4} | ||
do | ||
if [ ! -f $DATA_DIR/products-vectors-$i.json ]; then | ||
log_major "Downloading the products-vectors-${i}.json." | ||
retry_until_command_success_and_responseHeader_status_is_zero "curl --progress-bar -o ${DATA_DIR}/products-vectors-${i}.json -k ${S3_PRODUCT_VECTORS_LOCATION}/products-vectors-${i}.json" | ||
fi | ||
done | ||
|
||
cd $DATA_DIR | ||
for f in products-vectors*.json; | ||
do | ||
echo "Populating products from ${f}, please give it a few minutes!" | ||
curl --user solr:SolrRocks 'http://localhost:8983/solr/ecommerce/update?commit=true' --data-binary @"$f" -H 'Content-type:application/json '; | ||
done; | ||
do | ||
log_minor "Populating products from ${f}, please give it a few minutes!" | ||
retry_until_command_success_and_responseHeader_status_is_zero "curl -X POST --user ${SOLR_USER}:${SOLR_PASS} 'http://localhost:8983/solr/ecommerce/update?commit=true' --data-binary @${f} -H 'Content-type:application/json'" | ||
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# This script stops Chorus. | ||
|
||
source settings.sh | ||
source helpers.sh | ||
|
||
docker-compose down -v | ||
if $shutdown; then | ||
exit | ||
fi |