Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2 knapsack pals #8

Merged
merged 21 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-test-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
confdir: '/app/samvera/hyrax-webapp/solr/conf'
webTarget: hyku-web
workerTarget: hyku-worker
rspec_cmd: "cd .. && gem install semaphore_test_boosters && bundle && rspec_booster --job $CI_NODE_INDEX/$CI_NODE_TOTAL"

lint:
needs: build
uses: scientist-softserv/actions/.github/workflows/[email protected]
with:
webTarget: hyku-web
workerTarget: hyku-worker
rubocop_cmd: "cd .. && bundle && bundle exec rubocop --parallel --format progress"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ scratch.md
*~undo-tree~
.env.*
.DS_Store

/coverage
18 changes: 17 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
FROM ghcr.io/samvera/hyku/base:latest as hyku-web
FROM ghcr.io/samvera/hyku/base:latest as hyku-knap-base

# This is specifically NOT $APP_PATH but the parent directory
COPY --chown=1001:101 . /app/samvera
ENV BUNDLE_LOCAL__HYKU_KNAPSACK=/app/samvera
ENV BUNDLE_DISABLE_LOCAL_BRANCH_CHECK=true

# Ensure root permissions for installing Tesseract data
USER root

# Install "best" training data for Tesseract
RUN echo "📚 Installing Tesseract Best (training data)!" && \
wget https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata -O /usr/share/tessdata/eng_best.traineddata

# Switch back to the non-root user for running the application
USER app

FROM hyku-knap-base as hyku-web
RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DB_URL='postgresql://fake' bundle exec rake assets:precompile && yarn install

CMD ./bin/web

FROM hyku-web as hyku-worker
Expand Down
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

Expand All @@ -6,3 +8,11 @@ gemspec

# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"

gemfile_path = File.expand_path("hyrax-webapp/Gemfile", __dir__)
if File.exist?(gemfile_path)
gemfile = File.read(gemfile_path).split("\n").reject { |l| l.match('knapsack') }
# rubocop:disable Security/Eval
eval(gemfile.join("\n"), binding)
# rubocop:enable Security/Eval
end
Loading
Loading