Skip to content
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

Test agains ruby-head #36590

Open
Fudoshiki opened this issue Jul 3, 2019 · 3 comments

Comments

@Fudoshiki
Copy link
Contributor

commented Jul 3, 2019

@yahonda

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2019

Managed to reproduce this error https://buildkite.com/rails/rails/builds/62668#14b1f41c-4597-4a75-ab34-2c363e87da0c and found a workaround to set ENV BUNDLER_VERSION=2.1.0.pre.1 in Dockerfile.

Workaround commit yahonda/buildkite-config@f07885d

$ git diff master
diff --git a/Dockerfile b/Dockerfile
index b35370b..a7dd693 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,8 @@
 ARG RUBY_IMAGE
 FROM ${RUBY_IMAGE:-ruby:latest}

+ENV BUNDLER_VERSION=2.1.0.pre.1
+
 ARG BUNDLER
 ARG RUBYGEMS
 RUN echo "--- :ruby: Updating RubyGems and Bundler" \
$

Steps to reproduce:

$ git clone https://github.com/rails/rails
$ cd rails 
$ git clone https://github.com/rails/buildkite-config .buildkite/ 
$ RUBY_IMAGE=rubylang/ruby:trunk-nightly-bionic docker-compose -f .buildkite/docker-compose.yml build --pull base

Actual result without this change

$ RUBY_IMAGE=rubylang/ruby:trunk-nightly-bionic docker-compose -f .buildkite/docker-compose.yml build --pull base
Building base
Step 1/22 : ARG RUBY_IMAGE
Step 2/22 : FROM ${RUBY_IMAGE:-ruby:latest}
trunk-nightly-bionic: Pulling from rubylang/ruby
7413c47ba209: Pull complete
0fe7e7cbb2e8: Pull complete
1d425c982345: Pull complete
344da5c95cec: Pull complete
68dec7303913: Pull complete
89ff3644dcf4: Pull complete
bbfbf3389d5e: Pull complete
409d089003cc: Pull complete
427b283708c3: Pull complete
177d69dd6987: Pull complete
Digest: sha256:1fee982fbe979cbc5e80598ff51262f4185aab1afab430f8c0882e02b5e877b9
Status: Downloaded newer image for rubylang/ruby:trunk-nightly-bionic
 ---> 68655530abae
Step 3/22 : ARG BUNDLER
 ---> Running in 764eaa3641a7
Removing intermediate container 764eaa3641a7
 ---> acabf7e1651e
Step 4/22 : ARG RUBYGEMS
 ---> Running in 60b57c10ae03
Removing intermediate container 60b57c10ae03
 ---> 6f96ca33872e
