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

[C++] Provide .deb and .rpm packages #16224

Closed
asfimport opened this issue Mar 2, 2017 · 25 comments
Closed

[C++] Provide .deb and .rpm packages #16224

asfimport opened this issue Mar 2, 2017 · 25 comments

Comments

@asfimport
Copy link

asfimport commented Mar 2, 2017

If we provide .deb and .rpm packages for C++ Arrow, users can install it easily. (At least, I'm happy as an user.)

Is there any location to provide .deb and .rpm packages? If it doesn't exist, how about using https://packagecloud.io/ with "Open Source plan"? We can find "Open Source plan" by clicking "Looking for free or open-source plans" at https://packagecloud.io/pricing .

Environment: GNU/Linux
Reporter: Kouhei Sutou / @kou
Assignee: Kouhei Sutou / @kou

Related issues:

Note: This issue was originally created as ARROW-592. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
I agree. For some Python and R users, installing the Arrow libraries via apt or yum will be much better than bundling the Arrow sources with a 3rd party library.

@kou do you have the expertise to write the package recipes? I can try to help

@asfimport
Copy link
Author

Kouhei Sutou / @kou:

do you have the expertise to write the package recipes?

Yes.

We need to decide our package repository location before we create the package recipes. For example, if we choose packagecloud, we should not use CMake's CPack. We should use debian/ directory and .spec file.

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
I created .deb and .rpm packages for Debian GNU/Linux jessie, Ubuntu 16.04 LTS, Ubuntu 16.10 and CentOS 7: https://github.com/kou/arrow-packages

I used the package repository server that is maintained by me because I didn't know about Apache Arrow's policy.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
@kou this is great, thank you for setting this up. Let's look to build official packages after the 0.3 release. In the meantime, having these development packages available is very useful.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Would it be possible to move the .deb and .rpm builds to https://github.com/apache/arrow-dist?

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
Sure. If we decide .deb and .rpm upload location, I can adjust the current tools.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
I think the idea is what we would create the binary artifacts as part of the release candidate, so that the PMC could vote on them. We could then make them available through the Apache mirror along with the source release. I am not sure how other projects work that have .deb or .rpm artifacts

@asfimport
Copy link
Author

Uwe Korn / @xhochy:
We could ask for a second bintray repo under the ASF umbrella (our current one is a generic one) to host RPMs and DEBs. This could then be directly used as a repository in RPM/DEB based distributions.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
I linked this with ARROW-1262. @kou would you be able to contribute .deb and .rpm build scripts to https://github.com/apache/arrow-dist? We should see if it's possible to build RPM packages for RHEL / CentOS 6, since I've heard a common concern is being able to deploy on those platforms. Using the devtoolset-2 it should be possible in theory

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
Sure. But we need more works to provide packages for CentOS 6. We can solve old compiler problem by devtoolset but we have old Boost problem. The current Apache Arrow requires Boost 1.15.3 for Multiprecision http://www.boost.org/users/history/version_1_53_0.html .
We may solve the problem by bundling Boost. Should we do or drop CentOS 6 support?

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
FYI: CentOS 6 ships Boost 1.41.0.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
We will need to build our own toolchain with devtoolset to support CentOS 6 (Apache Kudu and other projects do this https://github.com/apache/kudu/tree/master/thirdparty). Since everything is statically linked / no runtime dependencies this should be OK?

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
I understand that bundling needed libraries including Boost is our way. It'll solve the old Boost problem.
I'll work on it later.

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
Auto latest Boost download: #927

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
I tried rake apt in arrow-dist and I get this:

arrow-dist/cpp-linux# rake --trace apt
rake aborted!
undefined local variable or method `__dir__' for #<ApacheArrowPackageTask:0x00000000a7de60>
/arrow-dist/cpp-linux/Rakefile:31:in `arrow_source_dir'
/arrow-dist/cpp-linux/Rakefile:24:in `initialize'
/arrow-dist/cpp-linux/Rakefile:110:in `new'
/arrow-dist/cpp-linux/Rakefile:110:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:589:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:89:in `block in load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:88:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:72:in `block in run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:70:in `run'
/usr/bin/rake:27:in `<main>'

Am I using it the wrong way?

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
What is your Ruby version? The following command line shows Ruby version:

% ruby -v

@asfimport
Copy link
Author

Rares Vernica / @rvernica:

# ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

I am trying to get the .deb files generated for Ubuntu 14.04. I'll upgrade ruby if necessary.

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
Ruby 1.9 is too old.

This patch will help you:

diff --git a/cpp-linux/Rakefile b/cpp-linux/Rakefile
index c0e5963..d612423 100644
--- a/cpp-linux/Rakefile
+++ b/cpp-linux/Rakefile
@@ -28,7 +28,7 @@ class ApacheArrowPackageTask < PackageTask
 
   private
   def arrow_source_dir
-    File.join(__dir__, "..", "arrow")
+    File.join(File.dirname(__FILE__), "..", "arrow")
   end
 
   def detect_version(release_time)
diff --git a/cpp-linux/apt/ubuntu-14.04/Dockerfile b/cpp-linux/apt/ubuntu-14.04/Dockerfile
new file mode 100644
index 0000000..f993458
--- /dev/null
+++ b/cpp-linux/apt/ubuntu-14.04/Dockerfile
@@ -0,0 +1,42 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM ubuntu:14.04
+
+ENV DEBIAN_FRONTEND noninteractive
+
+ARG DEBUG
+
+RUN \
+  quiet=$([ "${DEBUG}" = "yes" ] || echo "-qq") && \
+  apt update ${quiet} && \
+  apt install -y -V ${quiet} \
+    build-essential \
+    cmake3 \
+    debhelper\
+    devscripts \
+    git \
+    gtk-doc-tools \
+    libboost-filesystem-dev \
+    libboost-system-dev \
+    libgirepository1.0-dev \
+    libglib2.0-doc \
+    libjemalloc-dev \
+    lsb-release \
+    pkg-config && \
+  apt-get clean && \
+  rm -rf /var/lib/apt/lists/*
diff --git a/cpp-linux/debian/control b/cpp-linux/debian/control
index 147a73c..aa0571d 100644
--- a/cpp-linux/debian/control
+++ b/cpp-linux/debian/control
@@ -10,8 +10,6 @@ Build-Depends:
   libboost-system-dev,
   libboost-filesystem-dev,
   libjemalloc-dev,
-  python3-dev,
-  python3-numpy,
   libgirepository1.0-dev,
   gtk-doc-tools,
   gobject-introspection
@@ -32,21 +30,6 @@ Description: Apache Arrow is a data processing library for analysis
  .
  This package provides library files.
 
-Package: libarrow-python0
-Section: libs
-Architecture: any
-Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends}
-Depends:
-  ${misc:Depends},
-  ${shlibs:Depends},
-  libarrow0 (= ${binary:Version}),
-  python3,
-  python3-numpy
-Description: Apache Arrow is a data processing library for analysis
- .
- This package provides library files for Python.
-
 Package: libarrow-dev
 Section: libdevel
 Architecture: any
diff --git a/cpp-linux/debian/libarrow-dev.install b/cpp-linux/debian/libarrow-dev.install
index 92b5574..67c6cdc 100644
--- a/cpp-linux/debian/libarrow-dev.install
+++ b/cpp-linux/debian/libarrow-dev.install
@@ -1,6 +1,4 @@
 usr/include/arrow/
 usr/lib/*/libarrow.a
-usr/lib/*/libarrow_*.a
 usr/lib/*/libarrow.so
-usr/lib/*/libarrow_*.so
 usr/lib/*/pkgconfig/arrow.pc
diff --git a/cpp-linux/debian/rules b/cpp-linux/debian/rules
index 641e07c..f92b589 100755
--- a/cpp-linux/debian/rules
+++ b/cpp-linux/debian/rules
@@ -17,10 +17,7 @@ override_dh_auto_configure:
 	  --builddirectory=cpp_build \
 	  -- \
 	  -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-	  -DARROW_BUILD_TESTS=OFF \
-	  -DARROW_PYTHON=ON \
-	  -DPythonInterp_FIND_VERSION=ON \
-	  -DPythonInterp_FIND_VERSION_MAJOR=3
+	  -DARROW_BUILD_TESTS=OFF
 	dh_auto_configure \
 	  --sourcedirectory=c_glib \
 	  --builddirectory=c_glib_build \
diff --git a/cpp-linux/package-task.rb b/cpp-linux/package-task.rb
index c9a0755..ed115bd 100644
--- a/cpp-linux/package-task.rb
+++ b/cpp-linux/package-task.rb
@@ -180,9 +180,10 @@ VERSION=#{@version}
   def define_apt_task
     namespace :apt do
       code_names = [
-        ["debian", "stretch"],
-        ["ubuntu", "16.04"],
-        ["ubuntu", "17.04"],
+        # ["debian", "stretch"],
+        ["ubuntu", "14.04"],
+        # ["ubuntu", "16.04"],
+        # ["ubuntu", "17.04"],
       ]
       debian_dir = "debian"
       apt_dir = "apt"

You can build .deb for Ubuntu 14.04 by Ruby 1.9 with this patch.

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
Thanks. This is very helpful. I am in the final stages, but I am getting an error with debuild.

# docker run --rm --tty --interactive --volume `pwd`:/host:rw --env DEBUG=yes apache-arrow-ubuntu-14.04 bash -x /host/build.sh
+ LANG=C
+ . /host/env.sh
++ PACKAGE=apache-arrow
++ VERSION=0.7.0.20170827
++ lsb_release --id --short
++ tr A-Z a-z
+ distribution=ubuntu
++ lsb_release --codename --short
+ code_name=trusty
+ case "${distribution}" in
+ component=universe
+ run mkdir -p build
+ mkdir -p build
+ test 0 -ne 0
+ run cp /host/tmp/apache-arrow-0.7.0.20170827.tar.gz build/apache-arrow_0.7.0.20170827.orig.tar.gz
+ cp /host/tmp/apache-arrow-0.7.0.20170827.tar.gz build/apache-arrow_0.7.0.20170827.orig.tar.gz
+ test 0 -ne 0
+ run cd build
+ cd build
+ test 0 -ne 0
+ run tar xfz apache-arrow_0.7.0.20170827.orig.tar.gz
+ tar xfz apache-arrow_0.7.0.20170827.orig.tar.gz
+ test 0 -ne 0
+ run cd apache-arrow-0.7.0.20170827/
+ cd apache-arrow-0.7.0.20170827/
+ test 0 -ne 0
+ run cp -rp /host/tmp/debian debian
+ cp -rp /host/tmp/debian debian
+ test 0 -ne 0
+ '[' yes = yes ']'
+ run debuild -us -uc
+ debuild -us -uc
This package has a Debian revision number but there does not seem to be
an appropriate original tar file or .orig directory in the parent directory;
(expected one of apache-arrow_0.6.0.orig.tar.gz, apache-arrow_0.6.0.orig.tar.bz2,
apache-arrow_0.6.0.orig.tar.lzma,  apache-arrow_0.6.0.orig.tar.xz or apache-arrow-0.7.0.20170827.orig)
continue anyway? (y/n) y
 dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package apache-arrow
dpkg-buildpackage: source version 0.6.0-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Kouhei Sutou <kou@clear-code.com>
 dpkg-source --before-build apache-arrow-0.7.0.20170827
dpkg-buildpackage: host architecture amd64
 fakeroot debian/rules clean
dh clean --with gir
   dh_testdir
   dh_auto_clean
   dh_clean
 dpkg-source -b apache-arrow-0.7.0.20170827
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../apache-arrow_0.6.0.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b apache-arrow-0.7.0.20170827 gave error exit status 255
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc failed
+ test 29 -ne 0
+ echo 'Failed debuild' -us -uc
Failed debuild -us -uc
+ exit 1

Here are the apache-arrow* filtes in the container, after build.sh runs:

root@1cbdea4671f5:/# find . -name "apache-arrow*"
./host/tmp/apache-arrow-0.7.0.20170827.tar.gz
./build/apache-arrow_0.7.0.20170827.orig.tar.gz
./build/apache-arrow-0.7.0.20170827
./build/apache-arrow_0.6.0-1_amd64.build

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
Never mind. I checked out the 0.6.0 tag and it works fine. Thanks again!

@asfimport
Copy link
Author

Kouhei Sutou / @kou:
You need to run rake version:update when you update arrow/ version.

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
Thanks for setting this up. I was able to use your CentOS 6 packages from Bintray. I assume Arrow 0.7 packages will be available for CentOS 6 as well when time comes.

I also needed Ubuntu 14.04 packages and I was able to build them myself for now. If it is not too much trouble, it would be nice to have Ubuntu 14.04 packages for Arrow 0.7 available as well when time comes.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Can you help with the packaging scripts in apache/arrow-dist?

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
I would be glad to. I built the 14.04 packages using the scripts in arrow-dist and the patch that Kouhei kindly provided earlier in this thread.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Created ARROW-1538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants