Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Signed-off-by: Pratap Chand <[email protected]>
  • Loading branch information
Pratap Chand committed Apr 3, 2020
2 parents 965cd37 + 88c8ba1 commit b645cc7
Show file tree
Hide file tree
Showing 3,414 changed files with 189,037 additions and 146,225 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 13 additions & 0 deletions .dive-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
rules:
# If the efficiency is measured below X%, mark as failed.
# Expressed as a ratio between 0-1.
lowestEfficiency: 0.80

# If the amount of wasted space is at least X or larger than X, mark as failed.
# Expressed in B, KB, MB, and GB.
highestWastedBytes: 1GB

# If the amount of wasted space makes up for X% or more of the image, mark as failed.
# Note: the base image layer is NOT included in the total image size.
# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
highestUserWastedPercent: 0.20
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
build/
!build/vendor/woff-code-latest.zip
!build/gergich/
!build/new-jenkins/package-translations
!build/new-jenkins/
docker-compose/
!docker-compose/config/*
docker-compose.local.*.yml
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
/db/schema.rb
/db/*.sqlite*
/db/*sql
docker-compose.override.yml
/exports/
Gemfile.lock
Gemfile.lock.next
knapsack_rspec_report.json
/log/
mkmf.log
/node_modules
Expand Down Expand Up @@ -81,3 +81,6 @@ docker-compose.local.*
.nyc_output
coverage-jest
coverage-karma

# generated graphql schema
schema.graphql
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ Layout/DotPosition:
EnforcedStyle: trailing
Layout/AlignHash:
Enabled: false
Layout/AlignParameters:
Enabled: false
Style/Lambda:
Enabled: false
Style/WhileUntilModifier:
Expand Down
53 changes: 25 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
# To update this file please edit the relevant template and run the generation
# task `build/dockerfile_writer.rb`

# See doc/docker/README.md or https://github.com/instructure/canvas-lms/tree/master/doc/docker
FROM instructure/ruby-passenger:2.4-xenial
# For documentation, please check doc/docker/README.md in
# this local repo which is also published at:
# https://github.com/instructure/canvas-lms/tree/master/doc/docker
ARG RUBY_PASSENGER=2.4-xenial
FROM instructure/ruby-passenger:$RUBY_PASSENGER
ARG POSTGRES_VERSION=9.5

ENV APP_HOME /usr/src/app/
ENV RAILS_ENV "production"
ENV NGINX_MAX_UPLOAD_SIZE 10g
ENV YARN_VERSION 1.19.1-1

# Work around github.com/zertosh/v8-compile-cache/issues/2
# This can be removed once yarn pushes a release including the fixed version
# of v8-compile-cache.
ENV DISABLE_V8_COMPILE_CACHE 1

USER root
WORKDIR /root
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
Expand All @@ -30,11 +29,11 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
libxmlsec1-dev \
python-lxml \
libicu-dev \
postgresql-client-9.5 \
parallel \
postgresql-client-$POSTGRES_VERSION \
unzip \
pbzip2 \
fontforge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0

Expand All @@ -44,7 +43,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& find $GEM_HOME ! -user docker | xargs chown docker:docker

# We will need sfnt2woff in order to build fonts
COPY build/vendor/woff-code-latest.zip ./
COPY --chown=docker:docker build/vendor/woff-code-latest.zip ./
RUN unzip woff-code-latest.zip -d woff \
&& cd woff \
&& make \
Expand All @@ -54,23 +53,23 @@ RUN unzip woff-code-latest.zip -d woff \

WORKDIR $APP_HOME

COPY Gemfile ${APP_HOME}
COPY Gemfile.d ${APP_HOME}Gemfile.d
COPY config ${APP_HOME}config
COPY --chown=docker:docker gems ${APP_HOME}gems
COPY --chown=docker:docker packages ${APP_HOME}packages
COPY script ${APP_HOME}script
COPY package.json ${APP_HOME}
COPY yarn.lock ${APP_HOME}
COPY babel.config.js ${APP_HOME}
COPY --chown=docker:docker Gemfile ${APP_HOME}
COPY --chown=docker:docker Gemfile.d ${APP_HOME}Gemfile.d
COPY --chown=docker:docker config ${APP_HOME}config
COPY --chown=docker:docker gems ${APP_HOME}gems
COPY --chown=docker:docker packages ${APP_HOME}packages
COPY --chown=docker:docker script ${APP_HOME}script
COPY --chown=docker:docker package.json ${APP_HOME}
COPY --chown=docker:docker yarn.lock ${APP_HOME}
COPY --chown=docker:docker babel.config.js ${APP_HOME}
COPY --chown=docker:docker build/new-jenkins ${APP_HOME}build/new-jenkins

# Install deps as docker to avoid sadness w/ npm lifecycle hooks
USER docker
# if yarn hits a snag try one more time with concurrency set to 1
# https://github.com/yarnpkg/yarn/issues/2629
RUN bundle install --jobs 8 \
&& yarn install --pure-lockfile
USER root

COPY . $APP_HOME
&& (yarn install --pure-lockfile || yarn install --pure-lockfile --network-concurrency 1)
COPY --chown=docker:docker . $APP_HOME
RUN mkdir -p .yardoc \
app/stylesheets/brandable_css_brands \
app/views/info \
Expand All @@ -94,11 +93,9 @@ RUN mkdir -p .yardoc \
tmp \
/home/docker/.bundler/ \
/home/docker/.cache/yarn \
/home/docker/.gem/ \
&& find ${APP_HOME} /home/docker ! -user docker -print0 | xargs -0 chown -h docker:docker
/home/docker/.gem/

USER docker
# update Gemfile.lock in cases where a lock file was pulled in during the `COPY . $APP_HOME` step
# update Gemfile.lock in cases where a lock file was pulled in during the `COPY --chown=docker:docker . $APP_HOME` step
RUN bundle lock --local --conservative

# TODO: switch to canvas:compile_assets_dev once we stop using this Dockerfile in production/e2e
Expand Down
12 changes: 4 additions & 8 deletions Dockerfile-production
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
# To update this file please edit the relevant template and run the generation
# task `build/dockerfile_writer.rb`

# See doc/docker/README.md or https://github.com/instructure/canvas-lms/tree/master/doc/docker
# For documentation, please check doc/docker/README.md in
# this local repo which is also published at:
# https://github.com/instructure/canvas-lms/tree/master/doc/docker
FROM instructure/ruby-passenger:2.4-xenial

ENV APP_HOME /usr/src/app/
ENV RAILS_ENV "production"
ENV NGINX_MAX_UPLOAD_SIZE 10g
ENV YARN_VERSION 1.19.1-1

# Work around github.com/zertosh/v8-compile-cache/issues/2
# This can be removed once yarn pushes a release including the fixed version
# of v8-compile-cache.
ENV DISABLE_V8_COMPILE_CACHE 1

USER root
WORKDIR /root
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
Expand All @@ -28,7 +25,6 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
libxmlsec1-dev \
python-lxml \
libicu-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0

Expand All @@ -40,7 +36,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="

WORKDIR $APP_HOME

COPY . $APP_HOME
COPY --chown=docker:docker . $APP_HOME

# optimizing for size here ... get all the dev dependencies so we can
# compile assets, then throw away everything we don't need
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.d/_before.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#

gem 'bundler', '>= 1.13.3', '<= 2.0.2'
gem 'bundler', '>= 1.13.3', '<= 2.1.4'

if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('1.14.0') &&
Gem::Version.new(Gem::VERSION) < Gem::Version.new('2.6.9')
raise "Please run `gem update --system` to bring RubyGems to 2.6.9 or newer for use with Bundler 1.14 or newer."
end

# NOTE: this has to use 1.8.7 hash syntax to not raise a parser exception on 1.8.7
if RUBY_VERSION >= "2.4.0" && RUBY_VERSION < "2.6"
if RUBY_VERSION >= "2.4.0" && RUBY_VERSION < "2.7"
ruby RUBY_VERSION, :engine => 'ruby', :engine_version => RUBY_VERSION
elsif RUBY_VERSION >= "2.6.0" && RUBY_VERSION < "2.7"
$stderr.puts "Ruby 2.6 support is untested" unless ENV['SUPPRESS_RUBY_WARNING']
elsif RUBY_VERSION >= "2.7.0" && RUBY_VERSION < "2.8"
$stderr.puts "Ruby 2.7+ support is untested" unless ENV['SUPPRESS_RUBY_WARNING']
ruby RUBY_VERSION, :engine => 'ruby', :engine_version => RUBY_VERSION
else
ruby '2.4.0', :engine => 'ruby', :engine_version => '2.4.0'
Expand Down
Loading

0 comments on commit b645cc7

Please sign in to comment.