Skip to content

Commit

Permalink
Merge pull request #6369 from samvera/test_app_tweaks
Browse files Browse the repository at this point in the history
Dassie/Koppie/Sirenia tweaks
  • Loading branch information
dlpierce authored Oct 18, 2023
2 parents a06ea55 + 24dca44 commit 368fe3c
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 105 deletions.
60 changes: 22 additions & 38 deletions .dassie/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,26 @@ else
end
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1'
# Use postgresql as the database for Active Record
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootstrap', '~> 4.0'
gem 'coffee-rails', '~> 4.2'
gem 'dalli'
gem 'devise'
gem 'devise-guests', '~> 0.8'
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
gem 'pg', '~> 1.3'
# Use Puma as the app server
gem 'puma'
# Use SCSS for stylesheets
gem 'rails', '~> 6.1'
gem 'riiif', '~> 2.1'
gem 'rsolr', '>= 1.0', '< 3'
gem 'sass-rails', '~> 6.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

gem 'dalli' # mem_cache_store support

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'sidekiq', '~> 6.4'
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

group :development, :test do
gem "debug", ">= 1.0.0"
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-rescue'
end
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'uglifier', '>= 1.3.0'

group :development do
gem 'better_errors' # add command line in browser when errors
Expand All @@ -50,16 +41,9 @@ group :development do
gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')

gem 'bootstrap', '~> 4.0'
gem 'devise'
gem 'devise-guests', '~> 0.8'
gem 'jquery-rails'
gem 'riiif', '~> 2.1'
gem 'rsolr', '>= 1.0', '< 3'
gem 'sidekiq', '~> 6.4'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
group :development, :test do
gem 'debug', '>= 1.0.0'
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-rescue'
end
2 changes: 2 additions & 0 deletions .dassie/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

//= link openseadragon-assets
1 change: 1 addition & 0 deletions .dassie/app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@import "bootstrap-default-overrides";
@import 'bootstrap';
@import 'blacklight/blacklight';
@import "font-awesome";
@import "blacklight_gallery/gallery";
@import "blacklight_gallery/masonry";
Expand Down
10 changes: 5 additions & 5 deletions .koppie/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
APP_NAME=koppie
BUNDLE_GEMFILE=Gemfile.koppie
BUNDLE_PATH=/app/bundle
CH12N_TOOL=fits_servlet
Expand All @@ -20,6 +21,7 @@ HYRAX_VALKYRIE=true
IN_DOCKER=true
KARMA_BROWSER=remote-chromium
KARMA_HOSTNAME=app
MEMCACHED_HOST=memcached
METADATA_DATABASE_NAME=koppie_metadata_development
POSTGRES_DB=koppie
POSTGRES_HOST_AUTH_METHOD=trust
Expand All @@ -41,8 +43,6 @@ SOLR_CORES=koppie
SOLR_HOST=solr
SOLR_PORT=8983
SOLR_URL=http://solr:8983/solr/koppie
VALKYRIE_METADATA_ADAPTER=nurax_pg_metadata_adapter
VALKYRIE_SOLR_CORE=koppie
VALKYRIE_SOLR_HOST=solr
VALKYRIE_SOLR_PORT=8983
VALKYRIE_STORAGE_ADAPTER=disk
SOLR_TEST_URL=http://solr:8983/solr/koppie_test
VALKYRIE_METADATA_ADAPTER=pg_metadata
VALKYRIE_STORAGE_ADAPTER=versioned_disk_storage
10 changes: 6 additions & 4 deletions .koppie/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true
# Attempts to determine if a global gem source has ready been added by another Gemfile
if @sources.global_rubygems_source == Bundler::SourceList.new.global_rubygems_source
Bundler.ui.info '[Koppie] Adding global rubygems source.'
source 'https://rubygems.org'
Expand Down Expand Up @@ -40,8 +42,8 @@ group :development do
end

group :development, :test do
gem "debug", ">= 1.0.0"
gem "pry-doc"
gem "pry-rails"
gem "pry-rescue"
gem 'debug', '>= 1.0.0'
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-rescue'
end
1 change: 1 addition & 0 deletions .koppie/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Application < Rails::Application
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
config.session_store :cookie_store, key: "_#{ENV.fetch('APP_NAME', 'koppie')}_session"

