From 0fd2e2848f76a33baac05cd5b97b88c9e68ab0a7 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Mon, 20 Nov 2023 13:28:40 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Conditional=20enabling=20of=20S3?= =?UTF-8?q?=20for=20pre-processing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: - https://github.com/scientist-softserv/adventist-dl/pull/671 Co-authored-by: Shana Moore --- config/environments/development.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 07317c56..33f7263e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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