8000 Rails 6: Graphql class based approach by Tooyosi · Pull Request #1623 · zooniverse/caesar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rails 6: Graphql class based approach #1623

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
40 changes: 40 additions & 0 deletions Dockerfile.rails-next
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ruby:2.7-slim
WORKDIR /app

RUN apt-get update && \
apt-get install --no-install-recommends -y \
build-essential \
libpq-dev \
nodejs \
libjemalloc2 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# configure jemalloc v5 with v3 behaviours (trade ram usage over performance)
# https://twitter.com/nateberkopec/status/1442894624935137288
# https://github.com/code-dot-org/code-dot-org/blob/5c8b24674d1c2f7e51e85dd32124e113dc423d84/cookbooks/cdo-jemalloc/attributes/default.rb#L10
ENV MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0"
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

ADD ./Gemfile.next /app/
ADD ./Gemfile.next.lock /app/

# ensure we use the rails-next gemfile setup to ensure we boot the upgraded libaries
ENV BUNDLE_GEMFILE=Gemfile.next

ENV PORT=80
ARG RAILS_ENV=production
ENV RAILS_ENV=$RAILS_ENV

RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` && \
if echo "development test" | grep -w "$RAILS_ENV"; then \
bundle install; \
else bundle install --without development test; fi

ADD ./ /app

RUN (cd /app && mkdir -p tmp/pids)
RUN (cd /app && SECRET_KEY_BASE=1 bundle exec rails assets:precompile)

EXPOSE 80

CMD ["/app/docker/start-puma.sh"]
15 changes: 13 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def next?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

File.basename(__FILE__) == "Gemfile.next"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

end
source 'https://rubygems.org'

git_source(:github) do |repo_name|
Expand All @@ -8,7 +11,11 @@ end
gem 'active_record_extended'
gem 'httparty'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2'
if next?
gem "rails", '~> 6.0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

else
gem 'rails', '~> 5.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundler/DuplicatedGem: Gem rails requirements already given on line 15 of the Gemfile.

end
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.3'
# Use Puma as the app server
Expand Down Expand Up @@ -42,6 +49,8 @@ gem 'logstash-event'
gem "sentry-raven"
gem 'omniauth'
gem 'omniauth-zooniverse'
# for omniauth-zooniverse
gem 'omniauth-oauth2'
gem 'responders'
gem 'listen', '>= 3.0.5', '< 3.8'
gem 'rest-client', '> 2.0'
Expand Down Expand Up @@ -71,13 +80,15 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: [:mri, :mingw, :x64_mingw]
gem 'pry-byebug'
gem 'rspec-rails', '~> 3.8'
# gem 'rspec-rails', '~> 3.8'
gem 'rspec-rails'
gem 'pry-rails'
gem 'webmock'
gem 'spring-commands-rspec'
gem 'rubocop'
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'ten_years_rails'
end

group :development do
Expand Down
Loading
Loading
0