# use SideKiq by default
config.active_job.queue_adapter = :sidekiq
Expand Down
4 changes: 2 additions & 2 deletions .koppie/config/blacklight.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
development:
adapter: solr
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-blacklight-dev" %>
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-blacklight-dev" %>
test: &test
adapter: solr
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
url: <%= ENV['SOLR_TEST_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
production:
adapter: solr
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg" %>
13 changes: 7 additions & 6 deletions .koppie/config/initializers/1_valkyrie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# :nurax_pg_metadata_adapter)
Valkyrie::MetadataAdapter.register(
Valkyrie::Persistence::Postgres::MetadataAdapter.new,
:nurax_pg_metadata_adapter
:pg_metadata
)

Valkyrie::MetadataAdapter.register(
Expand All @@ -35,10 +35,10 @@
base_path: Rails.env,
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(Hyrax::SimpleSchemaLoader.new.permissive_schema_for_valkrie_adapter),
fedora_version: 6
), :nurax_fedora_metadata_adapter
), :fedora_metadata
)

Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :nurax_pg_metadata_adapter }.to_sym
Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :pg_metadata }.to_sym

# shrine_s3_options = {
# bucket: ENV.fetch("REPOSITORY_S3_BUCKET") { "nurax_pg#{Rails.env}" },
Expand All @@ -65,14 +65,15 @@
ENV.fetch('FCREPO_URL') { "http://localhost:8080/fcrepo/rest" })),
base_path: Rails.env,
fedora_version: 6
), :fedora
), :fedora_storage
)

Valkyrie::StorageAdapter.register(
Valkyrie::Storage::VersionedDisk.new(base_path: Rails.root.join("storage", "files"),
file_mover: FileUtils.method(:cp)),
:disk
:versioned_disk_storage
)
Valkyrie.config.storage_adapter = ENV.fetch('VALKYRIE_STORAGE_ADAPTER') { :disk }.to_sym

Valkyrie.config.storage_adapter = ENV.fetch('VALKYRIE_STORAGE_ADAPTER') { :versioned_disk_storage }.to_sym

Valkyrie.config.indexing_adapter = :solr_index
2 changes: 1 addition & 1 deletion .koppie/config/initializers/hyrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
# Identify the model class name that will be used for Collections in your app
# (i.e. ::Collection for ActiveFedora, Hyrax::PcdmCollection for Valkyrie)
# config.collection_model = '::Collection'
config.collection_model = 'Hyrax::PcdmCollection'
# config.collection_model = 'Hyrax::PcdmCollection'
# Injected via `rails g hyrax:collection_resource CollectionResource`
config.collection_model = 'CollectionResource'

