Skip to content

Commit

Permalink
Merge pull request #4644 from avalonmediasystem/staging
Browse files Browse the repository at this point in the history
Merge 7.3 Release
  • Loading branch information
apertome authored Mar 16, 2022
2 parents 6daceae + 2c5fe86 commit 366ae85
Show file tree
Hide file tree
Showing 664 changed files with 6,546 additions and 6,642 deletions.
68 changes: 40 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
version: 2.1
orbs:
samvera: samvera/circleci-orb@0
samvera: samvera/circleci-orb@1.0.0
jobs:
build:
docker:
# Primary container image where all steps run.
- image: avalonmediasystem/avalon:7.1-slim-dev-20200324
environment:
- DATABASE_URL=postgresql://postgres@localhost:5432/postgres
- FEDORA_URL=http://localhost:8080/fcrepo/rest
- FEDORA_TIMEOUT=300
- RAILS_ENV=test
# Secondary container image on common network.
- image: postgres:10-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=avalon
- POSTGRES_PASSWORD=password
- image: ualbertalib/docker-fcrepo4:4.7
environment:
CATALINA_OPTS: "-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"
- image: solr:7-alpine
command: bin/solr -cloud -noprompt -f -p <<parameters.solr_port>>
- image: redis:alpine
# Primary container image where all steps run.
- image: avalonmediasystem/avalon:7.3.0-dev
environment:
- DATABASE_URL=postgresql://postgres@localhost:5432/postgres
- FEDORA_URL=http://localhost:8080/fcrepo/rest
- FEDORA_TIMEOUT=300
- RAILS_ENV=test
# Secondary container image on common network.
- image: postgres:10-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=avalon
- POSTGRES_PASSWORD=password
- image: ualbertalib/docker-fcrepo4:4.7
environment:
CATALINA_OPTS: '-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'
- image: solr:7-alpine
command: bin/solr -cloud -noprompt -f -p <<parameters.solr_port>>
- image: redis:alpine

parameters:
ruby_ver:
description: "Ruby version"
default: "2.5.5"
type: "string"
description: 'Ruby version'
default: '2.7'
type: 'string'
solr_port:
type: string
default: '8985'
Expand Down Expand Up @@ -77,7 +77,19 @@ jobs:
- run:
command: ./cc-test-reporter before-build

- samvera/parallel_rspec
# Pull in the parallel_rspec step and modify it to ensure that test results get stored
# - samvera/parallel_rspec
- run:
name: Run rspec in parallel
command: |
mkdir /tmp/test-results
bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec.xml $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
# collect reports
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results

- run:
command: ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
Expand All @@ -94,7 +106,7 @@ jobs:
default: 4
docker:
# Primary container image where all steps run.
- image: avalonmediasystem/avalon:6.x-dev
- image: avalonmediasystem/avalon:7.3.0-dev

working_directory: /home/app/avalon

Expand All @@ -117,10 +129,10 @@ workflows:
build_test_report:
jobs:
- build:
ruby_ver: 2.5.5
name: "Ruby2-5-5"
ruby_ver: '2.7'
name: 'Ruby2-7'
parallelism: 4
- upload-coverage:
parallelism: 4
requires:
- Ruby2-5-5
- Ruby2-7
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
--color
--require spec_helper
--profile
--format progress
74 changes: 48 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Base stage for building gems
FROM ruby:2.5.5-stretch as bundle
RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list \
&& apt-get update && apt-get upgrade -y build-essential \
&& apt-get install -y --no-install-recommends \
FROM ruby:2.7-bullseye as bundle
LABEL stage=build
LABEL project=avalon
RUN apt-get update && apt-get upgrade -y build-essential && apt-get autoremove \
&& apt-get install -y --no-install-recommends --fix-missing \
cmake \
pkg-config \
zip \
git \
libyaz-dev \
ffmpeg \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

Expand All @@ -20,56 +22,66 @@ RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | ta

# Build development gems
FROM bundle as bundle-dev
RUN bundle install --with aws development test postgres --without production
LABEL stage=build
LABEL project=avalon
RUN bundle config set --local without 'production' \
&& bundle config set --local with 'aws development test postgres' \
&& bundle install


# Download binaries in parallel
FROM ruby:2.5.5-stretch as download
FROM ruby:2.7-bullseye as download
LABEL stage=build
LABEL project=avalon
RUN curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz | tar xvz -C /usr/bin/
RUN curl https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip -o /usr/local/bin/chromedriver \
&& chmod +x /usr/local/bin/chromedriver
RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb
RUN mkdir -p /tmp/ffmpeg && cd /tmp/ffmpeg \
&& curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJ \
&& cp `find . -type f -executable` /usr/bin/
RUN apt-get -y update && apt-get install -y ffmpeg


