Skip to content

Commit

Permalink
use docker for testing fcrepo and solr
Browse files Browse the repository at this point in the history
  • Loading branch information
barmintor committed Dec 5, 2023
1 parent d55307f commit e16a059
Show file tree
Hide file tree
Showing 60 changed files with 319 additions and 93 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Expand Up @@ -104,8 +104,6 @@ group :development, :test do
gem 'webdrivers', '~> 5.0', require: false
gem 'database_cleaner'
gem 'factory_bot_rails'
gem 'jettywrapper', '>=2.0.5', git: 'https://github.com/samvera-deprecated/jettywrapper.git', branch: 'master'
gem 'solr_wrapper', '~> 2.0'
gem 'rubocop', '~> 0.53.0', require: false
gem 'rubocop-rspec', '>= 1.20.1', require: false
gem 'rubocop-rails_config', require: false
Expand All @@ -118,5 +116,8 @@ end
# Use Thin for local development
#gem "thin"

# everybody loves rainbows
gem 'rainbow', '~> 3.0'

# Use Puma for local development
gem 'puma', '~> 5.2'
22 changes: 2 additions & 20 deletions Gemfile.lock
@@ -1,14 +1,3 @@
GIT
remote: https://github.com/samvera-deprecated/jettywrapper.git
revision: 6b03c21726a83dcecf09d9b20683bfcd63f106d1
branch: master
specs:
jettywrapper (2.0.5)
activesupport (>= 3.0.0)
childprocess
i18n
rubyzip (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -140,7 +129,6 @@ GEM
activesupport (>= 4.0.0)
mime-types (>= 1.16)
ssrf_filter (~> 1.0)
childprocess (3.0.0)
coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
Expand Down Expand Up @@ -426,11 +414,6 @@ GEM
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
solr_wrapper (2.2.0)
faraday
retriable
ruby-progressbar
rubyzip
solrizer (3.4.1)
activesupport
daemons
Expand Down Expand Up @@ -518,7 +501,6 @@ DEPENDENCIES
devise-guests (~> 0.3)
factory_bot_rails
jbuilder
jettywrapper (>= 2.0.5)!
listen
loofah (>= 2.2.1)
mime-types
Expand All @@ -528,6 +510,7 @@ DEPENDENCIES
puma (~> 5.2)
rack-protection (>= 1.5.5)
rails (~> 6.1.0)
rainbow (~> 3.0)
rdf (>= 1.1.5)
rdf-vocab
redcarpet
Expand All @@ -543,7 +526,6 @@ DEPENDENCIES
rubyzip (>= 1.2.1)
sdoc
selenium-webdriver (~> 4.0)
solr_wrapper (~> 2.0)
sqlite3 (~> 1.4)
uglifier (>= 1.3.0)
view_component (~> 2.82.0)
Expand All @@ -552,4 +534,4 @@ DEPENDENCIES
wowza-secure_token (= 0.0.1)

BUNDLED WITH
2.3.9
2.3.25
4 changes: 2 additions & 2 deletions config/templates/blacklight.template.yml
Expand Up @@ -2,6 +2,6 @@ shared:
adapter: solr
timeout: 120
development:
url: http://localhost:8983/solr/dcv-dev
url: http://localhost:8983/solr/dcv
test:
url: http://localhost:8993/solr/dcv-test
url: http://localhost:9983/solr/dcv
4 changes: 2 additions & 2 deletions config/templates/fedora.template.yml
@@ -1,10 +1,10 @@
test:
url: http://localhost:9983/fedora-test
url: http://localhost:9080/fedora
user: fedoraAdmin
password: fedoraAdmin
time_zone: America/New_York
development:
url: http://localhost:8983/fedora
url: http://localhost:8080/fedora
user: fedoraAdmin
password: fedoraAdmin
time_zone: America/New_York
4 changes: 2 additions & 2 deletions config/templates/solr.template.yml
@@ -1,6 +1,6 @@
development:
url: http://localhost:8983/solr/dcv-dev
url: http://localhost:8983/solr/dcv
timeout: 120
test:
url: http://localhost:8993/solr/dcv-test
url: http://localhost:9983/solr/dcv
timeout: 120
25 changes: 25 additions & 0 deletions docker/docker-compose.development.yml
@@ -0,0 +1,25 @@
version: "3.9"

# Although a name isn't required for docker to work, we want to explicitly specify it so we know
# which prefix is used for the volumes that we create.
name: 'dcv-development'

volumes:
redis-data:
solr-cores:
fedora-data:
services:
solr:
build: ./solr
restart: always
ports:
- '8983:8983'
volumes:
- solr-cores:/data
fedora:
build: ./fedora
restart: always
ports:
- '8080:8080'
volumes:
- fedora-data:/opt/fedora/data
25 changes: 25 additions & 0 deletions docker/docker-compose.test.yml
@@ -0,0 +1,25 @@
version: "3.9"

# Although a name isn't required for docker to work, we want to explicitly specify it so we know
# which prefix is used for the volumes that we create.
name: 'dcv-test'

volumes:
redis-data:
solr-cores:
fedora-data:
services:
solr:
build: ./solr
restart: always
ports:
- '9983:8983'
volumes:
- solr-cores:/data
fedora:
build: ./fedora
restart: always
ports:
- '9080:8080'
volumes:
- fedora-data:/opt/fedora/data
23 changes: 23 additions & 0 deletions docker/fedora/Dockerfile
@@ -0,0 +1,23 @@
# This Dockerfile is based on "samveralabs/fcrepo3:3.8.1" (https://github.com/samvera-labs/fcrepo3/blob/main/Dockerfile),
# but we're not pulling "samveralabs/fcrepo3:3.8.1" in directly because:
# 1) That image isn't built for ARM
# 2) That image references a much slower sourceforge download link (we use GitHub instead).
# 3) We want to run on a different port (8080)
# 4) We want to enable the resource index (ri.enabled=true in install.properties)
# 5) We want to enable authentication with the default username/password (apia.auth.required=true in install.properties)

FROM amazoncorretto:8

ENV FEDORA_HOME /opt/fedora
ENV CATALINA_HOME /opt/fedora/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH

RUN curl -L https://github.com/fcrepo3/fcrepo/releases/download/v3.8.1/fcrepo-installer-3.8.1.jar -o /opt/fcrepo-installer.jar

COPY ./install.properties /opt/install.properties
RUN java -jar /opt/fcrepo-installer.jar /opt/install.properties

EXPOSE 8080
WORKDIR $FEDORA_HOME

CMD ["catalina.sh", "run"]
28 changes: 28 additions & 0 deletions docker/fedora/install.properties
@@ -0,0 +1,28 @@
#Install Options
#Wed Jul 31 20:33:30 UTC 2019
ri.enabled=true
apia.auth.required=true
messaging.enabled=false
database.jdbcDriverClass=org.apache.derby.jdbc.EmbeddedDriver
upstream.auth.enabled=false
ssl.available=false
database.jdbcURL=jdbc\:derby\:/opt/fedora/derby/fedora3;create\=true
database.password=fedoraAdmin
database.username=fedoraAdmin
fesl.authz.enabled=false
tomcat.shutdown.port=8005
deploy.local.services=true
xacml.enabled=false
tomcat.http.port=8080
fedora.serverHost=localhost
database=included
database.driver=included
fedora.serverContext=fedora
llstore.type=akubra-fs
tomcat.home=/opt/fedora/tomcat
fesl.authn.enabled=true
fedora.home=/opt/fedora
install.type=quick
servlet.engine=included
apim.ssl.required=false
fedora.admin.pass=fedoraAdmin
15 changes: 15 additions & 0 deletions docker/solr/Dockerfile
@@ -0,0 +1,15 @@
FROM solr:6.3.0

WORKDIR /data

# Set up template cores in image

COPY --chown=solr:solr './solr_cores/dcv-solr-6-3' /template-cores/dcv
RUN echo 'name=dcv' > /template-cores/dcv/core.properties

# When image runs, the command below will copy template cores to final location (on mounted docker
# volume) if they don't already exist, and then will start solr.

CMD [ ! -d /opt/solr/server/solr/dcv ] && cp -pr /template-cores/dcv /data/dcv && \
ln -s /data/dcv /opt/solr/server/solr/dcv && \
solr-foreground
25 changes: 25 additions & 0 deletions docker/templates/docker-compose.development.yml
@@ -0,0 +1,25 @@
version: "3.9"

# Although a name isn't required for docker to work, we want to explicitly specify it so we know
# which prefix is used for the volumes that we create.
name: 'dcv-development'

volumes:
redis-data:
solr-cores:
fedora-data:
services:
solr:
build: ./solr
restart: always
ports:
- '8983:8983'
volumes:
- solr-cores:/data
fedora:
build: ./fedora
restart: always
ports:
- '8080:8080'
volumes:
- fedora-data:/opt/fedora/data
25 changes: 25 additions & 0 deletions docker/templates/docker-compose.test.yml
@@ -0,0 +1,25 @@
version: "3.9"

# Although a name isn't required for docker to work, we want to explicitly specify it so we know
# which prefix is used for the volumes that we create.
name: 'dcv-test'

volumes:
redis-data:
solr-cores:
fedora-data:
services:
solr:
build: ./solr
restart: always
ports:
- '9983:8983'
volumes:
- solr-cores:/data
fedora:
build: ./fedora
restart: always
ports:
- '9080:8080'
volumes:
- fedora-data:/opt/fedora/data

0 comments on commit e16a059

Please sign in to comment.