Skip to content

Derivative infrastructure switch (remove iiif_print, move towards custom derivatives)#59

Merged
alepbloyd merged 23 commits into
mainfrom
switch-to-custom-derivatives
Feb 20, 2026
Merged

Derivative infrastructure switch (remove iiif_print, move towards custom derivatives)#59
alepbloyd merged 23 commits into
mainfrom
switch-to-custom-derivatives

Conversation

@alepbloyd

Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

What did you change and why?

This PR accomplishes two main things:

  • Removes iiif_print infrastructure - getting this gem to work well with the version of Hyrax we are running is possible, but involved a large number of customizations to the Hyrax code, and the strategy for preparing documents for OCR search and rendering in Universal Viewer (the 'derivative rodeo') creates an object in Fedora for each page of a document, which ends up complicating infrastructure in some odd ways.

  • Sets up the framework for creating custom derivative generation process we're moving towards, partially inspired by processes from iiif_print and the derivative rodeo, but in a pattern that I think is going to be easier to maintain and less obfuscated. This is done by using the HyraxListener and listening for 'on_object_deposited' events, identifying events that apply to the deposited work, and then using that to trigger a 'create_representative_derivatives' job, which in turn will trigger the other jobs for custom derivative creation and attachment of service files to works. A basic frame of this is included in DerivativeServices::WorkImagesToPdfDerivativesService, and the implementation will come in a future PR - largely will be a tidied up version of the process shown in our team meeting two weeks ago. At the moment, this raises and catches an error and successfully triggers a retry of the job, with incrementally increasing time between retries.

  • IMPORTANT: At the moment, this is not actually creating the supplemental derivatives and intentionally short circuiting in the HyraxListener

QA Instructions, Screenshots, Recordings

Build docker images, start containers, exec into rails container and run bundle exec rspec - should be 202 examples, 0 failures, 1 pending.

Added/updated tests?

  • Yes
  • No, and this is why: As discussed, this is more just a foundation/framework PR and I will be adding in the features for creating the derivatives and will accompany those with updates to test suite.
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

@alepbloyd alepbloyd requested a review from dolsysmith February 18, 2026 21:23
@dolsysmith

Copy link
Copy Markdown
Contributor

Noticing this error in the logs starting up:

$ yarn run uv-install && yarn run uv-config
yarn run v1.22.22
$ cp -r ./node_modules/universalviewer/dist ./public/uv
rails        | cp: can't create directory './public/uv': Permission denied
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.

@alepbloyd

Copy link
Copy Markdown
Collaborator Author

Noticing this error in the logs starting up:

$ yarn run uv-install && yarn run uv-config
yarn run v1.22.22
$ cp -r ./node_modules/universalviewer/dist ./public/uv
rails        | cp: can't create directory './public/uv': Permission denied
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.

@dolsysmith I just pushed a commit that I think should fix this. Can you pull and see if you still hit the same issue?

@dolsysmith dolsysmith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice work!

@alepbloyd

Copy link
Copy Markdown
Collaborator Author

Great! I'll go ahead and merge and will hold off on finishing up the custom derivative processes until we get all the other branches reconciled.

@alepbloyd alepbloyd merged commit 462cc52 into main Feb 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants