The content of this directory aims for automating the historically error prone process of Arrow packaging.
Packages:
Individual jobs are executed on public CI services, currently:
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
).
Crossbow.py handles version generation, task rendering and submission. The tasks are defined in tasks.yml
The following guide depends on GitHub, but theoretically any git server can be used.
Enable TravisCI, Appveyor and CircleCI integrations on it
Clone the newly created, by default the scripts looks for crossbow
next to arrow repository.
git clone https://github.com/<user>/crossbow crossbow
Important note: Crossbow currently requires HTTPS repository URLs. It will fail with an unintuitive error if you clone from a git@
SSH URL. See ARROW-3572.
Locally export the token as an environment variable:
export CROSSBOW_GITHUB_TOKEN=<token>
or pass as an argument to the CLI script
--github-token
Export the previously created GitHub token on both CI services:
Use CROSSBOW_GITHUB_TOKEN
encrypted environment variable. You can set them at the following URLs, where ghuser
is the GitHub username and ghrepo
is the GitHub repository name (typically crossbow
):
https://travis-ci.org/<ghuser>/<ghrepo>/settings
https://ci.appveyor.com/project/<ghuser>/<ghrepo>/settings/environment
https://circleci.com/gh/<ghuser>/<ghrepo>/edit#env-vars
On Appveyor check the skip branches without appveyor.yml
checkbox on the web UI under crossbow repository's settings.
Install Python 3.6:
Miniconda is preferred, see installation instructions: https://conda.io/docs/user-guide/install/index.html
Install the python dependencies for the script:
conda install -c conda-forge -y jinja2 pygit2 click ruamel.yaml setuptools_scm github3.py python-gnupg toolz jira
# pygit2 requires libgit2: http://www.pygit2.org/install.html pip install jinja2 pygit2 click ruamel.yaml setuptools_scm github3.py python-gnupg toolz jira
Try running it:
$ python crossbow.py --help
The script does the following:
Detects the current repository, thus supports forks. The following snippet will build kszucs's fork instead of the upstream apache/arrow repository.
$ git clone https://github.com/kszucs/arrow $ git clone https://github.com/kszucs/crossbow $ cd arrow/dev/tasks $ python crossbow.py submit conda-win conda-linux conda-osx
Gets the HEAD commit of the currently checked out branch and generates the version number based on setuptools_scm. So to build a particular branch, just check out before running the script:
git checkout ARROW-<ticket number> python dev/tasks/crossbow.py submit --dry-run conda-linux conda-osx
Note that the arrow branch must be pushed beforehand, because the script will clone the selected branch.
Reads and renders the required build configurations with the parameters substituted.
Create a branch per task, prefixed with the job id. For example to build conda recipes on linux it will create a new branch: crossbow@build-<id>-conda-linux
.
Pushes the modified branches to GitHub which triggers the builds. For authentication it uses GitHub OAuth tokens described in the install section.
python crossbow.py status <build id / branch name>
python crossbow.py artifacts <build id / branch name>
The script accepts a pattern as a first argument to narrow the build scope:
Run multiple builds:
$ python crossbow.py submit debian-stretch conda-linux-py36 wheel-win-py36 Repository: https://github.com/kszucs/arrow@tasks Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702 Version: 0.9.1.dev48+g810a7188.d20180414 Pushed branches: - debian-stretch - conda-linux-py36 - wheel-win-py36
Just render without applying or committing the changes:
$ python crossbow.py submit --dry-run task_name
Run only conda
package builds and a Linux one:
$ python crossbow.py submit -g conda centos-7
Run wheel
builds:
$ python crossbow.py submit --group wheel