Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
06af445
initial commit for packaging mvp
kszucs Apr 5, 2018
5c96243
fix appveyor condition
kszucs Apr 5, 2018
e38a716
don't checkout during branch modification; edited templates
kszucs Apr 6, 2018
96c00b3
artifacts for building linux packages; ability to clone arrow fork
kszucs Apr 6, 2018
56991a6
configuration fixes
kszucs Apr 6, 2018
f0e0dcd
rakefile source path
kszucs Apr 6, 2018
75fc775
update templates
kszucs Apr 6, 2018
228b829
ported appveyor build script
kszucs Apr 6, 2018
eb0d25f
appveyor builds
kszucs Apr 6, 2018
565c720
appveyor attempts
kszucs Apr 6, 2018
8d3bb2c
path fixes
kszucs Apr 6, 2018
6164b28
path fixies again
kszucs Apr 6, 2018
5a1115d
path fixies again
kszucs Apr 6, 2018
72fa4eb
trying to fix linnnux builds
kszucs Apr 7, 2018
01d99e9
reorganize
kszucs Apr 7, 2018
6d47174
first attempt to build conda recipes on appveyor
kszucs Apr 7, 2018
5eaf55a
update appveyor script for win-conda
kszucs Apr 7, 2018
aaaae6d
osx conda template
kszucs Apr 7, 2018
fdac3fd
use jinja variables
kszucs Apr 7, 2018
35f7350
travis conda template
kszucs Apr 7, 2018
8405cbf
linux config for conda recipes
kszucs Apr 7, 2018
4b5f642
fallback to previouse conda paths
kszucs Apr 7, 2018
fa73345
fallback to previous arrow path
kszucs Apr 7, 2018
5b73f35
fix package name
kszucs Apr 7, 2018
570017d
build notifications
kszucs Apr 8, 2018
e1a62ab
cleanup of the packaging script
kszucs Apr 8, 2018
27e2b88
travis dependencies for linux packages
kszucs Apr 9, 2018
62cfd42
add arguments and cleanup
kszucs Apr 9, 2018
ff9d6d0
remove todo notes
kszucs Apr 9, 2018
6a984b8
add license header
kszucs Apr 9, 2018
6c0aec0
format commit msg
kszucs Apr 14, 2018
4439a93
create readme for crossbow
kszucs Apr 14, 2018
401cf31
little readme modification
kszucs Apr 14, 2018
7b6321d
build multiple linux distros
kszucs Apr 14, 2018
a6634af
update README
kszucs Apr 14, 2018
9e74ead
add apache lincense headers
kszucs Apr 14, 2018
93c86c7
change yum version label to dev
kszucs Apr 15, 2018
122b0dc
factor out the library code
kszucs Apr 16, 2018
4ca1921
checkout specific revision; pass version as env variable to conda rec…
kszucs Apr 20, 2018
6aa87cb
update versions in pyarrow recipe
kszucs Apr 20, 2018
351b48e
export arrow version on linux and win conda package builds
kszucs Apr 20, 2018
591baf6
readme fixes
kszucs May 4, 2018
cea4035
explicitly pass arrow's repo path
kszucs May 4, 2018
c6ca0f5
tasks yml
kszucs May 4, 2018
4ce9e9b
organize files
kszucs May 12, 2018
3d36fef
fixes paths
kszucs May 12, 2018
5cf971c
resolve review issues
kszucs May 12, 2018
2646734
license headers for conda recipes
kszucs May 16, 2018
6a49d51
license headers
kszucs May 17, 2018
45a7138
fix review issues
kszucs May 24, 2018
e48a63d
add debian specific files to rat exlusion list
kszucs May 24, 2018
81b31d5
yaml and path fixes for conda recipes
kszucs May 24, 2018
2510786
path fixis again
kszucs May 24, 2018
5149143
fix apt descriptor
kszucs May 25, 2018
80f97d3
attempt to fix conda builds
kszucs May 25, 2018
23642a8
fix conda travis env matrix
kszucs May 25, 2018
a0ae5c3
update pyarrow's arrow-cpp dependency
kszucs May 25, 2018
7280d90
add parquet-cpp recipe
kszucs May 26, 2018
a8f26de
license headers for parquet recipe
kszucs May 26, 2018
da6374b
build parquet-cpp conda recipe on windows too
kszucs May 26, 2018
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
36 changes: 36 additions & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,42 @@ cpp/src/plasma/thirdparty/dlmalloc.c
cpp/src/plasma/thirdparty/xxhash.cc
cpp/src/plasma/thirdparty/xxhash.h
dev/release/rat_exclude_files.txt
dev/tasks/linux-packages/debian.ubuntu-trusty/compat
dev/tasks/linux-packages/debian.ubuntu-trusty/control
dev/tasks/linux-packages/debian.ubuntu-trusty/gir1.2-arrow-1.0.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-dev.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-glib-dev.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-glib-doc.doc-base
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-glib-doc.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-glib-doc.links
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-glib0.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow-python0.install
dev/tasks/linux-packages/debian.ubuntu-trusty/libarrow0.install
dev/tasks/linux-packages/debian.ubuntu-trusty/patches/series
dev/tasks/linux-packages/debian.ubuntu-trusty/rules
dev/tasks/linux-packages/debian.ubuntu-trusty/source/format
dev/tasks/linux-packages/debian.ubuntu-trusty/watch
dev/tasks/linux-packages/debian/compat
dev/tasks/linux-packages/debian/control
dev/tasks/linux-packages/debian/gir1.2-arrow-1.0.install
dev/tasks/linux-packages/debian/gir1.2-arrow-gpu-1.0.install
dev/tasks/linux-packages/debian/libarrow-dev.install
dev/tasks/linux-packages/debian/libarrow-glib-dev.install
dev/tasks/linux-packages/debian/libarrow-glib-doc.doc-base
dev/tasks/linux-packages/debian/libarrow-glib-doc.install
dev/tasks/linux-packages/debian/libarrow-glib-doc.links
dev/tasks/linux-packages/debian/libarrow-glib0.install
dev/tasks/linux-packages/debian/libarrow-gpu-dev.install
dev/tasks/linux-packages/debian/libarrow-gpu-glib-dev.install
dev/tasks/linux-packages/debian/libarrow-gpu-glib0.install
dev/tasks/linux-packages/debian/libarrow-gpu0.install
dev/tasks/linux-packages/debian/libarrow-python-dev.install
dev/tasks/linux-packages/debian/libarrow-python0.install
dev/tasks/linux-packages/debian/libarrow0.install
dev/tasks/linux-packages/debian/patches/series
dev/tasks/linux-packages/debian/rules
dev/tasks/linux-packages/debian/source/format
dev/tasks/linux-packages/debian/watch
go/arrow/Gopkg.lock
go/arrow/internal/cpu/*
go/arrow/type_string.go
Expand Down
208 changes: 208 additions & 0 deletions dev/tasks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<!--
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.
-->

# Arrow Packaging

The content of this directory aims for automating the historically error prone
process of Arrow packaging.

Packages:
- C++ and Python [conda-forge packages](conda-recipes) for Linux, Mac and
Windows
- Python [Wheels](python-wheels) for Linux, Mac and Windows
- C++ and GLib [Linux packages](linux-packages) for multiple distributions
- Java

## Architecture

### Executors

Individual jobs are executed on public CI services, currently:
- Linux: TravisCI
- Mac: TravisCI
- Windows: AppVeyor

### Queue

Because of the nature of how the CI services work, the scheduling of jobs happens
through an additional git repository, which acts like a job queue for the tasks.
A job is a git commit on a particular git branch, containing only the required
configuration file to run the requested build (currently `.travis.yml` or
`appveyor.yml`).

### Scheduler

[Crossbow.py](crossbow.py) handles version generation, task rendering and
submission. The tasks are defined in `tasks.yml`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How do we intend to obtain the status of a particular job run if this tool does not record any state? Branch names, commit hashes, etc.

Ideally, somewhere would be recorded:

  • A unique identifier for a particular run
  • The list of tasks executed and where to find them (repository, branch, commit hash or tag, CI service run)
  • The expected artifact(s) produced by each task
  • Any additional information necessary to query the status of the jobs

Since the complete run could take a while to execute, and it does to asychonously, we would want to have some tool to poll the jobs for completeness, and if complete, to download all of the artifacts locally so that they can be signed.

This doesn't need to be done in this patch obviously! Perhaps this part can go into a JIRA and we can decide on the solution to this issue



## Install

> The following guide depends on GitHub, but theoretically any git server can be
> used.

1. [Create the queue
repository](https://help.github.com/articles/creating-a-new-repository)
2. Enable [TravisCI](https://travis-ci.org/getting_started) and
[Appveyor](https://www.appveyor.com/docs/) integrations on it
3. Clone the newly created, by default the scripts looks for `crossbow` next to
arrow repository.

```bash
git clone https://github.com/<user>/crossbow crossbow

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this repository name is configurable, can you mention here where to find the configuration for this?

```

4. [Create a Personal Access
Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
5. Export the token as an environment variable:

```bash
export CROSSBOW_GITHUB_TOKEN=<token>
```

> or pass as an argument to the CLI script `--github-token`

6. Install the python dependencies for the script:

```bash
conda install -y jinja2 pygit2 click pyyaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does one install conda?

```

```bash
# pygit2 requires libgit2: http://www.pygit2.org/install.html
pip install -y jinja2 pygit2 click pyyaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this require Python 3 or is Python 2 OK?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't tried with py2, but it's probably ok. Do we prefer compatibility?

```

7. Try running it:
```bash
$ python crossbow.py --help
```


## Usage

The script does the following:

1. Detects the current repository, thus supports forks. The following snippet
will build kszucs's fork instead of the upstream apache/arrow repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it use whatever is the origin repository? Some people may have apache/arrow as origin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Uwe already had a request regarding to that. It uses the currently checked out branch's remote counterpart.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works nicely!


```bash
$ git clone https://github.com/kszucs/arrow
$ git clone https://github.com/kszucs/crossbow

$ cd arrow/dev/tasks
$ python crossbow.py
```

2. Gets the HEAD commit of the currently checked out branch and generates
the version number based on [setuptools_scm](https://pypi.python.org/pypi/setuptools_scm).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you need to lift the setuptools_scm hacks from https://github.com/apache/arrow/blob/master/python/setup.py#L486 to make this work properly. cc @xhochy

@kszucs kszucs May 31, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

BTW We can self generate the version via pygit2.Repository.describe(), but then how would we use the same version scheme as setuptools_scm in setup.py?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using

import setuptools_scm.git
describe = setuptools_scm.git.DEFAULT_DESCRIBE + " --match 'apache-arrow-[0-9]*'"

we get a git describe command that output the correct version. The most important part is the additional match, otherwise this is just plain describe to the latest tag.

So to build a particular branch, just check out before running the script:

```bash
git checkout ARROW-<ticket number>
python dev/tasks/crossbow.py --dry-run
```

> Note that the arrow branch must be pushed beforehand, because the script
> will clone the selected branch.

3. Reads and renders the required build configurations with the parameters
substituted.
2. Create a commit per build configuration to its own branch. For example
to build `travis-linux-conda.yml` it will place a commit to the tip of
`crossbow@travis-linux-conda` branch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Has this changed now since tasks have names?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this needs to be updated.

3. Pushes the modified branches to GitHub which triggers the builds.
For authentication it uses github oauth tokens described in the install
section.


### Examples

The script accepts a pattern as a first argument to narrow the build scope:

Run all builds:

```bash
$ python crossbow.py
Repository: https://github.com/kszucs/arrow@tasks
Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702
Version: 0.9.1.dev48+g810a7188.d20180414
Pushed branches:
- travis-osx-wheel
- travis-linux-packages
- travis-linux-wheel
- appveyor-win-wheel
- appveyor-win-conda
- travis-linux-conda
- travis-osx-conda
```

Just render without applying or committing the changes:

```bash
$ python crossbow.py --dry-run
```

Run only `conda` package builds but on all platforms:

```bash
$ python crossbow.py conda
Repository: https://github.com/kszucs/arrow@tasks
Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702
Version: 0.9.1.dev48+g810a7188.d20180414
Pushed branches:
- appveyor-win-conda
- travis-linux-conda
- travis-osx-conda
```

Run `wheel` builds:

```bash
$ python crossbow.py wheel
Repository: https://github.com/kszucs/arrow@tasks
Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702
Version: 0.9.1.dev48+g810a7188.d20180414
Pushed branches:
- travis-osx-wheel
- travis-linux-wheel
- appveyor-win-wheel
```

Run `osx` builds:

```bash
$ python crossbow.py osx
Repository: https://github.com/kszucs/arrow@tasks
Commit SHA: cad1df2c7f650ad3434319bbbefed0d4abe45e4a
Version: 0.9.1.dev130+gcad1df2c.d20180414
Pushed branches:
- travis-osx-wheel
- travis-osx-conda
```

Run only `linux-conda` package build:

```bash
$ python crossbow.py linux-conda
Repository: https://github.com/kszucs/arrow@tasks
Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702
Version: 0.9.1.dev48+g810a7188.d20180414
Pushed branches:
- travis-linux-conda
```
57 changes: 57 additions & 0 deletions dev/tasks/conda-recipes/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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.

environment:
matrix:
- TARGET_ARCH: x64
CONDA_PY: 35
CONDA_INSTALL_LOCN: C:\\Miniconda35-x64
- TARGET_ARCH: x64
CONDA_PY: 36
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
ARROW_SRC: C:\apache-arrow
ARROW_VERSION: {{ ARROW_VERSION }}

install:
- cmd: rmdir C:\cygwin /s /q
# Add path, activate `conda` and update conda.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda.exe update --yes --quiet conda
- cmd: set PYTHONUNBUFFERED=1
# Add our channels.
- cmd: conda.exe config --set show_channel_urls true
- cmd: conda.exe config --remove channels defaults
- cmd: conda.exe config --add channels defaults
- cmd: conda.exe config --add channels conda-forge
# Configure the VM.
- cmd: conda.exe install -n root --quiet --yes conda-forge-build-setup
- cmd: run_conda_forge_build_setup

# Skip .NET project specific build phase.
build: off

test_script:
- git clone -b {{ ARROW_BRANCH }} {{ ARROW_REPO }} %ARROW_SRC% || exit /B
- git checkout {{ ARROW_SHA }} || exit /B
- pushd %ARROW_SRC%\dev\tasks\conda-recipes
- conda.exe build parquet-cpp arrow-cpp pyarrow


notifications:
- provider: Email
to:
- {{ EMAIL }}
35 changes: 35 additions & 0 deletions dev/tasks/conda-recipes/arrow-cpp/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements. See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership. The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied. See the License for the
@rem specific language governing permissions and limitations
@rem under the License.

mkdir "%SRC_DIR%"\cpp\build
pushd "%SRC_DIR%"\cpp\build

set ARROW_BUILD_TOOLCHAIN=%LIBRARY_PREFIX%

cmake -G "%CMAKE_GENERATOR%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DARROW_BOOST_USE_SHARED:BOOL=ON ^
-DARROW_BUILD_TESTS:BOOL=OFF ^
-DARROW_BUILD_UTILITIES:BOOL=OFF ^
-DCMAKE_BUILD_TYPE=release ^
-DARROW_PYTHON:BOOL=ON ^
-DARROW_ORC:BOOL=ON ^
..

cmake --build . --target INSTALL --config Release

popd
45 changes: 45 additions & 0 deletions dev/tasks/conda-recipes/arrow-cpp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh

# 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.

set -e
set -x

# Build dependencies
export ARROW_BUILD_TOOLCHAIN=$PREFIX

cd cpp
mkdir build-dir
cd build-dir

cmake \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_LIBDIR=$PREFIX/lib \
-DARROW_BOOST_USE_SHARED=ON \
-DARROW_BUILD_BENCHMARKS=OFF \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_BUILD_TESTS=OFF \
-DARROW_JEMALLOC=OFF \
-DARROW_PLASMA=ON \
-DARROW_PYTHON=ON \
-DARROW_ORC=ON \
..

make -j${CPU_COUNT}
make install
Loading