Step 5/22 : RUN echo "--- :ruby: Updating RubyGems and Bundler"     && (gem update --system ${RUBYGEMS:-} || gem update --system 2.7.8)     && (gem install bundler -v "${BUNDLER:->= 0}" || gem install bundler -v "< 2")     && ruby --version && gem --version && bundle --version     && echo "--- :package: Installing system deps"     && codename="$(. /etc/os-release; x="${VERSION_CODENAME-${VERSION#*(}}"; echo "${x%%[ )]*}")"     && if [ "$codename" = jessie ]; then         sed -i -e '/jessie-updates/d' /etc/apt/sources.list         && echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list         && echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/backports-is-unsupported;     fi     && if ! which gpg || ! which curl; then         apt-get update         && apt-get install -y --no-install-recommends             gnupg curl;     fi     && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://deb.nodesource.com/node_10.x ${codename} main" > /etc/apt/sources.list.d/nodesource.list     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y --no-install-recommends         autoconf         automake         bzip2         dpkg-dev         file         g++         gcc         imagemagick         libbz2-dev         libc6-dev         libcurl4-openssl-dev         libdb-dev         libevent-dev         libffi-dev         libgdbm-dev         libgeoip-dev         libglib2.0-dev         libjpeg-dev         libkrb5-dev         liblzma-dev         libmagickcore-dev         libmagickwand-dev         libncurses5-dev         libncursesw5-dev         libpng-dev         libpq-dev         libreadline-dev         libsqlite3-dev         libssl-dev         libtool         libwebp-dev         libxml2-dev         libxslt-dev         libyaml-dev         make         patch         unzip         xz-utils         zlib1g-dev                 $(             if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then                 echo 'default-libmysqlclient-dev';             else                 echo 'libmysqlclient-dev';             fi         )     && apt-get install -y --no-install-recommends         postgresql-client default-mysql-client sqlite3         git nodejs yarn lsof         ffmpeg mupdf mupdf-tools poppler-utils     && curl -fLsS -o /tmp/await-linux-amd64 https://github.com/betalo-sweden/await/releases/download/v0.4.0/await-linux-amd64     && install /tmp/await-linux-amd64 /usr/local/bin/await     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/*     && mkdir /rails
 ---> Running in 5abc06bcde5b
--- :ruby: Updating RubyGems and Bundler
Latest version already installed. Done.
Successfully installed bundler-2.0.2
1 gem installed
ruby 2.7.0dev (2019-07-28T00:52:19Z master b40589802b) [x86_64-linux]
3.1.0.pre1
/usr/local/lib/ruby/2.7.0/rubygems.rb:281:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by `$BUNDLER_VERSION`. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
	from /usr/local/lib/ruby/2.7.0/rubygems.rb:300:in `activate_bin_path'
	from /usr/local/bin/bundle:23:in `<main>'
ERROR: Service 'base' failed to build: The command '/bin/sh -c echo "--- :ruby: Updating RubyGems and Bundler"     && (gem update --system ${RUBYGEMS:-} || gem update --system 2.7.8)     && (gem install bundler -v "${BUNDLER:->= 0}" || gem install bundler -v "< 2")     && ruby --version && gem --version && bundle --version     && echo "--- :package: Installing system deps"     && codename="$(. /etc/os-release; x="${VERSION_CODENAME-${VERSION#*(}}"; echo "${x%%[ )]*}")"     && if [ "$codename" = jessie ]; then         sed -i -e '/jessie-updates/d' /etc/apt/sources.list         && echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list         && echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/backports-is-unsupported;     fi     && if ! which gpg || ! which curl; then         apt-get update         && apt-get install -y --no-install-recommends             gnupg curl;     fi     && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://deb.nodesource.com/node_10.x ${codename} main" > /etc/apt/sources.list.d/nodesource.list     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y --no-install-recommends         autoconf         automake         bzip2         dpkg-dev         file         g++         gcc         imagemagick         libbz2-dev         libc6-dev         libcurl4-openssl-dev         libdb-dev         libevent-dev         libffi-dev         libgdbm-dev         libgeoip-dev         libglib2.0-dev         libjpeg-dev         libkrb5-dev         liblzma-dev         libmagickcore-dev         libmagickwand-dev         libncurses5-dev         libncursesw5-dev         libpng-dev         libpq-dev         libreadline-dev         libsqlite3-dev         libssl-dev         libtool         libwebp-dev         libxml2-dev         libxslt-dev         libyaml-dev         make         patch         unzip         xz-utils         zlib1g-dev                 $(             if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then                 echo 'default-libmysqlclient-dev';             else                 echo 'libmysqlclient-dev';             fi         )     && apt-get install -y --no-install-recommends         postgresql-client default-mysql-client sqlite3         git nodejs yarn lsof         ffmpeg mupdf mupdf-tools poppler-utils     && curl -fLsS -o /tmp/await-linux-amd64 https://github.com/betalo-sweden/await/releases/download/v0.4.0/await-linux-amd64     && install /tmp/await-linux-amd64 /usr/local/bin/await     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/*     && mkdir /rails' returned a non-zero code: 1
$

With this change:

$ RUBY_IMAGE=rubylang/ruby:trunk-nightly-bionic docker-compose -f .buildkite/docker-compose.yml build --pull base
Building base
Step 1/23 : ARG RUBY_IMAGE
Step 2/23 : FROM ${RUBY_IMAGE:-ruby:latest}
trunk-nightly-bionic: Pulling from rubylang/ruby
7413c47ba209: Pull complete
0fe7e7cbb2e8: Pull complete
1d425c982345: Pull complete
344da5c95cec: Pull complete
d44747381750: Pull complete
3be4325acbc6: Pull complete
fe016a2d20e0: Pull complete
e75d5b5f90b2: Pull complete
258143992525: Pull complete
6cf0228aba3a: Pull complete
Digest: sha256:89ed7c2d2bbf612c73fcb33cc904795d1b08540a5ab6a61a2f857ae94942839f
Status: Downloaded newer image for rubylang/ruby:trunk-nightly-bionic
 ---> 09c35c80663e
Step 3/23 : ENV BUNDLER_VERSION=2.1.0.pre.1
 ---> Running in 53be0bfd9225
Removing intermediate container 53be0bfd9225
 ---> c7e3db6dcb33
Step 4/23 : ARG BUNDLER
 ---> Running in edafeacdd29d
Removing intermediate container edafeacdd29d
 ---> 54891737065b
Step 5/23 : ARG RUBYGEMS
 ---> Running in e63ae3206108
Removing intermediate container e63ae3206108
 ---> 562c7eafbfe7
Step 6/23 : RUN echo "--- :ruby: Updating RubyGems and Bundler"     && (gem update --system ${RUBYGEMS:-} || gem update --system 2.7.8)     && (gem install bundler -v "${BUNDLER:->= 0}" || gem install bundler -v "< 2")     && ruby --version && gem --version && bundle --version     && echo "--- :package: Installing system deps"     && codename="$(. /etc/os-release; x="${VERSION_CODENAME-${VERSION#*(}}"; echo "${x%%[ )]*}")"     && if [ "$codename" = jessie ]; then         sed -i -e '/jessie-updates/d' /etc/apt/sources.list         && echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list         && echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/backports-is-unsupported;     fi     && if ! which gpg || ! which curl; then         apt-get update         && apt-get install -y --no-install-recommends             gnupg curl;     fi     && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://deb.nodesource.com/node_10.x ${codename} main" > /etc/apt/sources.list.d/nodesource.list     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -     && echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y --no-install-recommends         autoconf         automake         bzip2         dpkg-dev         file         g++         gcc         imagemagick         libbz2-dev         libc6-dev         libcurl4-openssl-dev         libdb-dev         libevent-dev         libffi-dev         libgdbm-dev         libgeoip-dev         libglib2.0-dev         libjpeg-dev         libkrb5-dev         liblzma-dev         libmagickcore-dev         libmagickwand-dev         libncurses5-dev         libncursesw5-dev         libpng-dev         libpq-dev         libreadline-dev         libsqlite3-dev         libssl-dev         libtool         libwebp-dev         libxml2-dev         libxslt-dev         libyaml-dev         make         patch         unzip         xz-utils         zlib1g-dev                 $(             if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then                 echo 'default-libmysqlclient-dev';             else                 echo 'libmysqlclient-dev';             fi         )     && apt-get install -y --no-install-recommends         postgresql-client default-mysql-client sqlite3         git nodejs yarn lsof         ffmpeg mupdf mupdf-tools poppler-utils     && curl -fLsS -o /tmp/await-linux-amd64 https://github.com/betalo-sweden/await/releases/download/v0.4.0/await-linux-amd64     && install /tmp/await-linux-amd64 /usr/local/bin/await     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/*     && mkdir /rails
 ---> Running in be4fd4ff294c
--- :ruby: Updating RubyGems and Bundler
Latest version already installed. Done.
Successfully installed bundler-2.0.2
1 gem installed
ruby 2.7.0dev (2019-07-29T14:05:41Z master c2428b8bf6) [x86_64-linux]
3.1.0.pre1
Bundler version 2.1.0.pre.1
--- :package: Installing system deps
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [5436 B]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [727 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [591 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [4172 B]
Get:10 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [902 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1249 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [10.8 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [7235 B]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3930 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [2496 B]
Fetched 16.9 MB in 9s (1952 kB/s)

cc and thanks to @mtsmfm for the useful information.

@yahonda

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2019

The origial value of ENV BUNDLER_VERSION=1.17.3 is configured this line.

https://github.com/ruby/ruby-docker-images/blob/b703ad2e0600b7ff82f6f190aea66cb77d25c240/Dockerfile#L38

In my local environment Ruby 2.7.0 trunk installs Bundler version 2.1.0.pre.1 then rubylang/ruby:trunk-nightly-bionic will need to update its own BUNDLER_VERSION environment variable.

$ ruby -v
ruby 2.7.0dev (2019-07-20T00:08:34Z trunk 77bb79b8cf) [x86_64-linux]
$ bundler -v
Bundler version 2.1.0.pre.1
$
@yahonda

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2019

Refer ruby/ruby-docker-images#5 to remove BUNDLER_VERSION at rubylang/ruby:trunk-nightly-bionic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.