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

PEREL-2701: build for ubuntu jammy #16

Merged
merged 1 commit into from
Dec 30, 2021
Merged
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
4 changes: 2 additions & 2 deletions Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN rm -f /bin/sh && \
cp /etc/gemrc /root/.gemrc && \
cp /etc/gemrc /package/.gemrc

ADD vendor/ruby-build-20200722.tar.gz /tmp
ADD vendor/ruby-build-20211203.tar.gz /tmp

RUN mkdir -p /opt/puppet-omnibus/embedded && \
export MAKE_OPTS="-j3 -s" && \
Expand All @@ -28,7 +28,7 @@ RUN mkdir -p /opt/puppet-omnibus/embedded && \
export RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm \
--with-readline-dir=/usr/lib/x86_64-linux-gnu --with-openssl-dir=/usr/lib/x86_64-linux-gnu \
--disable-install-doc --without-tcl --without-tk" && \
/tmp/ruby-build-20200722/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded
/tmp/ruby-build-20211203/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded

RUN /opt/puppet-omnibus/embedded/bin/gem install rubygems-update -v '<3' && \
/opt/puppet-omnibus/embedded/bin/update_rubygems && \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN rm -f /bin/sh && \
cp /etc/gemrc /root/.gemrc && \
cp /etc/gemrc /package/.gemrc

ADD vendor/ruby-build-20200722.tar.gz /tmp
ADD vendor/ruby-build-20211203.tar.gz /tmp

RUN mkdir -p /opt/puppet-omnibus/embedded && \
export MAKE_OPTS="-j3 -s" && \
Expand All @@ -28,7 +28,7 @@ RUN mkdir -p /opt/puppet-omnibus/embedded && \
export RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm \
--with-readline-dir=/usr/lib/x86_64-linux-gnu --with-openssl-dir=/usr/lib/x86_64-linux-gnu \
--disable-install-doc --without-tcl --without-tk" && \
/tmp/ruby-build-20200722/bin/ruby-build -p 2.4.10 /opt/puppet-omnibus/embedded
/tmp/ruby-build-20211203/bin/ruby-build -p 2.4.10 /opt/puppet-omnibus/embedded

RUN /opt/puppet-omnibus/embedded/bin/gem install rubygems-update -v '<3' && \
/opt/puppet-omnibus/embedded/bin/update_rubygems && \
Expand Down
44 changes: 44 additions & 0 deletions Dockerfile.jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM docker-dev.yelpcorp.com/jammy_yelp:latest

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get --yes --force-yes install \
autoconf bison build-essential curl fakeroot gawk git-core libffi-dev \
libffi7 libgdbm-dev libncurses5-dev libpcre3-dev \
libreadline-dev libsqlite3-dev libxml2-dev libxslt1-dev \
pkg-config ruby screen sudo wget zlib1g zlib1g-dev && \
apt-get clean

RUN rm -f /bin/sh && \
ln -s /bin/bash /bin/sh && \
touch "/etc/default/puppet" && \
mkdir -p /opt /package /etc/puppet /var/lib/puppet /var/cache/omnibus && \
echo 'gem: --no-document' > /etc/gemrc && \
echo 'install: --no-ri --no-rdoc' >> /etc/gemrc && \
echo 'update: --no-ri --no-rdoc' >> /etc/gemrc && \
cp /etc/gemrc /.gemrc && \
cp /etc/gemrc /root/.gemrc && \
cp /etc/gemrc /package/.gemrc

ADD vendor/ruby-build-20211203.tar.gz /tmp

# PEREL-2701: Download and install libssl-dev 1.1 from impish, since jammy

Choose a reason for hiding this comment

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

I am not really a fan of this. Do we have an idea of if/when this might be fixed upstream? I'd rather wait a couple weeks than merge this now. If we do merge this we probably want a ticket to clean this up that blocks finishing the jammy project

Choose a reason for hiding this comment

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

...I guess if this is just to build the package it's not too bad, as long as we don't need to pull in the impish package to run this

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it's only as a build-time dependency (it uses libssl1.1 at runtime), and I'm definitely not a fan either... I wish they published both libssl1.1-dev and libssl3-dev or something like they do for runtime packages (libssl1.1 and libssl3 do both exist alongside each other).

The problem is that I'm not sure how long this will take before it's fixed, and if it is fixed I expect it will only be for the latest ruby version (3.1.0 I suppose?). Since ruby releases come out on Christmas, I'm happy to wait until after this one and try out 3.1.0, but without ruby/openssl#369 and something like ruby/ruby#4904 merged in and released as a version I don't think it'll work yet. There's active work on this though, as ruby/openssl#399 (comment) was added just yesterday (!)

