Repository navigation
ARROW-2430: [Packaging] MVP for branch based packaging automation #1869
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
Changes from all commits
06af445
5c96243
e38a716
96c00b3
56991a6
f0e0dcd
75fc775
228b829
eb0d25f
565c720
8d3bb2c
6164b28
5a1115d
72fa4eb
01d99e9
6d47174
5eaf55a
aaaae6d
fdac3fd
35f7350
8405cbf
4b5f642
fa73345
5b73f35
570017d
e1a62ab
27e2b88
62cfd42
ff9d6d0
6a984b8
6c0aec0
4439a93
401cf31
7b6321d
a6634af
9e74ead
93c86c7
122b0dc
4ca1921
6aa87cb
351b48e
591baf6
cea4035
c6ca0f5
4ce9e9b
3d36fef
5cf971c
2646734
6a49d51
45a7138
e48a63d
81b31d5
2510786
5149143
80f97d3
23642a8
a0ae5c3
7280d90
a8f26de
da6374b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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` | ||
|
|
||
|
|
||
| ## 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this require Python 3 or is Python 2 OK?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it use whatever is the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this changed now since tasks have names?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| ``` | ||
| 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 }} |
| 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 |
| 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 |
There was a problem hiding this comment.
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:
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