Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
🧹 Conditional enabling of S3 for pre-processing
Browse files Browse the repository at this point in the history
The default assumption of IIIF Print was S3 for pre-processing.  That
does not hold well for local development.  So I'm adding a configuration
to say "Use S3 if we have credentials" Otherwise don't.  This will
probably move to IIIF Print; but right now we have a slow build on IIIF
Print.

Related to:

- #671

Co-authored-by: Shana Moore <[email protected]>
  • Loading branch information
jeremyf and Shana Moore committed Nov 22, 2023
1 parent 92879b9 commit 0fd2e28
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker

##
# In the development environment we may not have AWS credentials. When we do, let's use s3. When
# we don't, we'll use local files (which almost certainly will fail). This means we'd be locally
# using the derivative rodeo's splitting process (which should work without a preprocess lcoation).
if DerivativeRodeo.config.aws_s3_access_key_id.present? && DerivativeRodeo.config.aws_s3_secret_access_key.present?
IiifPrint::DerivativeRodeoService.preprocessed_location_adapter_name = 's3'
else
IiifPrint::DerivativeRodeoService.preprocessed_location_adapter_name = 'file'
end
end

0 comments on commit 0fd2e28

Please sign in to comment.