Skip to content

Commit

Permalink
Merge pull request #11 from tulibraries/updates-for-new-solrcloud
Browse files Browse the repository at this point in the history
Updates for new solrcloud
  • Loading branch information
dkinzer authored Aug 9, 2024
2 parents 22b30fb + c39ce53 commit 906e4d9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
command: bash .circleci/test.sh
run_deploy:
docker:
- image: cimg/python:3.10.13
- image: cimg/python:3.12.3
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
Expand Down
8 changes: 4 additions & 4 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ echo
echo "***"
echo "* Sending gencon50-$CIRCLE_TAG configs to SolrCloud."
echo "***"
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" --data-binary @/home/circleci/solrconfig.zip "https://solrcloud.tul-infra.page/solr/admin/configs?action=UPLOAD&name=gencon50-$CIRCLE_TAG")
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" --data-binary @/home/circleci/solrconfig.zip "https://solrcloud-rocky8.tul-infra.page/solr/admin/configs?action=UPLOAD&name=gencon50-$CIRCLE_TAG")
validate_status
echo
echo "***"
echo "* Creating new gencon50-$CIRCLE_TAG collection"
echo "***"
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X GET --header 'Accept: application/json' "https://solrcloud.tul-infra.page/solr/admin/collections?action=CREATE&name=gencon50-$CIRCLE_TAG&numShards=1&replicationFactor=4&maxShardsPerNode=1&collection.configName=gencon50-$CIRCLE_TAG")
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X GET --header 'Accept: application/json' "https://solrcloud-rocky8.tul-infra.page/solr/admin/collections?action=CREATE&name=gencon50-$CIRCLE_TAG&numShards=1&replicationFactor=4&maxShardsPerNode=1&collection.configName=gencon50-$CIRCLE_TAG")
validate_status
echo
echo "***"
echo "* Creating qa alias based on configset name."
echo "***"
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" "https://solrcloud.tul-infra.page/solr/admin/collections?action=CREATEALIAS&name=gencon50-$CIRCLE_TAG-qa&collections=gencon50-$CIRCLE_TAG")
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" "https://solrcloud-rocky8.tul-infra.page/solr/admin/collections?action=CREATEALIAS&name=gencon50-$CIRCLE_TAG-qa&collections=gencon50-$CIRCLE_TAG")
validate_status
echo "***"
echo "* Creating prod alias based on configset name."
echo "***"
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" "https://solrcloud.tul-infra.page/solr/admin/collections?action=CREATEALIAS&name=gencon50-$CIRCLE_TAG-prod&collections=gencon50-$CIRCLE_TAG")
RESP=$(curl -u $SOLR_USER:$SOLR_PASSWORD -i -o - --silent -X POST --header "Content-Type:application/octet-stream" "https://solrcloud-rocky8.tul-infra.page/solr/admin/collections?action=CREATEALIAS&name=gencon50-$CIRCLE_TAG-prod&collections=gencon50-$CIRCLE_TAG")
validate_status
echo "***"
echo "* Pushing zip file asset to GitHub release."
Expand Down
6 changes: 3 additions & 3 deletions .circleci/setup_solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ git clone --single-branch --branch main [email protected]:tulibraries/ansible-playb
mkdir -p ansible-playbook-solrcloud/data/tmp/collections
cp -r ~/project ansible-playbook-solrcloud/data/tmp/collections/gencon50-solr
cd ansible-playbook-solrcloud
make build
STATUS=$(docker exec solr1 curl -s -o /dev/null -w "%{http_code}" http://solr1:8983/solr)
make build-lite
STATUS=$(docker exec solr1 curl -s -o /dev/null -w "%{http_code}" http://solr:SolrRocks@solr1:8983/solr)
while [[ "$STATUS" != "302" ]]; do
echo waiting for setup to complete or equal 302.
echo "currently: $STATUS"
sleep 2
STATUS=$(docker exec solr1 curl -s -o /dev/null -w "%{http_code}" http://solr1:8983/solr)
STATUS=$(docker exec solr1 curl -s -o /dev/null -w "%{http_code}" http://solr:SolrRocks@solr1:8983/solr)
done
make create-deploy-collections
make create-deploy-aliases
2 changes: 1 addition & 1 deletion .circleci/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
STATUS=$(docker exec solr1 curl http://solr1:8983/solr/gencon50/admin/ping?wt=json | jq .status)
STATUS=$(docker exec solr1 curl http://solr:SolrRocks@solr1:8983/solr/gencon50/admin/ping?wt=json | jq .status)
if [ "$STATUS" != '"OK"' ]; then
echo "Faling because status is not OK"
echo "status: $STATUS"
Expand Down
3 changes: 1 addition & 2 deletions solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>

<luceneMatchVersion>6.1.0</luceneMatchVersion>
<luceneMatchVersion>8.0.0</luceneMatchVersion>

<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>

Expand All @@ -18,7 +18,6 @@

<!-- solr lib dirs -->
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />

<dataDir>${solr.data.dir:}</dataDir>

Expand Down

0 comments on commit 906e4d9

Please sign in to comment.