Expand Down
2 changes: 1 addition & 1 deletion .koppie/config/solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
development:
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-solr-dev" %>
test: &test
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
url: <%= ENV['TEST_SOLR_URL'] ||ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
production:
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg" %>
14 changes: 4 additions & 10 deletions .koppie/config/valkyrie_index.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
development:
host: <%= ENV['VALKYRIE_SOLR_HOST'] || 'localhost' %>
port: <%= ENV['VALKYRIE_SOLR_PORT'] || 8987 %>
core: <%= ENV['VALKYRIE_SOLR_CORE'] || 'nurax-pg-valkyrie-dev' %>
test:
host: <%= ENV['VALKYRIE_SOLR_HOST'] || 'localhost' %>
port: <%= ENV['VALKYRIE_SOLR_PORT'] || 8987 %>
core: <%= ENV['VALKYRIE_SOLR_CORE'] || 'nurax-pg-test' %>
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/koppie" %>
test: &test
url: <%= ENV['SOLR_TEST_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/koppie-test" %>
production:
host: <%= ENV['VALKYRIE_SOLR_HOST'] %>
port: <%= ENV['VALKYRIE_SOLR_PORT'] %>
core: <%= ENV['VALKYRIE_SOLR_CORE'] %>
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/koppie-prod" %>
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nu

FROM hyrax-base as hyrax-engine-dev

USER root
RUN apk --no-cache add bash \
ffmpeg \
mediainfo \
perl
USER app

ARG APP_PATH=.dassie
ARG BUNDLE_WITHOUT=

Expand Down
13 changes: 3 additions & 10 deletions docker-compose-koppie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ services:
- koppie

sidekiq:
build:
context: .
target: hyrax-engine-dev-worker
args:
- EXTRA_APK_PACKAGES=git less
- APP_PATH=.koppie
- BUNDLE_GEMFILE=Gemfile.koppie
image: samvera/koppie-worker
image: samvera/koppie
entrypoint: dev-entrypoint.sh
command: sh -c 'bundle exec sidekiq'
user: root
Expand All @@ -71,8 +64,8 @@ services:
- hyrax-storage:/app/samvera/hyrax-webapp/storage
- hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
- sidekiq-public:/app/samvera/hyrax-webapp/public
- sidekiq-tmp:/app/samvera/hyrax-webapp/tmp
- rails-public:/app/samvera/hyrax-webapp/public
- rails-tmp:/app/samvera/hyrax-webapp/tmp
networks:
- koppie

Expand Down
29 changes: 12 additions & 17 deletions docker-compose-sirenia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
args:
- EXTRA_APK_PACKAGES=git less
- APP_PATH=.koppie
- BUNDLE_GEMFILE=Gemfile.sirenia
image: samvera/koppie
entrypoint: dev-entrypoint.sh
command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
Expand All @@ -18,9 +17,10 @@ services:
env_file:
- .koppie/.env
environment:
- APP_NAME=sirenia
- RAILS_ROOT=/app/samvera/hyrax-webapp
- VALKYRIE_METADATA_ADAPTER=nurax_fedora_metadata_adapter
- VALKYRIE_STORAGE_ADAPTER=fedora
- VALKYRIE_METADATA_ADAPTER=fedora_metadata
- VALKYRIE_STORAGE_ADAPTER=fedora_storage
depends_on:
- chrome
- db_migrate
Expand All @@ -46,22 +46,16 @@ services:
- sirenia

sidekiq:
build:
context: .
target: hyrax-engine-dev-worker
args:
- EXTRA_APK_PACKAGES=git less
- APP_PATH=.koppie
- BUNDLE_GEMFILE=Gemfile.sirenia
image: samvera/koppie-worker
image: samvera/koppie
entrypoint: dev-entrypoint.sh
command: sh -c 'bundle exec sidekiq'
user: root
env_file:
- .koppie/.env
environment:
- VALKYRIE_METADATA_ADAPTER=nurax_fedora_metadata_adapter
- VALKYRIE_STORAGE_ADAPTER=fedora
- APP_NAME=sirenia
- VALKYRIE_METADATA_ADAPTER=fedora_metadata
- VALKYRIE_STORAGE_ADAPTER=fedora_storage
depends_on:
- db_migrate
- memcached
Expand All @@ -76,8 +70,8 @@ services:
- hyrax-storage:/app/samvera/hyrax-webapp/storage
- hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
- sidekiq-public:/app/samvera/hyrax-webapp/public
- sidekiq-tmp:/app/samvera/hyrax-webapp/tmp
- rails-public:/app/samvera/hyrax-webapp/public
- rails-tmp:/app/samvera/hyrax-webapp/tmp
networks:
- sirenia

Expand All @@ -87,8 +81,9 @@ services:
env_file:
- .koppie/.env
environment:
- VALKYRIE_METADATA_ADAPTER=nurax_fedora_metadata_adapter
- VALKYRIE_STORAGE_ADAPTER=fedora
- APP_NAME=sirenia
- VALKYRIE_METADATA_ADAPTER=fedora_metadata
- VALKYRIE_STORAGE_ADAPTER=fedora_storage
entrypoint: dev-entrypoint.sh
command: db-migrate-seed.sh
depends_on:
Expand Down
14 changes: 3 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ services:
- hyrax

sidekiq:
build:
context: .
target: hyrax-engine-dev-worker
args:
- EXTRA_APK_PACKAGES=git less
- BUNDLE_GEMFILE=Gemfile.dassie
image: samvera/dassie-worker
image: samvera/dassie
entrypoint: dev-entrypoint.sh
command: sh -c 'bundle exec sidekiq'
user: root
Expand All @@ -68,8 +62,8 @@ services:
- bundle:/app/bundle
- hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
- sidekiq-public:/app/samvera/hyrax-webapp/public
- sidekiq-tmp:/app/samvera/hyrax-webapp/tmp
- rails-public:/app/samvera/hyrax-webapp/public
- rails-tmp:/app/samvera/hyrax-webapp/tmp
networks:
- hyrax

Expand Down Expand Up @@ -180,8 +174,6 @@ volumes:
rails-public:
rails-tmp:
redis:
sidekiq-public:
sidekiq-tmp:
solr_home:

networks:
Expand Down

0 comments on commit 368fe3c

Please sign in to comment.