Build an Arvados development environment with OpenSSL 11 » History » Version 5
Brett Smith, 08/24/2023 03:10 PM
set RPATH for openssl itself, for its binaries
1 | 1 | Brett Smith | h1. Build an Arvados development environment with OpenSSL 1.1 |
---|---|---|---|
2 | |||
3 | h2. Background |
||
4 | |||
5 | The Arvados 2.x series requires Rails 5.2, |
||
6 | which requires Ruby 2.7, |
||
7 | which requires OpenSSL 1.1. |
||
8 | |||
9 | But Ubuntu 22.04+, Debian 12+, and RHEL 9+ all ship with OpenSSL 3. To get Arvados working on these distributions, you need to build OpenSSL 1.1 yourself, then build _a complete Ruby stack_ linked against it, including the @openssl@ and @pg@ gems. This page documents how to do that. |
||
10 | |||
11 | *This is expert-level stuff.* This page does not walk you through downloading, extracting, and navigating source. If you're not comfortable figuring out those steps yourself, then you probably won't be comfortable working with this stack once it's set up. Consider another development solution like arvbox. |
||
12 | |||
13 | h2. Environment assumptions |
||
14 | |||
15 | We're gonna install the whole stack under @/opt/arvados@. You can adjust to taste if you like. |
||
16 | |||
17 | I have @/var/lib/arvados@ symlinked to @/opt/arvados@ for compatibility with @arvados-server install@. |
||
18 | |||
19 | I have write permission to @/opt/arvados@, so I can install stuff without @sudo@ or any other elevated permissions. |
||
20 | |||
21 | I have @/opt/arvados/bin@ near the front of my @$PATH@. *This is important, even if the directory starts empty,* because some of these build steps will install tools here that later build steps need. |
||
22 | |||
23 | h2. Notes |
||
24 | |||
25 | I have documented the exact source code I used for all steps, but there should be a little slack in specific versions if needed. |
||
26 | |||
27 | 2 | Brett Smith | It might be possible to clean up some redundancy from the @configure@ lines, especially in @LDFLAGS@ settings. If you know better, feel free to make those edits. |
28 | |||
29 | 1 | Brett Smith | h2. Build steps |
30 | |||
31 | 3 | Brett Smith | h3. Install build dependencies |
32 | |||
33 | These are mostly for Ruby and should be enough to cover everything else. |
||
34 | |||
35 | <pre><code>sudo apt install bison build-essential file libffi-dev libgdbm-compat-dev libgdbm-dev libgmp-dev libncurses-dev libedit-dev libyaml-dev netbase pkg-config procps zlib1g-dev</code></pre> |
||
36 | |||
37 | 1 | Brett Smith | h3. OpenSSL 1.1 |
38 | |||
39 | https://www.openssl.org/source/openssl-1.1.1v.tar.gz |
||
40 | |||
41 | 5 | Brett Smith | <pre><code>LDFLAGS="-Wl,-rpath=/opt/arvados/lib" ./config --prefix=/opt/arvados --openssldir=/opt/arvados/etc/ssl |
42 | 1 | Brett Smith | make -j6 test |
43 | make install</code></pre> |
||
44 | |||
45 | h3. Ruby 2.7 (including openssl gem) |
||
46 | |||
47 | https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.7.tar.gz |
||
48 | |||
49 | 2 | Brett Smith | <pre><code>LDFLAGS="-Wl,-rpath=/opt/arvados/lib" ./configure --disable-install-static-library --enable-shared --disable-install-doc --prefix=/opt/arvados --with-openssl-dir=/opt/arvados |
50 | 1 | Brett Smith | make -j6 |
51 | make install |
||
52 | gem install bundler --no-document |
||
53 | </code></pre> |
||
54 | |||
55 | h3. libpq |
||
56 | |||
57 | https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2 |
||
58 | |||
59 | You download the entire PostgreSQL source, configure it, then build and install just libpq and friends. Specific make tasks based on "this SO answer":https://stackoverflow.com/a/46386938. |
||
60 | |||
61 | 4 | Brett Smith | <pre><code>LDFLAGS="-Wl,-rpath=/opt/arvados/lib" ./configure --prefix=/opt/arvados --with-ssl=openssl --with-includes=/opt/arvados/include --with-libraries=/opt/arvados/lib |
62 | 1 | Brett Smith | make -j6 -C src/backend generated-headers |
63 | make -j6 -C src/include install |
||
64 | make -j6 -C src/interfaces/libpq install |
||
65 | make -j6 -C src/bin/pg_config install |
||
66 | </code></pre> |
||
67 | |||
68 | h3. pg gem 1.1.4 |
||
69 | |||
70 | Run these steps in the @arvados/services/api@ directory. @bundle install@ will install all of the API server's dependencies, not just the @pg@ gem, but you were gonna do that sooner or later anyway so might as well now. |
||
71 | |||
72 | 2 | Brett Smith | <pre><code>cd .../arvados/services/api |
73 | 1 | Brett Smith | bundle config build.pg --with-opt-dir=/opt/arvados --with-pg-config=/opt/arvados/bin/pg_config |
74 | bundle install |
||
75 | </code></pre> |
||
76 | |||
77 | h2. Rest of the Arvados install |
||
78 | |||
79 | From here, you should be able to run @arvados-server install@ as described on "the hacking prerequisites dev environment":/projects/arvados/wiki/Hacking_prerequisites#Install-dev-environment. You can test that everything worked by running the API server tests (e.g., @run-tests.sh@ → @test services/api@). |