Skip to content

Commit

Permalink
Remove ocfl
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 28, 2024
1 parent 310730a commit 6a1d181
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 152 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ jobs:
run: bin/setup
- name: Run tests
run: bin/rake
- name: Run tests (with OCFL feature flag enabled)
run: SETTINGS__FEATURES__READ_STACKS_FROM_OCFL_ROOT=true bin/rake spec
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ gem 'retries'
gem 'zipline', '~> 1.2'
gem 'jwt'
gem 'redis'
gem 'ocfl'

# connection_pool required for thread-safe operations in dalli >= 3.0
# see https://github.com/petergoldstein/dalli/blob/v3.0.0/3.0-Upgrade.md
Expand Down
44 changes: 0 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,42 +147,6 @@ GEM
docile (1.4.0)
domain_name (0.6.20240107)
drb (2.2.1)
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-monads (1.6.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.4)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-struct (1.6.0)
dry-core (~> 1.0, < 2)
dry-types (>= 1.7, < 2)
ice_nine (~> 0.11)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
ed25519 (1.3.0)
erubi (1.13.0)
faraday (2.9.2)
Expand Down Expand Up @@ -210,7 +174,6 @@ GEM
http-form_data (2.3.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
iiif-image-api (0.2.0)
activesupport
io-console (0.7.2)
Expand Down Expand Up @@ -266,12 +229,6 @@ GEM
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
ocfl (0.9.1)
activesupport (>= 7.0)
dry-monads (~> 1.6)
dry-schema (~> 1.13)
dry-struct (~> 1.6)
zeitwerk (~> 2.0)
okcomputer (1.18.5)
parallel (1.25.1)
parser (3.3.3.0)
Expand Down Expand Up @@ -470,7 +427,6 @@ DEPENDENCIES
jbuilder (~> 2.7)
jwt
newrelic_rpm
ocfl
okcomputer
propshaft
puma (~> 6.0)
Expand Down
25 changes: 1 addition & 24 deletions app/models/storage_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def path_finder
end

def path_finder_class
Settings.features.read_stacks_from_ocfl_root ? OcflPathFinder : LegacyPathFinder
LegacyPathFinder
end

# Calculate file paths in the legacy Stacks structure
Expand All @@ -53,27 +53,4 @@ def absolute_path
File.join(Settings.stacks.storage_root, relative_path)
end
end

# Calculate file paths in the OCFL structure
class OcflPathFinder
def initialize(druid:, file_name:, treeified_id:) # rubocop:disable Lint/UnusedMethodArgument
@druid = druid
@file_name = file_name
end

def relative_path
absolute_path.relative_path_from(Settings.stacks.ocfl_root)
end

def absolute_path
ocfl_object.path(filepath: @file_name)
end

private

def ocfl_object
storage_root = OCFL::StorageRoot.new(base_directory: Settings.stacks.ocfl_root)
storage_root.object(@druid)
end
end
end
3 changes: 0 additions & 3 deletions config/initializers/okcomputer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
OkComputer::Registry.register 'stacks_mounted_dir',
OkComputer::DirectoryCheck.new(Settings.stacks.storage_root)

OkComputer::Registry.register 'stacks_ocfl_mounted_dir',
OkComputer::DirectoryCheck.new(Settings.stacks.ocfl_root) if Settings.features.read_stacks_from_ocfl_root

OkComputer::Registry.register 'purl_url', OkComputer::HttpCheck.new(Settings.purl.url + "status/default.json")

OkComputer::Registry.register 'redis', OkComputer::RedisCheck.new(Settings.cdl.redis.to_h) if Settings.cdl.redis
Expand Down
2 changes: 0 additions & 2 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
features:
streaming_media: true
metrics: false
read_stacks_from_ocfl_root: false

stacks:
storage_root: /stacks
ocfl_root: /stacks/ocfl

imageserver:
base_uri: "http://imageserver-prod.stanford.edu/iiif/2/"
Expand Down
3 changes: 1 addition & 2 deletions config/settings/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ user:
features:
metrics: true

metrics_api_url: 'https://example.com'
metrics_api_url: "https://example.com"

stacks:
storage_root: spec/fixtures
ocfl_root: spec/fixtures/ocfl
Empty file.
36 changes: 0 additions & 36 deletions spec/fixtures/ocfl/nr/349/ct/7889/inventory.json

This file was deleted.

1 change: 0 additions & 1 deletion spec/fixtures/ocfl/nr/349/ct/7889/inventory.json.sha512

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed spec/fixtures/ocfl/nr/349/ct/7889/v1/data/image.jp2
Binary file not shown.
36 changes: 0 additions & 36 deletions spec/fixtures/ocfl/nr/349/ct/7889/v1/inventory.json

This file was deleted.

1 change: 0 additions & 1 deletion spec/fixtures/ocfl/nr/349/ct/7889/v1/inventory.json.sha512

This file was deleted.

0 comments on commit 6a1d181

Please sign in to comment.