# Base stage for building final images
FROM ruby:2.5.5-slim-stretch as base
RUN apt-get update && apt-get install -y --no-install-recommends curl gnupg2 \
&& curl -sL http://deb.nodesource.com/setup_8.x | bash - \
&& curl -O https://mediaarea.net/repo/deb/repo-mediaarea_1.0-6_all.deb && dpkg -i repo-mediaarea_1.0-6_all.deb \
FROM ruby:2.7-slim-bullseye as base
LABEL stage=build
LABEL project=avalon
RUN echo "deb http://ftp.us.debian.org/debian/ bullseye main contrib non-free" > /etc/apt/sources.list.d/bullseye.list \
&& echo "deb-src http://ftp.us.debian.org/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list.d/bullseye.list \
&& cat /etc/apt/sources.list.d/bullseye.list \
&& apt-get update && apt-get install -y --no-install-recommends curl gnupg2 ffmpeg \
&& curl -sL http://deb.nodesource.com/setup_12.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& cat /etc/apt/sources.list.d/nodesource.list \
&& cat /etc/apt/sources.list.d/yarn.list

RUN apt-get update && apt-get install -y --no-install-recommends --allow-unauthenticated \
yarn \
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get install -y --no-install-recommends --allow-unauthenticated \
nodejs \
yarn \
lsof \
x264 \
sendmail \
git \
libxml2-dev \
libxslt-dev \
libpq-dev \
mediainfo \
openssh-client \
zip \
dumb-init \
libyaz-dev \
libsqlite3-dev \
&& apt-get -y install mediainfo \
&& ln -s /usr/bin/lsof /usr/sbin/


RUN useradd -m -U app \
&& su -s /bin/bash -c "mkdir -p /home/app/avalon" app
WORKDIR /home/app/avalon

COPY --from=download /usr/bin/ff* /usr/bin/



# Build devevelopment image
FROM base as dev
LABEL stage=final
LABEL project=avalon
RUN apt-get install -y --no-install-recommends --allow-unauthenticated \
build-essential \
cmake
Expand All @@ -86,19 +98,27 @@ RUN dpkg -i /chrome.deb || apt-get install -yf

# Build production gems
FROM bundle as bundle-prod
RUN bundle install --without development test --with aws production postgres
LABEL stage=build
LABEL project=avalon
RUN bundle config set --local without 'development test' \
&& bundle config set --local with 'aws production postgres' \
&& bundle install


# Install node modules
FROM node:8.17.0-stretch-slim as node-modules
RUN apt-get update && apt-get install -y --no-install-recommends git
FROM node:12-bullseye-slim as node-modules
LABEL stage=build
LABEL project=avalon
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates
COPY package.json .
COPY yarn.lock .
RUN yarn install


# Build production assets
FROM base as assets
LABEL stage=build
LABEL project=avalon
COPY --from=bundle-prod --chown=app:app /usr/local/bundle /usr/local/bundle
COPY --chown=app:app . .
COPY --from=node-modules --chown=app:app /node_modules ./node_modules
Expand All @@ -113,6 +133,8 @@ RUN cp config/controlled_vocabulary.yml.example config/controlled_vocabu

# Build production image
FROM base as prod
LABEL stage=final
LABEL project=avalon
COPY --from=assets --chown=app:app /home/app/avalon /home/app/avalon
COPY --from=bundle-prod --chown=app:app /usr/local/bundle /usr/local/bundle

Expand Down
49 changes: 22 additions & 27 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
# Core rails
gem 'bootsnap', require: false
gem 'listen'
gem 'rails', '=5.2.4.5'
gem 'rails', '=5.2.6.3'
gem 'sprockets', '~>3.7.2'
gem 'sqlite3'

Expand All @@ -21,52 +21,57 @@ gem 'uglifier', '>= 1.3.0'
gem 'webpacker'

# Core Samvera
gem 'active-fedora', '~> 12.1'
gem 'active_fedora-datastreams', '~> 0.2.0'
gem 'active-fedora', '~> 13.2', '>= 13.2.5'
gem 'active_fedora-datastreams', '~> 0.3'
gem 'fedora-migrate', git: 'https://github.com/avalonmediasystem/fedora-migrate.git', tag: 'avalon-r6.5'
gem 'hydra-head', '~> 10.6'
gem 'hydra-head', '~> 11.0'
gem 'ldp', '~> 1.0.3'
gem 'noid-rails', '~> 3.0.1'
gem 'rdf-rdfxml'
gem 'rdf-vocab', '< 3.1.5'

# Samvera version pins
gem 'blacklight', '< 7.0'
gem 'rdf', '~> 2.2'
gem 'rdf', '~> 3.1'
gem 'rsolr', '~> 1.0'

