From 83a2e2c60ba5ba82229b7bab3233033cc308d074 Mon Sep 17 00:00:00 2001 From: Daniel Pierce Date: Fri, 22 Nov 2024 18:01:27 -0500 Subject: [PATCH] Add sirenia to Github Actions CI; Significant rework of docker compose - All 3 test apps use the same container image. - dassie stays in hyrax-webapp, koppie/sirenia live in hyrax-koppie. - db_migrate service moved to dev-entrypoint in web service. - Worker waits to start until rails app is up, should reduce bundle install racing. - hyrax-engine-dev target now based on hyrax-worker-base. - Chrome is still a pain and randomly stops responding. --- .dassie/.env | 2 +- .dockerignore | 10 ++- .github/workflows/lint-build-test.yml | 28 +++---- .github/workflows/test-results.yml | 2 +- .koppie/.env | 8 +- .koppie/scripts/db-migrate-seed.sh | 9 --- .koppie/scripts/entrypoint.sh | 10 --- Dockerfile | 42 +++------- bin/db-wait.sh | 2 +- bin/dev-entrypoint.sh | 8 +- bin/worker-entrypoint.sh | 8 ++ docker-compose-dassie.yml | 32 ++------ docker-compose-koppie.yml | 71 +++++++---------- docker-compose-sirenia.yml | 110 +++++++++++++------------- lib/hyrax/specs/capybara.rb | 12 ++- spec/spec_helper.rb | 2 +- 16 files changed, 146 insertions(+), 210 deletions(-) delete mode 100755 .koppie/scripts/db-migrate-seed.sh delete mode 100755 .koppie/scripts/entrypoint.sh create mode 100755 bin/worker-entrypoint.sh diff --git a/.dassie/.env b/.dassie/.env index a60efa6dad..627c864604 100644 --- a/.dassie/.env +++ b/.dassie/.env @@ -2,7 +2,7 @@ ANALYTICS_START_DATE=2021-08-21 BUNDLE_GEMFILE=Gemfile.dassie BUNDLE_PATH=/app/bundle CH12N_TOOL=fits_servlet -CHROME_HEADLESS_MODE=false +CHROME_HEADLESS_MODE=true DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5 DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5 diff --git a/.dockerignore b/.dockerignore index 87265459a7..fa9df1be04 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,9 +14,11 @@ artifacts/* coverage/* chart/* -Gemfile.lock -.dassie/Gemfile.lock -.koppie/Gemfile.lock +Gemfile*lock +*/Gemfile*lock -node_modules/* + +node_modules +*/node_modules yarn.lock +*/yarn.lock diff --git a/.github/workflows/lint-build-test.yml b/.github/workflows/lint-build-test.yml index 04be1da356..1b5a38e5ea 100644 --- a/.github/workflows/lint-build-test.yml +++ b/.github/workflows/lint-build-test.yml @@ -1,5 +1,5 @@ name: 'Lint Build Test' -run-name: Link Build Test of ${{ github.ref_name }} by @${{ github.actor }} +run-name: Lint Build Test of ${{ github.ref_name }} by @${{ github.actor }} on: push: branches: @@ -44,29 +44,25 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - ci_test_app: [dassie,koppie] steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and export - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - build-args: | - APP_PATH=.${{ matrix.ci_test_app }} cache-from: type=gha cache-to: type=gha, mode=max context: . target: hyrax-engine-dev - tags: samvera/${{ matrix.ci_test_app }}:latest,samvera/${{ matrix.ci_test_app }}:${{ github.sha }} - outputs: type=docker,dest=/tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar + tags: samvera/hyrax-dev:latest,samvera/hyrax-dev:${{ github.sha }} + outputs: type=docker,dest=/tmp/hyrax-dev-${{ github.sha }}.tar - name: Upload built image artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.ci_test_app }}-image - path: /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar + name: hyrax-dev + path: /tmp/hyrax-dev-${{ github.sha }}.tar test: needs: build @@ -74,9 +70,9 @@ jobs: strategy: fail-fast: false matrix: - ci_test_app: [dassie,koppie] - ci_node_total: [8] - ci_node_index: [0,1,2,3,4,5,6,7] + ci_test_app: [dassie,koppie,sirenia] + ci_node_total: [4] + ci_node_index: [0,1,2,3] steps: - name: Checkout uses: actions/checkout@v4 @@ -89,11 +85,11 @@ jobs: - name: Download built image artifact uses: actions/download-artifact@v4 with: - name: ${{ matrix.ci_test_app }}-image + name: hyrax-dev path: /tmp - name: Start containers run: | - docker load --input /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar + docker load --input /tmp/hyrax-dev-${{ github.sha }}.tar docker image ls -a docker compose -f docker-compose-${{ matrix.ci_test_app }}.yml up -d --quiet-pull --pull missing --no-build - name: RSpec @@ -107,7 +103,7 @@ jobs: if: always() uses: jwalton/gh-docker-logs@v2 with: - images: 'seleniarm/standalone-chromium' + images: 'selenium/standalone-chromium,postgres,fcrepo/fcrepo,solr,redis,samvera/fitsservlet,samvera/fcrepo4' - name: Move Test Files if: always() env: diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml index c1c9e93220..85606861ca 100644 --- a/.github/workflows/test-results.yml +++ b/.github/workflows/test-results.yml @@ -1,5 +1,5 @@ name: Test Results - +run-name: Test Results of ${{ github.ref_name }} by @${{ github.actor }} on: workflow_run: workflows: ["Lint Build Test"] diff --git a/.koppie/.env b/.koppie/.env index 8b654ce695..293e23f316 100644 --- a/.koppie/.env +++ b/.koppie/.env @@ -2,7 +2,7 @@ APP_NAME=koppie BUNDLE_GEMFILE=Gemfile.koppie BUNDLE_PATH=/app/bundle CH12N_TOOL=fits_servlet -CHROME_HEADLESS_MODE=false +CHROME_HEADLESS_MODE=true DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5 DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5 @@ -14,9 +14,9 @@ DB_USERNAME=hyrax_user FCREPO_URL=http://fedoraAdmin:fedoraAdmin@fcrepo:8080/fcrepo/rest FITS_SERVLET_URL=http://fits:8080/fits HUB_URL=http://chrome:4444/wd/hub -HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/ +HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-koppie/derivatives/ HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine -HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/ +HYRAX_UPLOAD_PATH=/app/samvera/hyrax-koppie/uploads/ HYRAX_VALKYRIE=true IN_DOCKER=true KARMA_BROWSER=remote-chromium @@ -29,7 +29,7 @@ POSTGRES_PASSWORD=hyrax_password POSTGRES_USER=hyrax_user RACK_ENV=development RAILS_ENV=development -RAILS_ROOT=.koppie +RAILS_ROOT=/app/samvera/hyrax-koppie RAILS_LOG_TO_STDOUT=false RAILS_QUEUE=sidekiq REDIS_HOST=redis diff --git a/.koppie/scripts/db-migrate-seed.sh b/.koppie/scripts/db-migrate-seed.sh deleted file mode 100755 index ac7f5d9f73..0000000000 --- a/.koppie/scripts/db-migrate-seed.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -db-wait.sh "$DB_HOST:$DB_PORT" -bundle exec rails db:create -bundle exec rails db:migrate - -db-wait.sh "$SOLR_HOST:$SOLR_PORT" -bundle exec rails db:seed diff --git a/.koppie/scripts/entrypoint.sh b/.koppie/scripts/entrypoint.sh deleted file mode 100755 index 91444f2394..0000000000 --- a/.koppie/scripts/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p /app/samvera/hyrax-webapp/tmp/pids -rm -f /app/samvera/hyrax-webapp/tmp/pids/* - -bundle install --quiet - -# Run the command -exec "$@" diff --git a/Dockerfile b/Dockerfile index b3c3b47a02..9aff1d320d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG ALPINE_VERSION=3.19 -ARG RUBY_VERSION=3.2.4 +ARG RUBY_VERSION=3.2.6 FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base @@ -91,40 +91,22 @@ ONBUILD RUN bundle install --jobs "$(nproc)" ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile -FROM hyrax-base as hyrax-engine-dev +FROM hyrax-worker-base as hyrax-engine-dev -USER root -RUN apk --no-cache add bash \ - ffmpeg \ - mediainfo \ - perl USER app - -ARG APP_PATH=.dassie ARG BUNDLE_WITHOUT= - ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine -COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp +COPY --chown=1001:101 .dassie /app/samvera/hyrax-webapp +COPY --chown=1001:101 .koppie /app/samvera/hyrax-koppie COPY --chown=1001:101 . /app/samvera/hyrax-engine RUN bundle -v && \ - bundle install --jobs "$(nproc)" && \ - cd $HYRAX_ENGINE_PATH && \ - bundle install --jobs "$(nproc)" && \ - yarn && yarn cache clean - -RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile - - -FROM hyrax-worker-base as hyrax-engine-dev-worker - -ARG APP_PATH=.dassie -ARG BUNDLE_WITHOUT= - -ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine - -COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp -COPY --chown=1001:101 . /app/samvera/hyrax-engine - -RUN bundle install --jobs "$(nproc)" + BUNDLE_GEMFILE=Gemfile.dassie bundle install --jobs "$(nproc)" && yarn && \ + cd ../hyrax-koppie && BUNDLE_GEMFILE=Gemfile.koppie bundle install --jobs "$(nproc)" && yarn && \ + cd $HYRAX_ENGINE_PATH && bundle install --jobs "$(nproc)" && yarn && \ + yarn cache clean + +# RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile +ENTRYPOINT ["dev-entrypoint.sh"] +CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"] \ No newline at end of file diff --git a/bin/db-wait.sh b/bin/db-wait.sh index 6dc8438f76..afcac40d21 100755 --- a/bin/db-wait.sh +++ b/bin/db-wait.sh @@ -5,9 +5,9 @@ port=$(printf "%s\n" "$1"| cut -d : -f 2) shift 1 +echo "silently waiting for $host:$port" while ! nc -z "$host" "$port" do - echo "waiting for $host:$port" sleep 1 done diff --git a/bin/dev-entrypoint.sh b/bin/dev-entrypoint.sh index 38659431db..e9571316bc 100755 --- a/bin/dev-entrypoint.sh +++ b/bin/dev-entrypoint.sh @@ -1,13 +1,17 @@ #!/bin/sh set -e -mkdir -p /app/samvera/hyrax-webapp/tmp/pids -rm -f /app/samvera/hyrax-webapp/tmp/pids/* +mkdir -p $RAILS_ROOT/tmp/pids +rm -f $RAILS_ROOT/tmp/pids/* + +RUBY_MAJOR=$(ruby -e "puts /^(?'major'\d+)\.(?'minor'\d+)\.(?'patch'\d+)/.match(RUBY_VERSION)[:major]") # Copy gems installed in the image to the dev bundle mkdir -p /app/bundle/ruby/$RUBY_MAJOR.0 cp -Rn /usr/local/bundle/* /app/bundle/ruby/$RUBY_MAJOR.0 bundle install +db-migrate-seed.sh + # Run the command exec "$@" diff --git a/bin/worker-entrypoint.sh b/bin/worker-entrypoint.sh new file mode 100755 index 0000000000..3fdf44f375 --- /dev/null +++ b/bin/worker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +# Wait for web app to avoid racing during bundle install +db-wait.sh web:3000 + +# Run the command +exec "$@" diff --git a/docker-compose-dassie.yml b/docker-compose-dassie.yml index 7d351743aa..1f6e4f48b2 100644 --- a/docker-compose-dassie.yml +++ b/docker-compose-dassie.yml @@ -6,8 +6,7 @@ services: args: - EXTRA_APK_PACKAGES=git less - BUNDLE_GEMFILE=Gemfile.dassie - image: samvera/dassie - entrypoint: dev-entrypoint.sh + image: samvera/hyrax-dev command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000' stdin_open: true tty: true @@ -18,7 +17,6 @@ services: - RAILS_ROOT=/app/samvera/hyrax-webapp depends_on: - chrome - - db_migrate - fcrepo - fits - memcached @@ -41,14 +39,13 @@ services: - hyrax worker: - image: samvera/dassie - entrypoint: dev-entrypoint.sh + image: samvera/hyrax-dev + entrypoint: worker-entrypoint.sh command: sh -c 'bundle exec sidekiq' user: root env_file: - .dassie/.env depends_on: - - db_migrate - fcrepo - fits - memcached @@ -67,27 +64,8 @@ services: networks: - hyrax - db_migrate: - image: samvera/dassie - user: root - env_file: - - .dassie/.env - entrypoint: dev-entrypoint.sh - command: db-migrate-seed.sh - depends_on: - - postgres - volumes: - - ./bin:/app/samvera - - .dassie:/app/samvera/hyrax-webapp - - .:/app/samvera/hyrax-engine - - bundle:/app/bundle - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp - networks: - - hyrax - chrome: - image: seleniarm/standalone-chromium:4 + image: selenium/standalone-chromium:4 environment: - START_XVFB=false - SE_NODE_SESSION_TIMEOUT=800 @@ -103,7 +81,7 @@ services: - hyrax postgres: - image: postgres:15 + image: postgres:15-alpine environment: - POSTGRES_USER=hyrax_user - POSTGRES_PASSWORD=hyrax_password diff --git a/docker-compose-koppie.yml b/docker-compose-koppie.yml index e8e30e902d..d492e6d87c 100644 --- a/docker-compose-koppie.yml +++ b/docker-compose-koppie.yml @@ -7,10 +7,9 @@ services: target: hyrax-engine-dev args: - EXTRA_APK_PACKAGES=git less - - APP_PATH=.koppie - BUNDLE_GEMFILE=Gemfile.koppie - image: samvera/koppie - entrypoint: dev-entrypoint.sh + image: samvera/hyrax-dev + working_dir: /app/samvera/hyrax-koppie command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000' stdin_open: true tty: true @@ -18,10 +17,9 @@ services: env_file: - .koppie/.env environment: - - RAILS_ROOT=/app/samvera/hyrax-webapp + - RAILS_ROOT=/app/samvera/hyrax-koppie depends_on: - chrome - - db_migrate - fits - memcached - postgres @@ -33,26 +31,26 @@ services: - 1049:1048 volumes: - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp + - .koppie:/app/samvera/hyrax-koppie - .:/app/samvera/hyrax-engine - bundle:/app/bundle - - hyrax-storage:/app/samvera/hyrax-webapp/storage - - hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives - - hyrax-uploads:/app/samvera/hyrax-webapp/uploads - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp + - hyrax-storage:/app/samvera/hyrax-koppie/storage + - hyrax-derivatives:/app/samvera/hyrax-koppie/derivatives + - hyrax-uploads:/app/samvera/hyrax-koppie/uploads + - rails-public:/app/samvera/hyrax-koppie/public + - rails-tmp:/app/samvera/hyrax-koppie/tmp networks: - koppie worker: - image: samvera/koppie - entrypoint: dev-entrypoint.sh + image: samvera/hyrax-dev + working_dir: /app/samvera/hyrax-koppie + entrypoint: worker-entrypoint.sh command: sh -c 'bundle exec sidekiq' user: root env_file: - .koppie/.env depends_on: - - db_migrate - fits - memcached - postgres @@ -60,55 +58,40 @@ services: - solr volumes: - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp + - .koppie:/app/samvera/hyrax-koppie - .:/app/samvera/hyrax-engine - bundle:/app/bundle - - hyrax-storage:/app/samvera/hyrax-webapp/storage - - hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives - - hyrax-uploads:/app/samvera/hyrax-webapp/uploads - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp - networks: - - koppie - - db_migrate: - image: samvera/koppie - user: root - env_file: - - .koppie/.env - entrypoint: dev-entrypoint.sh - command: db-migrate-seed.sh - depends_on: - - postgres - - solr - volumes: - - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp - - .:/app/samvera/hyrax-engine - - bundle:/app/bundle - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp + - hyrax-storage:/app/samvera/hyrax-koppie/storage + - hyrax-derivatives:/app/samvera/hyrax-koppie/derivatives + - hyrax-uploads:/app/samvera/hyrax-koppie/uploads + - rails-public:/app/samvera/hyrax-koppie/public + - rails-tmp:/app/samvera/hyrax-koppie/tmp networks: - koppie chrome: - image: seleniarm/standalone-chromium:4 + image: selenium/standalone-chromium:4 environment: - - START_XVFB=false +# - START_XVFB=false - SE_NODE_SESSION_TIMEOUT=800 + - SE_ENABLE_TRACING=false + - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true + - SE_BROWSER_ARGS_DISABLE_DSHM=--disable-dev-shm-usage + - SE_BROWSER_ARGS_HEADLESS=--headless=new # logging: # driver: none volumes: - /dev/shm:/dev/shm - shm_size: 2G + shm_size: 2g ports: - "4446:4444" - "5961:5900" + - "7961:7900" networks: - koppie postgres: - image: postgres:15 + image: postgres:15-alpine env_file: - .koppie/.env ports: diff --git a/docker-compose-sirenia.yml b/docker-compose-sirenia.yml index df9586e745..330fec1227 100644 --- a/docker-compose-sirenia.yml +++ b/docker-compose-sirenia.yml @@ -7,9 +7,9 @@ services: target: hyrax-engine-dev args: - EXTRA_APK_PACKAGES=git less - - APP_PATH=.koppie - image: samvera/koppie - entrypoint: dev-entrypoint.sh + - BUNDLE_GEMFILE=Gemfile.koppie + image: samvera/hyrax-dev + working_dir: /app/samvera/hyrax-koppie command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000' stdin_open: true tty: true @@ -18,12 +18,11 @@ services: - .koppie/.env environment: - APP_NAME=sirenia - - RAILS_ROOT=/app/samvera/hyrax-webapp + - RAILS_ROOT=/app/samvera/hyrax-koppie - VALKYRIE_METADATA_ADAPTER=fedora_metadata - VALKYRIE_STORAGE_ADAPTER=fedora_storage depends_on: - chrome - - db_migrate - fits - memcached - postgres @@ -35,30 +34,31 @@ services: - 1050:1048 volumes: - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp + - .koppie:/app/samvera/hyrax-koppie - .:/app/samvera/hyrax-engine - bundle:/app/bundle - - hyrax-storage:/app/samvera/hyrax-webapp/storage - - hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives - - hyrax-uploads:/app/samvera/hyrax-webapp/uploads - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp + - hyrax-storage:/app/samvera/hyrax-koppie/storage + - hyrax-derivatives:/app/samvera/hyrax-koppie/derivatives + - hyrax-uploads:/app/samvera/hyrax-koppie/uploads + - rails-public:/app/samvera/hyrax-koppie/public + - rails-tmp:/app/samvera/hyrax-koppie/tmp networks: - sirenia worker: - image: samvera/koppie - entrypoint: dev-entrypoint.sh + image: samvera/hyrax-dev + working_dir: /app/samvera/hyrax-koppie + entrypoint: worker-entrypoint.sh command: sh -c 'bundle exec sidekiq' user: root env_file: - .koppie/.env environment: - APP_NAME=sirenia + - RAILS_ROOT=/app/samvera/hyrax-koppie - VALKYRIE_METADATA_ADAPTER=fedora_metadata - VALKYRIE_STORAGE_ADAPTER=fedora_storage depends_on: - - db_migrate - fits - memcached - postgres @@ -66,58 +66,40 @@ services: - solr volumes: - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp + - .koppie:/app/samvera/hyrax-koppie - .:/app/samvera/hyrax-engine - bundle:/app/bundle - - hyrax-storage:/app/samvera/hyrax-webapp/storage - - hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives - - hyrax-uploads:/app/samvera/hyrax-webapp/uploads - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp - networks: - - sirenia - - db_migrate: - image: samvera/koppie - user: root - env_file: - - .koppie/.env - environment: - - APP_NAME=sirenia - - VALKYRIE_METADATA_ADAPTER=fedora_metadata - - VALKYRIE_STORAGE_ADAPTER=fedora_storage - entrypoint: dev-entrypoint.sh - command: db-migrate-seed.sh - depends_on: - - postgres - - solr - volumes: - - ./bin:/app/samvera - - .koppie:/app/samvera/hyrax-webapp - - .:/app/samvera/hyrax-engine - - bundle:/app/bundle - - rails-public:/app/samvera/hyrax-webapp/public - - rails-tmp:/app/samvera/hyrax-webapp/tmp + - hyrax-storage:/app/samvera/hyrax-koppie/storage + - hyrax-derivatives:/app/samvera/hyrax-koppie/derivatives + - hyrax-uploads:/app/samvera/hyrax-koppie/uploads + - rails-public:/app/samvera/hyrax-koppie/public + - rails-tmp:/app/samvera/hyrax-koppie/tmp networks: - sirenia chrome: - image: seleniarm/standalone-chromium:114.0 + image: selenium/standalone-chromium:4 environment: - - START_XVFB=false - logging: - driver: none +# - START_XVFB=false + - SE_NODE_SESSION_TIMEOUT=800 + - SE_ENABLE_TRACING=false + - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true + - SE_BROWSER_ARGS_DISABLE_DSHM=--disable-dev-shm-usage + - SE_BROWSER_ARGS_HEADLESS=--headless=new +# logging: +# driver: none volumes: - /dev/shm:/dev/shm - shm_size: 2G + shm_size: 2g ports: - "4447:4444" - "5962:5900" + - "7962:7900" networks: - sirenia postgres: - image: postgres:15 + image: postgres:15-alpine env_file: - .koppie/.env ports: @@ -128,13 +110,15 @@ services: - sirenia fcrepo: - image: fcrepo/fcrepo:6.5-tomcat9 + image: fcrepo/fcrepo:6.5.1-RC environment: - >- CATALINA_OPTS=-Dfcrepo.home=/fcrepo-home -Djava.awt.headless=true -Dfile.encoding=UTF-8 - -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m - -XX:MaxPermSize=256m -XX:+DisableExplicitGC -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true + -server -Xms1G -Xmx2G -XX:NewSize=256m -XX:MaxNewSize=1G + -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/mem + -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dfcrepo.pid.minter.length=2 -Dfcrepo.pid.minter.count=4 + -Dfcrepo.jms.enabled=false -Dfcrepo.metrics.enable=true - JAVA_OPTS=-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dfcrepo.pid.minter.length=2 -Dfcrepo.pid.minter.count=4 volumes: - fcrepo:/fcrepo-home @@ -184,6 +168,26 @@ services: networks: - sirenia +## Fedora Metrics Tools https://wiki.lyrasis.org/display/FEDORA6x/Metrics +# prometheus: +# image: prom/prometheus:v2.55.1 +# depends_on: +# - fcrepo +# ports: +# - "9090:9090" +# volumes: +# - ./prometheus.yml:/etc/prometheus/prometheus.yml +# networks: +# - sirenia +# grafana: +# image: grafana/grafana:11.3.1 +# depends_on: +# - fcrepo +# ports: +# - "3500:3000" +# networks: +# - sirenia + volumes: bundle: db: diff --git a/lib/hyrax/specs/capybara.rb b/lib/hyrax/specs/capybara.rb index 87d1c28146..f8d092c413 100644 --- a/lib/hyrax/specs/capybara.rb +++ b/lib/hyrax/specs/capybara.rb @@ -19,15 +19,13 @@ def after_teardown Capybara.save_path = ENV['CI'] ? "/tmp/test-results" : Rails.root.join('tmp', 'capybara') options = Selenium::WebDriver::Chrome::Options.new.tap do |opts| - opts.add_argument("--headless") if ENV["CHROME_HEADLESS_MODE"] - opts.add_argument("--no-sandbox") - opts.add_argument("--disable-dev-shm-usage") + opts.add_argument("--headless=new") if ENV["CHROME_HEADLESS_MODE"] + # opts.add_argument("--no-sandbox") + # opts.add_argument("--disable-dev-shm-usage") opts.add_argument("--disable-gpu") if Gem.win_platform? - # Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary - opts.add_argument("--disable-site-isolation-trials") opts.add_argument("--window-size=1440,1440") - opts.add_argument("--enable-features=NetworkService,NetworkServiceInProcess") - opts.add_argument("--disable-features=VizDisplayCompositor") + # opts.add_argument("--enable-features=NetworkService,NetworkServiceInProcess") + # opts.add_argument("--disable-features=VizDisplayCompositor") end Capybara.register_driver :selenium_chrome_headless_sandboxless do |app| diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a9ddfb9b0e..df6457d751 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,7 +25,7 @@ def ci_build? require 'factory_bot' -require File.expand_path("config/environment", '../hyrax-webapp') +require File.expand_path("config/environment", ENV['RAILS_ROOT']) db_config = ActiveRecord::Base.configurations[ENV['RAILS_ENV']] ActiveRecord::Tasks::DatabaseTasks.create(db_config) ActiveRecord::Migrator.migrations_paths = [Pathname.new(ENV['RAILS_ROOT']).join('db', 'migrate').to_s]