Packaging and Testing with Crossbow¶
The content of
arrow/dev/tasks directory aims for automating the process of
Arrow packaging and integration testing.
- Integration tests:
Various docker tests
Individual jobs are executed on public CI services, currently:
Linux: TravisCI, CircleCI, Azure Pipelines
Mac: TravisCI, Azure Pipelines
Windows: AppVeyor, Azure Pipelines
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. Anyone can host a
queue repository which is usually
A job is a git commit on a particular git branch, containing only the required
configuration file to run the requested build (like
The following guide depends on GitHub, but theoretically any git server can be used.
turn off Travis’ auto cancellation feature on branches
Clone the newly created repository next to the arrow repository:
By default the scripts looks for
crossbownext to arrow repository, but this can configured through command line arguments.
git clone https://github.com/<user>/crossbow crossbow
Important note: Crossbow only supports GitHub token based authentication. Although it overwrites the repository urls provided with ssh protocol, it’s advisable to use the HTTPS repository URLs.
Locally export the token as an environment variable:
or pass as an argument to the CLI script
Export the previously created GitHub token on both CI services:
CROSSBOW_GITHUB_TOKENencrypted environment variable. You can set them at the following URLs, where
ghuseris the GitHub username and
ghrepois the GitHub repository name (typically
On Appveyor check the
skip branches without appveyor.ymlcheckbox on the web UI under crossbow repository’s settings.
Install Python (minimum supported version is 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 --file arrow/ci/conda_env_crossbow.txt
# pygit2 requires libgit2: http://www.pygit2.org/install.html pip install \ jinja2 \ pygit2 \ click \ ruamel.yaml \ setuptools_scm \ github3.py \ 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 --help # show the available options $ 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 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:
Pushes the modified branches to GitHub which triggers the builds. For authentication it uses GitHub OAuth tokens described in the install section.
Query the build status¶
Build id (which has a corresponding branch in the queue repository) is returned
python crossbow.py status <build id / branch name>
Download the build artifacts¶
python crossbow.py artifacts <build id / branch name>
Submit command accepts a list of task names and/or a list of task-group names to select which tasks to build.
Run multiple builds:
$ python crossbow.py submit debian-stretch conda-linux-gcc-py37 Repository: https://github.com/kszucs/arrow@tasks Commit SHA: 810a718836bb3a8cefc053055600bdcc440e6702 Version: 0.9.1.dev48+g810a7188.d20180414 Pushed branches: - debian-stretch - conda-linux-gcc-py37
Just render without applying or committing the changes:
$ python crossbow.py submit --dry-run task_name
conda package builds and a Linux one:
$ python crossbow.py submit --group conda centos-7
$ python crossbow.py submit --group wheel
There are multiple task groups in the
tasks.yml like docker, integration
and cpp-python for running docker based tests.
python crossbow.py submit supports multiple options and arguments, for more
see its help page:
$ python crossbow.py submit --help