# Rails & Samvera Plugins
gem 'about_page', git: 'https://github.com/avalonmediasystem/about_page.git', tag: 'avalon-r6.5'
gem 'active_annotations', '~> 0.2.2'
gem 'active_annotations', '~> 0.3'
gem 'activerecord-session_store', '>= 2.0.0'
gem 'acts_as_list'
gem 'api-pagination'
gem 'avalon-about', git: 'https://github.com/avalonmediasystem/avalon-about.git', tag: 'avalon-r6.4'
gem 'bootstrap-sass', '< 3.4.1' # Pin to less than 3.4.1 due to change in behavior with popovers
gem 'bootstrap-toggle-rails'
gem 'bootstrap_form'
gem 'iiif_manifest', '~> 0.6'
gem 'rack-cors', require: 'rack/cors'
gem 'rails_same_site_cookie'
gem 'recaptcha', require: 'recaptcha/rails'
gem 'samvera-persona', '~> 0.1.7'
gem 'samvera-persona', '~> 0.3'
gem 'speedy-af', '~> 0.1.3'

# Avalon Components
gem 'avalon-workflow', git: "https://github.com/avalonmediasystem/avalon-workflow.git", tag: 'avalon-r6.5'

# Authentication & Authorization
gem 'devise', '~> 4.4'
gem 'devise_invitable', '~> 1.6'
gem 'devise', '~> 4.8'
gem 'devise_invitable', '~> 2.0'
gem 'ims-lti', '~> 1.1.13'
gem 'net-ldap'
gem 'omniauth-identity'
gem 'omniauth', '~> 2.0'
gem 'omniauth-identity', '>= 2.0.0'
gem 'omniauth-lti', git: "https://github.com/avalonmediasystem/omniauth-lti.git", tag: 'avalon-r4'
gem "omniauth-saml", "~> 2.0"

# Media Access & Transcoding
gem 'active_encode', '~> 0.7.0'
gem 'active_encode', '~> 0.8.2'
gem 'audio_waveform-ruby', '~> 1.0.7', require: 'audio_waveform'
gem 'browse-everything', '~> 0.13.0'
gem 'browse-everything', git: "https://github.com/avalonmediasystem/browse-everything.git", branch: 'v0.16.1-gdrive-fixes-plus'
gem 'fastimage'
gem 'media_element_add_to_playlist', git: 'https://github.com/avalonmediasystem/media-element-add-to-playlist.git', tag: 'avalon-r6.5'
gem 'mediainfo', git: "https://github.com/avalonmediasystem/mediainfo.git", tag: 'avalon-r6.5'
gem 'mediainfo', git: "https://github.com/avalonmediasystem/mediainfo.git", branch: 'avalon_fixes'
gem 'rest-client', '~> 2.0'
gem 'roo'
gem 'wavefile', '~> 1.0.1'
Expand All @@ -76,22 +81,12 @@ gem 'edtf'
gem 'iconv', '~> 1.0.6'
gem 'marc'

# MediaElement.js & Plugins
gem 'mediaelement_rails', git: 'https://github.com/avalonmediasystem/mediaelement_rails.git', tag: 'avalon-r6_flash-fix'
gem 'media-element-logo-plugin'
gem 'media_element_thumbnail_selector', git: 'https://github.com/avalonmediasystem/media-element-thumbnail-selector', tag: 'avalon-r4'
gem 'mediaelement-hd-toggle', git:'https://github.com/avalonmediasystem/mediaelement-hd-toggle.git', tag: 'avalon-r6.3'
gem 'mediaelement-qualityselector', git:'https://github.com/avalonmediasystem/mediaelement-qualityselector.git', tag: 'avalon-r4'
gem 'mediaelement-skin-avalon', git:'https://github.com/avalonmediasystem/mediaelement-skin-avalon.git', tag: 'avalon-r5'
gem 'mediaelement-title', git:'https://github.com/avalonmediasystem/mediaelement-title.git', tag: 'avalon-r4'
gem 'mediaelement-track-scrubber', git: 'https://github.com/avalonmediasystem/mediaelement-track-scrubber.git', tag: 'avalon-r6'

# Jobs
gem 'activejob-traffic_control'
gem 'activejob-uniqueness'
gem 'redis-rails'
gem 'sidekiq', '~> 5.2.7'
gem 'sidekiq-cron', '~> 1.2'
gem 'sidekiq', '~> 6.2'
gem 'sidekiq-cron', '~> 1.2', git: "https://github.com/avalonmediasystem/sidekiq-cron.git", tag: 'v1.2.1-avalon'

# Coding Patterns
gem 'config'
Expand Down Expand Up @@ -134,7 +129,7 @@ group :test do
gem 'factory_bot_rails'
gem 'fakefs', require: 'fakefs/safe'
gem 'faker'
gem 'hashdiff'
gem 'hashdiff', ">= 1.0"
gem 'rails-controller-testing'
gem 'rspec-its'
gem 'rspec-retry'
Expand All @@ -150,7 +145,7 @@ group :production do
gem 'google-analytics-rails', '1.1.0'
gem 'lograge'
gem 'okcomputer'
gem 'puma'
gem 'puma', '>= 4.3.8'
end

# Install the bundle --with aws when running on Amazon Elastic Beanstalk
Expand Down
Loading

0 comments on commit 366ae85

Please sign in to comment.