Skip to content

Commit 4baa51f

Browse files
authored
Support for Fcrepo 6 in Valkyrie (#6976)
* Convert Ldp::Gone to ObjectNotFoundError Ldp::Gone is the error raised by the fedora adapter when the resource is a tombstone after being deleted. * Use the real metadata adapter * Ensure embargo/lease factory is using DateTime The valkyrie fedora adapter does not convert RDF Date causing comparison failures. In real use the embargo transaction converts to a datetime, but this factory sets the value directly, so let's make it match real use. * Avoid using << on frozen default array in specs * Sometimes the original file is not first in file_ids * Convert Ldp::NotFound to Valkyrie::Persistence::ObjectNotFoundError This fixes file_set_indexer_spec which has a bunch of odd setup and mocking, likely from before our factories were equipped to handle building work/file_set/file_metadata stacks. However, it feels right to include here and be treated as an ObjectNotFoundError. * Fix specs stubbing Hyrax::TimeService with a string * More date format spec fixes * Limit rails versions to speed dependency resolution * Bump valkyrie, use main until new release * Unpin faraday, rdf 3.3.2 fixed the bug * Add sirenia to Github Actions CI; Significant rework of docker compose - All 3 test apps use the same container image. - dassie stays in hyrax-webapp, koppie/sirenia live in hyrax-koppie. - db_migrate service moved to dev-entrypoint in web service. - Worker waits to start until rails app is up, should reduce bundle install racing. - hyrax-engine-dev target now based on hyrax-worker-base. - Chrome is still a pain and randomly stops responding. * rubocop * Docker and GHA fixes Add worker to depends_on to avoid volume copy race. Fix Dockerfile style issues Align chrome service config Corrected container names for log capture * Relax class matcher strictness Now that this spec uses the real valkyrie adapter, the object coming out of wings is really an anonymous descendant of the valkyrie model class. * Restore `rake assets:precompile` for javascript tests * Publish deletion first to avoid encountering tombstones * Use correct rails root * rubocop * Convert custom queries added for statistics to solr * Optimize admin set list (also fixes sorting issues) * Sort the admin sets for real life * :clean_repo for flaky specs * Bump valkyrie version * Rename db-wait.sh script to service-wait.sh * Return Resources instead of SolrHits * Undo running koppie/sirenia from hyrax-koppie dir * We are not yet compatible with v1 of openseadragon gem
1 parent dd6f355 commit 4baa51f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+241
-340
lines changed

.dassie/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ANALYTICS_START_DATE=2021-08-21
22
BUNDLE_GEMFILE=Gemfile.dassie
33
BUNDLE_PATH=/app/bundle
44
CH12N_TOOL=fits_servlet
5-
CHROME_HEADLESS_MODE=false
5+
CHROME_HEADLESS_MODE=true
66
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
77
DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
88
DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5

.dassie/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gem 'jbuilder', '~> 2.5'
3030
gem 'jquery-rails'
3131
gem 'pg', '~> 1.3'
3232
gem 'puma'
33-
gem 'rails', '~> 6.1'
33+
gem 'rails', '~> 6.1', '>= 6.1.7.10'
3434
gem 'riiif', '~> 2.1'
3535
gem 'rsolr', '>= 1.0', '< 3'
3636
gem 'sass-rails', '~> 6.0'

.dockerignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ artifacts/*
1414
coverage/*
1515
chart/*
1616

17-
Gemfile.lock
18-
.dassie/Gemfile.lock
19-
.koppie/Gemfile.lock
17+
Gemfile*lock
18+
*/Gemfile*lock
2019

21-
node_modules/*
20+
21+
node_modules
22+
*/node_modules
2223
yarn.lock
24+
*/yarn.lock

.github/workflows/lint-build-test.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Lint Build Test'
2-
run-name: Link Build Test of ${{ github.ref_name }} by @${{ github.actor }}
2+
run-name: Lint Build Test of ${{ github.ref_name }} by @${{ github.actor }}
33
on:
44
push:
55
branches:
@@ -44,39 +44,35 @@ jobs:
4444
runs-on: ubuntu-latest
4545
strategy:
4646
fail-fast: false
47-
matrix:
48-
ci_test_app: [dassie,koppie]
4947
steps:
5048
- name: Checkout
5149
uses: actions/checkout@v4
5250
- name: Set up Docker Buildx
5351
uses: docker/setup-buildx-action@v3
5452
- name: Build and export
55-
uses: docker/build-push-action@v5
53+
uses: docker/build-push-action@v6
5654
with:
57-
build-args: |
58-
APP_PATH=.${{ matrix.ci_test_app }}
5955
cache-from: type=gha
6056
cache-to: type=gha, mode=max
6157
context: .
6258
target: hyrax-engine-dev
63-
tags: samvera/${{ matrix.ci_test_app }}:latest,samvera/${{ matrix.ci_test_app }}:${{ github.sha }}
64-
outputs: type=docker,dest=/tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar
59+
tags: samvera/hyrax-dev:latest,samvera/hyrax-dev:${{ github.sha }}
60+
outputs: type=docker,dest=/tmp/hyrax-dev-${{ github.sha }}.tar
6561
- name: Upload built image artifact
6662
uses: actions/upload-artifact@v4
6763
with:
68-
name: ${{ matrix.ci_test_app }}-image
69-
path: /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar
64+
name: hyrax-dev
65+
path: /tmp/hyrax-dev-${{ github.sha }}.tar
7066

7167
test:
7268
needs: build
7369
runs-on: ubuntu-latest
7470
strategy:
7571
fail-fast: false
7672
matrix:
77-
ci_test_app: [dassie,koppie]
78-
ci_node_total: [8]
79-
ci_node_index: [0,1,2,3,4,5,6,7]
73+
ci_test_app: [dassie,koppie,sirenia]
74+
ci_node_total: [4]
75+
ci_node_index: [0,1,2,3]
8076
steps:
8177
- name: Checkout
8278
uses: actions/checkout@v4
@@ -89,11 +85,11 @@ jobs:
8985
- name: Download built image artifact
9086
uses: actions/download-artifact@v4
9187
with:
92-
name: ${{ matrix.ci_test_app }}-image
88+
name: hyrax-dev
9389
path: /tmp
9490
- name: Start containers
9591
run: |
96-
docker load --input /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar
92+
docker load --input /tmp/hyrax-dev-${{ github.sha }}.tar
9793
docker image ls -a
9894
docker compose -f docker-compose-${{ matrix.ci_test_app }}.yml up -d --quiet-pull --pull missing --no-build
9995
- name: RSpec
@@ -107,7 +103,7 @@ jobs:
107103
if: always()
108104
uses: jwalton/gh-docker-logs@v2
109105
with:
110-
images: 'seleniarm/standalone-chromium'
106+
images: 'selenium/standalone-chromium,postgres,fcrepo/fcrepo,solr,bitnami/redis,ghcr.io/samvera/fitsservlet,ghcr.io/samvera/fcrepo4'
111107
- name: Move Test Files
112108
if: always()
113109
env:

.github/workflows/test-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Test Results
2-
2+
run-name: Test Results of ${{ github.ref_name }} by @${{ github.actor }}
33
on:
44
workflow_run:
55
workflows: ["Lint Build Test"]

.koppie/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ APP_NAME=koppie
22
BUNDLE_GEMFILE=Gemfile.koppie
33
BUNDLE_PATH=/app/bundle
44
CH12N_TOOL=fits_servlet
5-
CHROME_HEADLESS_MODE=false
5+
CHROME_HEADLESS_MODE=true
66
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
77
DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
88
DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5
@@ -29,7 +29,7 @@ POSTGRES_PASSWORD=hyrax_password
2929
POSTGRES_USER=hyrax_user
3030
RACK_ENV=development
3131
RAILS_ENV=development
32-
RAILS_ROOT=.koppie
32+
RAILS_ROOT=/app/samvera/hyrax-webapp
3333
RAILS_LOG_TO_STDOUT=false
3434
RAILS_QUEUE=sidekiq
3535
REDIS_HOST=redis

.koppie/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gem 'jbuilder', '~> 2.5'
3030
gem 'jquery-rails'
3131
gem 'pg', '~> 1.3'
3232
gem 'puma'
33-
gem 'rails', '~> 6.1'
33+
gem 'rails', '~> 6.1', '>= 6.1.7.10'
3434
gem 'riiif', '~> 2.1'
3535
gem 'rsolr', '>= 1.0', '< 3'
3636
gem 'sass-rails', '~> 6.0'

.koppie/scripts/db-migrate-seed.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.koppie/scripts/entrypoint.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

Dockerfile

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG ALPINE_VERSION=3.19
2-
ARG RUBY_VERSION=3.2.4
2+
ARG RUBY_VERSION=3.2.6
33

4-
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base
4+
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION AS hyrax-base
55

66
ARG DATABASE_APK_PACKAGE="postgresql-dev"
77
ARG EXTRA_APK_PACKAGES="git"
@@ -49,7 +49,7 @@ ENTRYPOINT ["hyrax-entrypoint.sh"]
4949
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
5050

5151

52-
FROM hyrax-base as hyrax
52+
FROM hyrax-base AS hyrax
5353

5454
ARG APP_PATH=.
5555
ARG BUNDLE_WITHOUT="development test"
@@ -59,7 +59,7 @@ ONBUILD RUN bundle install --jobs "$(nproc)"
5959
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
6060

6161

62-
FROM hyrax-base as hyrax-worker-base
62+
FROM hyrax-base AS hyrax-worker-base
6363

6464
USER root
6565
RUN apk --no-cache add bash \
@@ -78,10 +78,10 @@ RUN mkdir -p /app/fits && \
7878
sed -i 's/\(<tool.*TikaTool.*>\)/<!--\1-->/' /app/fits/xml/fits.xml
7979
ENV PATH="${PATH}:/app/fits"
8080

81-
CMD bundle exec sidekiq
81+
CMD ["bundle", "exec", "sidekiq"]
8282

8383

84-
FROM hyrax-worker-base as hyrax-worker
84+
FROM hyrax-worker-base AS hyrax-worker
8585

8686
ARG APP_PATH=.
8787
ARG BUNDLE_WITHOUT="development test"
@@ -91,40 +91,19 @@ ONBUILD RUN bundle install --jobs "$(nproc)"
9191
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
9292

9393

94-
FROM hyrax-base as hyrax-engine-dev
94+
FROM hyrax-worker-base AS hyrax-engine-dev
9595

96-
USER root
97-
RUN apk --no-cache add bash \
98-
ffmpeg \
99-
mediainfo \
100-
perl
10196
USER app
102-
103-
ARG APP_PATH=.dassie
10497
ARG BUNDLE_WITHOUT=
98+
ENV HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
10599

106-
ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine
107-
108-
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
100+
COPY --chown=1001:101 .dassie /app/samvera/hyrax-webapp
109101
COPY --chown=1001:101 . /app/samvera/hyrax-engine
110102

111103
RUN bundle -v && \
112-
bundle install --jobs "$(nproc)" && \
113-
cd $HYRAX_ENGINE_PATH && \
114-
bundle install --jobs "$(nproc)" && \
115-
yarn && yarn cache clean
116-
117-
RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
118-
119-
120-
FROM hyrax-worker-base as hyrax-engine-dev-worker
121-
122-
ARG APP_PATH=.dassie
123-
ARG BUNDLE_WITHOUT=
124-
125-
ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine
126-
127-
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
128-
COPY --chown=1001:101 . /app/samvera/hyrax-engine
104+
BUNDLE_GEMFILE=Gemfile.dassie bundle install --jobs "$(nproc)" && yarn && \
105+
cd $HYRAX_ENGINE_PATH && bundle install --jobs "$(nproc)" && yarn && \
106+
yarn cache clean
129107

130-
RUN bundle install --jobs "$(nproc)"
108+
ENTRYPOINT ["dev-entrypoint.sh"]
109+
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]

0 commit comments

Comments
 (0)