Skip to content

Commit

Permalink
Merge pull request #27 from tulibraries/update-to-solr-9.6
Browse files Browse the repository at this point in the history
Update circle to point to rocky
  • Loading branch information
dkinzer authored Jul 11, 2024
2 parents f1c14c4 + 794c0d5 commit 711880f
Show file tree
Hide file tree
Showing 9 changed files with 278 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .circleci/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -e
cd ~/project
zip -r ~/solrconfig.zip . -x .git
zip -r ~/solrconfig.zip . -x ".git*" \
Gemfile Gemfile.lock "spec/*" "vendor/*" \
Makefile ".circle*" LICENSE "README*" \
docker-compose.yml
33 changes: 24 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,38 @@ workflows:
only: /.*/
jobs:
run_tests:
docker:
- image: cimg/python:3.7.11
machine:
image: ubuntu-2004:current
steps:
- checkout
- setup_remote_docker
- add_ssh_keys:
fingerprints:
- "47:44:3f:10:e0:07:49:8b:d3:58:cd:72:2d:de:88:e0"
- restore_cache:
keys:
- gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-cache-v1-{{ arch }}-{{ .Branch }}
- gem-cache-v1
- run:
name: Install Docker Compose
command: |
curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- run:
name: Set up a local Solr with build's solr config.
command: bash .circleci/setup_solr.sh
name: Build the app
command: make up
- save_cache:
key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Test that we can get to the solr collection successfully.
command: bash .circleci/test.sh
name: Run Tests
command: make test

run_deploy:
docker:
- image: cimg/python:3.7.11
- image: cimg/python:3.12.3
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
Expand All @@ -49,7 +64,7 @@ jobs:
- "47:44:3f:10:e0:07:49:8b:d3:58:cd:72:2d:de:88:e0"
- run:
name: Build configuration asset
command: bash .circleci/build.sh
command: make zip
- run:
name: Deploy configuration asset to SolrCloud
command: bash .circleci/deploy.sh
12 changes: 6 additions & 6 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@ validate_create() {
}
echo
echo "***"
echo "* Sending tul_cob-az-$CIRCLE_TAG configs to SolrCloud."
echo "* Sending tul_cob-az-$CIRCLE_TAG configs to solrcloud-rocky8."
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=tul_cob-az-$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=tul_cob-az-$CIRCLE_TAG")
validate_status
echo
echo "***"
echo "* Creating new tul_cob-az-$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=tul_cob-az-$CIRCLE_TAG-init&numShards=1&replicationFactor=4&maxShardsPerNode=1&collection.configName=tul_cob-az-$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=tul_cob-az-$CIRCLE_TAG-init&numShards=1&replicationFactor=4&maxShardsPerNode=1&collection.configName=tul_cob-az-$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=tul_cob-az-$CIRCLE_TAG-qa&collections=tul_cob-az-$CIRCLE_TAG-init")
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=tul_cob-az-$CIRCLE_TAG-qa&collections=tul_cob-az-$CIRCLE_TAG-init")
validate_status
echo
echo "***"
echo "* Creating stage 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=tul_cob-az-$CIRCLE_TAG-stage&collections=tul_cob-az-$CIRCLE_TAG-init")
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=tul_cob-az-$CIRCLE_TAG-stage&collections=tul_cob-az-$CIRCLE_TAG-init")
validate_status
echo
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=tul_cob-az-$CIRCLE_TAG-prod&collections=tul_cob-az-$CIRCLE_TAG-init")
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=tul_cob-az-$CIRCLE_TAG-prod&collections=tul_cob-az-$CIRCLE_TAG-init")
validate_status
echo
echo "***"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.0
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem "rsolr"
gem "rspec"
gem "cob_az_index",
git: "https://github.com/tulibraries/cob_az_index.git",
branch: "main"
178 changes: 178 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
GIT
remote: https://github.com/tulibraries/cob_az_index.git
revision: c7f78b91ebcc22eac4b56118115721173c56bcfd
branch: main
specs:
cob_az_index (0.1.0)
gli (~> 2.18)
httparty
traject (~> 3.1)
traject_plus (>= 1.1, < 3.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
csv (3.3.0)
deprecation (1.1.0)
activesupport
diff-lcs (1.5.1)
domain_name (0.6.20240107)
dot-properties (0.1.4)
bundler (>= 2.2.33)
drb (2.2.1)
faraday (2.10.0)
faraday-net_http (>= 2.0, < 3.2)
logger
faraday-net_http (3.1.0)
net-http
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
gli (2.21.1)
hashie (5.0.0)
http (5.2.0)
addressable (~> 2.8)
base64 (~> 0.1)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)
http-cookie (1.0.6)
domain_name (~> 0.5)
http-form_data (2.3.0)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jsonpath (1.1.5)
multi_json
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.6.0)
marc (1.2.0)
rexml
scrub_rb (>= 1.0.1, < 2)
unf
marc-fastxmlwriter (1.1.0)
marc (~> 1.0)
mini_mime (1.1.5)
minitest (5.24.1)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86-linux)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
public_suffix (6.0.0)
racc (1.8.0)
rake (13.2.1)
rexml (3.3.1)
strscan
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
scrub_rb (1.0.1)
slop (4.10.1)
strscan (3.1.0)
traject (3.8.2)
concurrent-ruby (>= 0.8.0)
dot-properties (>= 0.1.1)
hashie (>= 3.1, < 6)
http (>= 3.0, < 6)
httpclient (~> 2.5)
marc (~> 1.0)
marc-fastxmlwriter (~> 1.0)
nokogiri (~> 1.9)
slop (~> 4.0)
yell
traject_plus (2.0.0)
activesupport
deprecation
jsonpath
traject (~> 3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
uri (0.13.0)
yell (2.2.2)

PLATFORMS
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
cob_az_index!
rsolr
rspec

BUNDLED WITH
2.5.6
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DOCKER := docker-compose

up:
$(DOCKER) up -d
$(DOCKER) exec app bundle install
down:
$(DOCKER) down
tty-app:
$(DOCKER) exec app bash
tty-solr:
$(DOCKER) exec solr bash
test:
$(DOCKER) exec app bundle exec rspec
load-data:
$(DOCKER) exec app load-data
reload-config:
$(DOCKER) exec solr solr-configs-reset
ps:
$(DOCKER) ps
zip:
bash ./.circleci/build.sh
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "3.3"

services:
app:
image: cimg/ruby:3.3.0
working_dir: /app
depends_on:
- solr
tty: true
volumes:
- .:/app
- $PWD/bin/load-data:/bin/load-data
environment:
SOLR_AZ_URL: "http://solr:8983/solr/blacklight"
DO_INGEST: "${DO_INGEST}"
LC_ALL: "C.UTF-8"
BUNDLE_PATH: /app/vendor/bundle

solr:
image: solr:9.6.1
volumes:
- $PWD/bin/solr-configs-reset:/opt/solr/docker/scripts/solr-configs-reset
- $PWD:/opt/solr/conf/tul_cob-az-solr
ports:
- 8983:8983
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- blacklight
- /opt/solr/conf/tul_cob-az-solr
- "-Xms256m"
- "-Xmx512m"

0 comments on commit 711880f

Please sign in to comment.