Skip to content

Commit

Permalink
Upgrade to Ruby 2.4.4 (fixes #2824) (#3253)
Browse files Browse the repository at this point in the history
* Added strace option and artifact

* Restore Gitlab and add strace to Makefile

* Use strace within container

* Give more trace output

* Switch invocation of passenger to fork 9 processes in testing

* 256 string length. No op for triggering builds.

* Try to speed up by not running bower / bundler

* Build, then start.

* Built before

* Ignore logs in container

* Try with newer docker ruby image

* Set ruby version in Gemfile to 2.4.4

* Increase trace log to 512

* Don't export Redis port

* Don't export web app port for testing

* Set explicit Ruby version in Dockerfile

* Avoid running bundle in Travis

* Move strace to Gitlab to save disk space.

* Add strace and artifacts to tests.

* Remove redundant bundle and bower calls.

* Add capability to be able to strace on Gitlab.

* Run bower in Gitlab

* Remove bash

* Ignore tmp dir from docker container
  • Loading branch information
icarito authored and jywarren committed Aug 27, 2018
1 parent 39cfd13 commit 57a6b04
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ public/system
publiclab.org
log
.git
*.log
tmp
14 changes: 11 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ before_script:
- apk add --no-cache py-pip && pip install docker-compose
- docker-compose build
- docker-compose up -d
- docker-compose exec -T web bundle install
- docker-compose exec -T web rake db:setup
- docker-compose exec -T web rake db:migrate
- docker-compose exec -T web bower install --allow-root

job:
script:
- docker-compose exec -T web rake test:all
- docker-compose exec -T web rails test -d
- docker-compose exec -T web strace -s 512 -o log/trace1.log rake test:all
- tail -n 3000 log/trace1.log > log/trace1.tail.log
- docker-compose exec -T web strace -s 512 -o log/trace2.log rails test -d
- tail -n 3000 log/trace2.log > log/trace2.tail.log
artifacts:
when: on_failure
paths:
- log/trace1.log
- log/trace1.tail.log
- log/trace2.log
- log/trace2.tail.log
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ services:
env:
- COMPOSE_FILE=./containers/docker-compose-testing.yml

before_script:
- bundle install

before_install:
- echo -e "repo_token:\n $COVERALLS_REPO_TOKEN" >> ./.coveralls.yml

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dockerfile # Plots2
# https://github.com/publiclab/plots2

FROM ruby:2.4.1-stretch
FROM ruby:2.4.4-stretch

LABEL description="This image deploys Plots2."

Expand All @@ -18,7 +18,7 @@ ENV PHANTOMJS_VERSION 2.1.1

# Install dependencies
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update -qq && apt-get install -y build-essential bundler libmariadbclient-dev ruby-rmagick libfreeimage3 wget curl procps cron make nodejs
RUN apt-get update -qq && apt-get install -y build-essential bundler libmariadbclient-dev ruby-rmagick libfreeimage3 wget curl procps cron make nodejs strace
RUN wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; tar -xvf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /opt ; cp /opt/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/* /usr/local/bin/
RUN npm install -g bower

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby '2.4.1'
ruby '2.4.4'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ deploy-container:

test-container:
docker-compose up -d
docker-compose exec -T web bundle install
docker-compose exec -T web rake db:setup
docker-compose exec -T web rake db:migrate
docker-compose exec -T web bower install --allow-root
docker-compose exec -T web rake test:all
docker-compose exec -T web rails test -d
docker-compose down
Expand Down
2 changes: 0 additions & 2 deletions containers/docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ services:
restart: on-failure:5
redis:
image: redis:latest
ports:
- '127.0.0.1:6379:6379'
command: redis-server
sidekiq:
build: ..
Expand Down
2 changes: 0 additions & 2 deletions containers/docker-compose-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ services:
restart: on-failure:5
redis:
image: redis:latest
ports:
- '127.0.0.1:6379:6379'
command: redis-server
sidekiq:
build: ..
Expand Down
8 changes: 3 additions & 5 deletions containers/docker-compose-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ services:
# if you want to re-import simply put away ../../mysql/*
redis:
image: redis:latest
ports:
- '6379:6379'
command: redis-server
web:
build: ..
command: /bin/bash -c "sleep 5 && passenger start -p 4000"
cap_add:
- SYS_PTRACE
command: /bin/bash -c "sleep 5 && /usr/local/bundle/bin/passenger start --max-pool-size 9 --min-instances 9 -p 4000"
environment:
- RAILS_ENV=${RAILS_ENV}
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
Expand All @@ -32,8 +32,6 @@ services:
- redis
volumes:
- ..:/app
ports:
- "127.0.0.1:4000:4000"
restart: unless-stopped
sidekiq:
build: ..
Expand Down
2 changes: 0 additions & 2 deletions containers/docker-compose-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ services:
restart: on-failure:5
redis:
image: redis:latest
ports:
- '127.0.0.1:6379:6379'
command: redis-server
sidekiq:
build: ..
Expand Down

0 comments on commit 57a6b04

Please sign in to comment.