From 27b7166a4712ec7bbe64b1bbbcdfaba4c3bf3ff7 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Mon, 22 Apr 2024 17:33:33 -0700 Subject: [PATCH 1/9] Update build-test-lint.yaml --- .github/workflows/build-test-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index fd3a87718..713e73842 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -17,7 +17,7 @@ on: jobs: build: - uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.14 + uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.21 secrets: inherit with: platforms: "linux/amd64" From 30d2bf94a570e5889fd3919f7c3763f7354c254a Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Mon, 22 Apr 2024 18:01:05 -0700 Subject: [PATCH 2/9] Update build-test-lint.yaml --- .github/workflows/build-test-lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 713e73842..2cb919a57 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -17,7 +17,7 @@ on: jobs: build: - uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.21 + uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.14 secrets: inherit with: platforms: "linux/amd64" @@ -31,7 +31,7 @@ jobs: workerTarget: hyku-worker lint: needs: build - uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.14 + uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.21 with: webTarget: hyku-base workerTarget: hyku-worker From 856e1626a6369de57b6ac8577e763cb00e1186ea Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 00:24:50 -0700 Subject: [PATCH 3/9] Updating the workflow caller format for the updated actions. The build need to call the targets, each image built is then used for the tests/lint --- .github/workflows/build-test-lint.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 2cb919a57..ef6faf1fd 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -17,21 +17,16 @@ on: jobs: build: - uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.14 + uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.21 secrets: inherit with: platforms: "linux/amd64" - webTarget: hyku-base + webTarget: hyku-web + solrTarget: hyku-solr workerTarget: hyku-worker test: needs: build - uses: scientist-softserv/actions/.github/workflows/test.yaml@v0.0.14 - with: - webTarget: hyku-base - workerTarget: hyku-worker + uses: scientist-softserv/actions/.github/workflows/test.yaml@v0.0.21 lint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.21 - with: - webTarget: hyku-base - workerTarget: hyku-worker From 4d56d9e89808156fd82362bccedbbc04b388dffa Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 01:01:56 -0700 Subject: [PATCH 4/9] Need to specify the hyku-solr image in teh solr dockerfile, need to set the hyku-base versus hyku-web as the Dockerfile only have base and worker --- .github/workflows/build-test-lint.yaml | 2 +- solr/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index ef6faf1fd..be46e69ad 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -21,7 +21,7 @@ jobs: secrets: inherit with: platforms: "linux/amd64" - webTarget: hyku-web + baseTarget: hyku-base solrTarget: hyku-solr workerTarget: hyku-worker test: diff --git a/solr/Dockerfile b/solr/Dockerfile index e89995951..63a66a972 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,4 +1,4 @@ -FROM solr:8.3 +FROM solr:8.3 as hyku-solr ENV SOLR_USER="solr" \ SOLR_GROUP="solr" USER root From 124528625fed8b62260b593c24f7dd5c9df70fd1 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 01:04:57 -0700 Subject: [PATCH 5/9] WebTarget for hyku-base -- yikers --- .github/workflows/build-test-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index be46e69ad..3b16b94ad 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -21,7 +21,7 @@ jobs: secrets: inherit with: platforms: "linux/amd64" - baseTarget: hyku-base + webTarget: hyku-base solrTarget: hyku-solr workerTarget: hyku-worker test: From caa343192702af2fcc02e171e843f24697625964 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 17:20:25 -0700 Subject: [PATCH 6/9] fix the dockerfile to call targets based on updated ghas, update the docker-compose file to retarget the solr image to the clients repo, add target for solr, update to use the correct cache_from :latest -- has to be hard-coded -- fix random errno error on the log in app controller --- .env | 1 - app/controllers/application_controller.rb | 3 ++- docker-compose.yml | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 441e0cba1..0744c1509 100644 --- a/.env +++ b/.env @@ -30,7 +30,6 @@ SOLR_COLLECTION_NAME=hydra-development SOLR_CONFIGSET_NAME=hyku-1 SOLR_HOST=solr SOLR_PORT=8983 -SOLR_TAG=latest SOLR_URL=http://solr:SolrRocks@solr:8983/solr/ # Comment out these 5 for single tenancy / Uncomment for multi diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f1ee40cc2..ba061ded4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,7 +34,8 @@ class ApplicationController < ActionController::Base # rubocop:disable Metrics/AbcSize def global_request_logging - rl = ActiveSupport::Logger.new('log/request.log') + FileUtils.mkdir_p(Rails.root.join('log')) unless Dir.exists?(Rails.root.join('log')) + rl = ActiveSupport::Logger.new(Rails.root.join('log', 'request.log')) if request.host&.match('blc.hykucommons') http_request_header_keys = request.headers.env.keys.select { |header_name| header_name.match("^HTTP.*|^X-User.*") } http_request_headers = request.headers.env.select { |header_name, _header_value| http_request_header_keys.index(header_name) } diff --git a/docker-compose.yml b/docker-compose.yml index a6d040d7a..d6140bf39 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,8 +29,8 @@ x-app-worker: &app-worker - EXTRA_APK_PACKAGES=less vim bash openjdk11-jre ffmpeg rsync exiftool - HYKU_BULKRAX_ENABLED=true cache_from: - - ghcr.io/scientist-softserv/palni-palci:${TAG:-latest} - - ghcr.io/scientist-softserv/palni-palci/worker:${TAG:-latest} + - ghcr.io/scientist-softserv/palni-palci:latest + - ghcr.io/scientist-softserv/palni-palci/worker:latest image: ghcr.io/scientist-softserv/palni-palci/worker:${TAG:-latest} command: sh -l -c 'bundle && bundle exec sidekiq' depends_on: @@ -85,10 +85,11 @@ services: timeout: "8s" solr: - image: ghcr.io/samvera/hyku/solr:${SOLR_TAG:-latest} + image: ghcr.io/scientist-softserv/palni-palci/solr:${TAG:-latest} build: context: solr dockerfile: Dockerfile + target: hyku-solr environment: - OOM=script - SOLR_ADMIN_USER=solr From 21bd0dcc7a7cb4eb1f1974a651cc31302608ab00 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 18:53:20 -0700 Subject: [PATCH 7/9] Update the gemfile to target specific bulkrax version -- get through bundle issues. Update deploy to current v0.0.21, update lint to not use --display-only-failed, as dep on rubocop v0.85.0 and we need a lower version of parser than what the upgrade for rubocop would allow --- .github/workflows/build-test-lint.yaml | 3 +++ .github/workflows/deploy.yaml | 4 ++-- Gemfile | 2 +- Gemfile.lock | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 3b16b94ad..74f5027c3 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -30,3 +30,6 @@ jobs: lint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.21 + with: + rubocop_cmd: 'bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml' + diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 00f26de15..bf009894e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -5,7 +5,7 @@ on: inputs: environment: description: 'Deploy to Environment' - require: true + required: true default: 'staging' type: choice options: @@ -20,5 +20,5 @@ on: jobs: deploy: - uses: scientist-softserv/actions/.github/workflows/deploy.yaml@v0.0.15 + uses: scientist-softserv/actions/.github/workflows/deploy.yaml@v0.0.21 secrets: inherit diff --git a/Gemfile b/Gemfile index de0c851ab..17b75d691 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem 'blacklight_oai_provider', '~> 6.1', '>= 6.1.1' gem 'blacklight_range_limit' gem 'bolognese', '>= 1.9.10' gem 'bootstrap-datepicker-rails' -gem 'bulkrax', '~> 5.0', github: 'samvera-labs/bulkrax', branch: 'main' +gem 'bulkrax', git: 'https://github.com/samvera-labs/bulkrax.git', tag: 'v5.3.0' gem 'byebug', group: %i[development test] gem 'capybara', group: %i[test] gem 'capybara-screenshot', '~> 1.0', group: %i[test] diff --git a/Gemfile.lock b/Gemfile.lock index 3409add9f..7eaa61036 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,8 +20,8 @@ GIT GIT remote: https://github.com/samvera-labs/bulkrax.git - revision: 2e4c9b79c37451fc2d147c0ae12cc4c10ceefa3c - branch: main + revision: f2439755f501caabedf4cc50618d1804e5b2293a + tag: v5.3.0 specs: bulkrax (5.3.0) bagit (~> 0.4) @@ -1424,7 +1424,7 @@ DEPENDENCIES blacklight_range_limit bolognese (>= 1.9.10) bootstrap-datepicker-rails - bulkrax (~> 5.0)! + bulkrax! byebug capybara capybara-screenshot (~> 1.0) From 479d68560b3bd39375cffa0c84e77049a762f71c Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 19:40:59 -0700 Subject: [PATCH 8/9] Junit is not avail in this version of rubocop, ran rubocop and updating app_contr with the suggested update, test out actions branch for if file mv logic --- .github/workflows/build-test-lint.yaml | 4 ++-- app/controllers/application_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 74f5027c3..885da81be 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -26,10 +26,10 @@ jobs: workerTarget: hyku-worker test: needs: build - uses: scientist-softserv/actions/.github/workflows/test.yaml@v0.0.21 + uses: scientist-softserv/actions/.github/workflows/test.yaml@if-file-then-mv lint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.21 with: - rubocop_cmd: 'bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml' + rubocop_cmd: 'bundle exec rubocop --parallel --format progress' diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ba061ded4..5be74c367 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,7 +34,7 @@ class ApplicationController < ActionController::Base # rubocop:disable Metrics/AbcSize def global_request_logging - FileUtils.mkdir_p(Rails.root.join('log')) unless Dir.exists?(Rails.root.join('log')) + FileUtils.mkdir_p(Rails.root.join('log')) unless Dir.exist?(Rails.root.join('log')) rl = ActiveSupport::Logger.new(Rails.root.join('log', 'request.log')) if request.host&.match('blc.hykucommons') http_request_header_keys = request.headers.env.keys.select { |header_name| header_name.match("^HTTP.*|^X-User.*") } From 861a64c7bde8635b73bf2553e9d751729a715d59 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Tue, 23 Apr 2024 20:25:57 -0700 Subject: [PATCH 9/9] Swap back over to the v0.0.21 since back-ported support for fixes --- .github/workflows/build-test-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 885da81be..e77b9039d 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -26,7 +26,7 @@ jobs: workerTarget: hyku-worker test: needs: build - uses: scientist-softserv/actions/.github/workflows/test.yaml@if-file-then-mv + uses: scientist-softserv/actions/.github/workflows/test.yaml@v0.0.21 lint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.21