Another option I was toying with was unvendoring ruby itself from this package and using the system ruby instead. I think that'd be nice, but seems like a big undertaking to do (and especially if doing so for all OS releases, not just jammy). I think that also somewhat defeats the original purpose of using an omnibus package here to include all the dependencies all together, although there are things like libssl/libxml/libxslt/virt-what that this depends on anyway, so maybe that's not that big of a difference. As far as I know, ruby doesn't have something like virtualenvs to make a more self-contained runtime with a specific set of gems, but maybe bundler into a separate directory would accomplish something similar.

# moves to 3.0 and Ruby doesn't support that at all yet. Jammy does include a
# runtime edition of 1.1 in libssl1.1 though, just doesn't have development headers
#
# Admittedly, this is a hack, and hopefully the situation here is better later
# on in jammy's release.
RUN wget http://mirrors.kernel.org/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1l-1ubuntu1_amd64.deb
RUN dpkg -i libssl-dev_1.1.1l-1ubuntu1_amd64.deb

RUN mkdir -p /opt/puppet-omnibus/embedded && \
export MAKE_OPTS="-j3 -s" && \
export RUBY_CFLAGS=-Os && \
export RUBY_BUILD_CACHE_PATH=/tmp && \
export RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm \
--with-readline-dir=/usr/lib/x86_64-linux-gnu --with-openssl-dir=/usr/lib/x86_64-linux-gnu \
--disable-install-doc --without-tcl --without-tk" && \
/tmp/ruby-build-20211203/bin/ruby-build -p 2.4.10 /opt/puppet-omnibus/embedded

RUN /opt/puppet-omnibus/embedded/bin/gem install rubygems-update -v '<3' && \
/opt/puppet-omnibus/embedded/bin/update_rubygems && \
rm -rf /opt/puppet-omnibus/embedded/share/*
4 changes: 2 additions & 2 deletions Dockerfile.trusty
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ RUN rm -f /bin/sh && \
cp /etc/gemrc /root/.gemrc && \
cp /etc/gemrc /package/.gemrc

ADD vendor/ruby-build-20200722.tar.gz /tmp
ADD vendor/ruby-build-20211203.tar.gz /tmp

RUN mkdir -p /opt/puppet-omnibus/embedded && \
export MAKE_OPTS="-j3 -s" && \
export RUBY_CFLAGS=-Os && \
export RUBY_BUILD_CACHE_PATH=/tmp && \
export RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm --disable-install-doc --without-tcl --without-tk" && \
/tmp/ruby-build-20200722/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded
/tmp/ruby-build-20211203/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded

RUN /opt/puppet-omnibus/embedded/bin/gem install rubygems-update -v '<3' && \
/opt/puppet-omnibus/embedded/bin/update_rubygems && \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ RUN rm -f /bin/sh && \
cp /etc/gemrc /root/.gemrc && \
cp /etc/gemrc /package/.gemrc

ADD vendor/ruby-build-20200722.tar.gz /tmp
ADD vendor/ruby-build-20211203.tar.gz /tmp

RUN mkdir -p /opt/puppet-omnibus/embedded && \
export MAKE_OPTS="-j3 -s" && \
export RUBY_CFLAGS=-Os && \
export RUBY_BUILD_CACHE_PATH=/tmp && \
export RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm --disable-install-doc --without-tcl --without-tk" && \
/tmp/ruby-build-20200722/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded
/tmp/ruby-build-20211203/bin/ruby-build -p 2.2.10 /opt/puppet-omnibus/embedded

RUN /opt/puppet-omnibus/embedded/bin/gem install rubygems-update -v '<3' && \
/opt/puppet-omnibus/embedded/bin/update_rubygems && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ itest: require_os package
-v `pwd`/itest:/itest:ro \
-v `pwd`/dist:/dist:ro \
docker-dev.yelpcorp.com/$(OS)_yelp \
/itest/$(OS).sh \
/itest/ubuntu.sh \
/dist/$(OS)/$(PACKAGE_NAME)_$(VERSION)-$(PKG_ITERATION)_amd64.deb \
$(VERSION)

Expand Down
1 change: 0 additions & 1 deletion itest/bionic.sh

This file was deleted.

1 change: 0 additions & 1 deletion itest/focal.sh

This file was deleted.

1 change: 0 additions & 1 deletion itest/lucid.sh

This file was deleted.

1 change: 0 additions & 1 deletion itest/trusty.sh

This file was deleted.

1 change: 0 additions & 1 deletion itest/xenial.sh

This file was deleted.

Binary file removed vendor/ruby-build-20200722.tar.gz
Binary file not shown.
Binary file added vendor/ruby-build-20211203.tar.gz
Binary file not shown.