Apache DataFusion SQL Query Engine
ARROW-5664: [Crossbow] Execute nightly crossbow tests on CircleCI instead of Travis
Krisztián Szűcs07d89cfb44b4
diff --git a/dev/tasks/README.md b/dev/tasks/README.mdindex 619d8a2311..b68ae398c0 100644--- a/dev/tasks/README.md+++ b/dev/tasks/README.md@@ -58,8 +58,10 @@ submission. The tasks are defined in `tasks.yml`1. [Create the queuerepository](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+2. Enable [TravisCI](https://travis-ci.org/getting_started),+ [Appveyor](https://www.appveyor.com/docs/) and+ [CircleCI](https://circleci.com/docs/2.0/getting-started/)+ integrations on it- turn off Travis' [auto cancellation](https://docs.travis-ci.com/user/customizing-the-build/#Building-only-the-latest-commit) feature on branches@@ -92,6 +94,10 @@ submission. The tasks are defined in `tasks.yml`- TravisCI: `https://travis-ci.org/<ghuser>/<ghrepo>/settings`- Appveyor: `https://ci.appveyor.com/project/<ghuser>/<ghrepo>/settings/environment`+ - CircleCI: `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.7. Install Python 3.6:diff --git a/dev/tasks/crossbow.py b/dev/tasks/crossbow.pyindex e71418809e..b58ae9de96 100755--- a/dev/tasks/crossbow.py+++ b/dev/tasks/crossbow.py@@ -53,6 +53,62 @@ def md(template, *args, **kwargs):return template.format(*map(escape, args), **toolz.valmap(escape, kwargs))+def unflatten(mapping):+ result = {}+ for path, value in mapping.items():+ parents, leaf = path[:-1], path[-1]+ # create the hierarchy until we reach the leaf value+ temp = result+ for parent in parents:+ temp.setdefault(parent, {})+ temp = temp[parent]+ # set the leaf value+ temp[leaf] = value++ return result+++# configurations for setting up branch skipping+# - appveyor has a feature to skip builds without an appveyor.yml+# - travis reads from the master branch and applies the rules+# - circle requires the configuration to be present on all branch, even ones+# that are configured to be skipped++_default_travis_yml = """+branches:+ only:+ - master+ - /.*-travis-.*/++os: linux+dist: trusty+language: generic+"""++_default_circle_yml = """+version: 2++jobs:+ build:+ machine: true++workflows:+ version: 2+ build:+ jobs:+ - build:+ filters:+ branches:+ only:+ - /.*-circle-.*/+"""++_default_tree = {+ '.travis.yml': _default_travis_yml,+ '.circleci/config.yml': _default_circle_yml+}++class JiraChangelog:def __init__(self, version, username, password,@@ -263,17 +319,28 @@ class Repo:return pygit2.Signature(self.user_name, self.user_email,int(time.time()))- def create_branch(self, branch_name, files, parents=[], message='',- signature=None):- # 1. create tree+ def create_tree(self, files):builder = self.repo.TreeBuilder()for filename, content in files.items():- # insert the file and creating the new filetree- blob_id = self.repo.create_blob(content)- builder.insert(filename, blob_id, pygit2.GIT_FILEMODE_BLOB)+ if isinstance(content, dict):+ # create a subtree+ tree_id = self.create_tree(content)+ builder.insert(filename, tree_id, pygit2.GIT_FILEMODE_TREE)+ else:+ # create a file+ blob_id = self.repo.create_blob(content)+ builder.insert(filename, blob_id, pygit2.GIT_FILEMODE_BLOB)tree_id = builder.write()+ return tree_id++ def create_branch(self, branch_name, files, parents=[], message='',+ signature=None):+ # 1. create tree+ files = toolz.keymap(lambda path: tuple(path.split('/')), files)+ files = unflatten(files)+ tree_id = self.create_tree(files)# 2. create commit with the tree created above# TODO(kszucs): pass signature explicitly@@ -349,7 +416,9 @@ class Queue(Repo):# create tasks' branchesfor task_name, task in job.tasks.items():- task.branch = '{}-{}'.format(job.branch, task_name)+ # adding CI's name to the end of the branch in order to use skip+ # patterns on travis and circleci+ task.branch = '{}-{}-{}'.format(job.branch, task.ci, task_name)files = task.render_files(job=job, arrow=job.target)branch = self.create_branch(task.branch, files=files)self.create_tag(task.tag, branch.target)@@ -465,8 +534,10 @@ class Task:submitting the job to a queue."""- def __init__(self, platform, template, artifacts=None, params=None):+ def __init__(self, platform, ci, template, artifacts=None, params=None):assert platform in {'win', 'osx', 'linux'}+ assert ci in {'circle', 'travis', 'appveyor'}+ self.ci = ciself.platform = platformself.template = templateself.artifacts = artifacts or []@@ -479,25 +550,20 @@ class Task:params = toolz.merge(self.params, extra_params)template = Template(path.read_text(), undefined=StrictUndefined)rendered = template.render(task=self, **params)- return {self.filename: rendered}+ return toolz.merge(_default_tree, {self.filename: rendered})@propertydef tag(self):return self.branch- @property- def ci(self):- if self.platform == 'win':- return 'appveyor'- else:- return 'travis'-@propertydef filename(self):- if self.ci == 'appveyor':- return 'appveyor.yml'- else:- return '.travis.yml'+ config_files = {+ 'circle': '.circleci/config.yml',+ 'travis': '.travis.yml',+ 'appveyor': 'appveyor.yml'+ }+ return config_files[self.ci]class Job:@@ -518,7 +584,7 @@ class Job:with StringIO() as buf:yaml.dump(self, buf)content = buf.getvalue()- return {'job.yml': content}+ return toolz.merge(_default_tree, {'job.yml': content})@propertydef email(self):diff --git a/dev/tasks/docker-tests/circle.linux.yml b/dev/tasks/docker-tests/circle.linux.ymlnew file mode 100644index 0000000000..47f18173d0--- /dev/null+++ b/dev/tasks/docker-tests/circle.linux.yml@@ -0,0 +1,41 @@+# 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.++version: 2+jobs:+ build:+ machine:+ image: circleci/classic:201808-01+ steps:+ - run: docker -v+ - run: docker-compose -v+ - run: git clone --no-checkout {{ arrow.remote }} arrow+ - run: git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}+ - run: git -C arrow checkout {{ arrow.head }}+ - run: git -C arrow submodule update --init --recursive+ - run: |+ pushd arrow+ {%- for command in commands %}+ {{ command }}+ {%- endfor %}+ popd++workflows:+ version: 2+ build:+ jobs:+ - builddiff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.ymlindex 910650be5e..16e90f7ef3 100644--- a/dev/tasks/tasks.yml+++ b/dev/tasks/tasks.yml@@ -66,6 +66,7 @@ tasks:############################## Conda Linux ##################################conda-linux-gcc-py27:+ ci: travisplatform: linuxtemplate: conda-recipes/travis.linux.ymlparams:@@ -75,6 +76,7 @@ tasks:- pyarrow-{no_rc_version}-py27(h[a-z0-9]+)_0.tar.bz2conda-linux-gcc-py36:+ ci: travisplatform: linuxtemplate: conda-recipes/travis.linux.ymlparams:@@ -84,6 +86,7 @@ tasks:- pyarrow-{no_rc_version}-py36(h[a-z0-9]+)_0.tar.bz2conda-linux-gcc-py37:+ ci: travisplatform: linuxtemplate: conda-recipes/travis.linux.ymlparams:@@ -95,6 +98,7 @@ tasks:############################## Conda OSX ####################################conda-osx-clang-py27:+ ci: travisplatform: osxtemplate: conda-recipes/travis.osx.ymlparams:@@ -104,6 +108,7 @@ tasks:- pyarrow-{no_rc_version}-py27(h[a-z0-9]+)_0.tar.bz2conda-osx-clang-py36:+ ci: travisplatform: osxtemplate: conda-recipes/travis.osx.ymlparams:@@ -124,6 +129,7 @@ tasks:############################## Conda Windows ################################conda-win-vs2015-py36:+ ci: appveyorplatform: wintemplate: conda-recipes/appveyor.ymlparams:@@ -133,6 +139,7 @@ tasks:- pyarrow-{no_rc_version}-py36(h[a-z0-9]+)_0.tar.bz2conda-win-vs2015-py37:+ ci: appveyorplatform: wintemplate: conda-recipes/appveyor.ymlparams:@@ -144,6 +151,7 @@ tasks:############################## Wheel Linux ##################################wheel-linux-cp27m:+ ci: travisplatform: linuxtemplate: python-wheels/travis.linux.ymlparams:@@ -154,6 +162,7 @@ tasks:- pyarrow-{no_rc_version}-cp27-cp27m-manylinux1_x86_64.whlwheel-linux-cp27mu:+ ci: travisplatform: linuxtemplate: python-wheels/travis.linux.ymlparams:@@ -165,6 +174,7 @@ tasks:- pyarrow-{no_rc_version}-cp27-cp27mu-manylinux1_x86_64.whlwheel-linux-cp35m:+ ci: travisplatform: linuxtemplate: python-wheels/travis.linux.ymlparams:@@ -176,6 +186,7 @@ tasks:- pyarrow-{no_rc_version}-cp35-cp35m-manylinux1_x86_64.whlwheel-linux-cp36m:+ ci: travisplatform: linuxtemplate: python-wheels/travis.linux.ymlparams:@@ -187,6 +198,7 @@ tasks:- pyarrow-{no_rc_version}-cp36-cp36m-manylinux1_x86_64.whlwheel-linux-cp37m:+ ci: travisplatform: linuxtemplate: python-wheels/travis.linux.ymlparams:@@ -200,6 +212,7 @@ tasks:############################## Wheel OSX ####################################wheel-osx-cp27m:+ ci: travisplatform: osxtemplate: python-wheels/travis.osx.ymlparams:@@ -208,6 +221,7 @@ tasks:- pyarrow-{no_rc_version}-cp27-cp27m-macosx_10_6_intel.whlwheel-osx-cp35m:+ ci: travisplatform: osxtemplate: python-wheels/travis.osx.ymlparams:@@ -216,6 +230,7 @@ tasks:- pyarrow-{no_rc_version}-cp35-cp35m-macosx_10_6_intel.whlwheel-osx-cp36m:+ ci: travisplatform: osxtemplate: python-wheels/travis.osx.ymlparams:@@ -224,6 +239,7 @@ tasks:- pyarrow-{no_rc_version}-cp36-cp36m-macosx_10_6_intel.whlwheel-osx-cp37m:+ ci: travisplatform: osxtemplate: python-wheels/travis.osx.ymlparams:@@ -234,6 +250,7 @@ tasks:############################## Wheel Windows ################################wheel-win-cp35m:+ ci: appveyorplatform: wintemplate: python-wheels/appveyor.ymlparams:@@ -242,6 +259,7 @@ tasks:- pyarrow-{no_rc_version}-cp35-cp35m-win_amd64.whlwheel-win-cp36m:+ ci: appveyorplatform: wintemplate: python-wheels/appveyor.ymlparams:@@ -250,6 +268,7 @@ tasks:- pyarrow-{no_rc_version}-cp36-cp36m-win_amd64.whlwheel-win-cp37m:+ ci: appveyorplatform: wintemplate: python-wheels/appveyor.ymlparams:@@ -260,6 +279,7 @@ tasks:############################## Linux PKGS ####################################debian-stretch:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -323,6 +343,7 @@ tasks:# Don't use this for now. We can't complete this task in 50min on Travis CI.debian-stretch-arm64:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.arm64.ymlparams:@@ -360,6 +381,7 @@ tasks:- libparquet14_{no_rc_version}-1_amd64.debubuntu-xenial:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -408,6 +430,7 @@ tasks:- plasma-store-server_{no_rc_version}-1_amd64.debubuntu-bionic:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -459,6 +482,7 @@ tasks:- plasma-store-server_{no_rc_version}-1_amd64.debubuntu-cosmic:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -510,6 +534,7 @@ tasks:- plasma-store-server_{no_rc_version}-1_amd64.debcentos-6:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -527,6 +552,7 @@ tasks:- plasma-libs-{no_rc_version}-1.el6.x86_64.rpmcentos-7:+ ci: travisplatform: linuxtemplate: linux-packages/travis.linux.ymlparams:@@ -557,12 +583,14 @@ tasks:############################## Gandiva Tasks ################################gandiva-jar-trusty:+ ci: travisplatform: linuxtemplate: gandiva-jars/travis.linux.ymlartifacts:- arrow-gandiva-{no_rc_version}-SNAPSHOT.jargandiva-jar-osx:+ ci: travisplatform: osxtemplate: gandiva-jars/travis.osx.ymlartifacts:diff --git a/dev/tasks/tests.yml b/dev/tasks/tests.ymlindex fff5a603e7..f8dc8178de 100644--- a/dev/tasks/tests.yml+++ b/dev/tasks/tests.yml@@ -77,8 +77,9 @@ tasks:############################## Language containers #########################docker-r:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build cpp@@ -86,40 +87,45 @@ tasks:- docker-compose run rdocker-rust:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build rust- docker-compose run rustdocker-cpp:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build cpp- docker-compose run cppdocker-cpp-alpine:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build cpp-alpine- docker-compose run cpp-alpinedocker-cpp-cmake32:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build cpp-cmake32- docker-compose run cpp-cmake32docker-c_glib:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build cpp@@ -127,32 +133,36 @@ tasks:- docker-compose run cppdocker-go:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build go- docker-compose run godocker-js:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build js- docker-compose run jsdocker-java:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:commands:- docker-compose build java- docker-compose run javadocker-python-2.7:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 2.7@@ -162,8 +172,9 @@ tasks:- docker-compose run pythondocker-python-3.6:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -173,8 +184,9 @@ tasks:- docker-compose run pythondocker-python-3.7:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.7@@ -184,8 +196,9 @@ tasks:- docker-compose run pythondocker-python-2.7-alpine:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 2.7@@ -195,8 +208,9 @@ tasks:- docker-compose run python-alpinedocker-python-3.6-alpine:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -206,8 +220,9 @@ tasks:- docker-compose run python-alpinedocker-python-2.7-nopandas:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 2.7@@ -218,8 +233,9 @@ tasks:- docker-compose run python-nopandasdocker-python-3.6-nopandas:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -232,8 +248,9 @@ tasks:###################### Documentation building tests #########################docker-docs:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -246,8 +263,9 @@ tasks:############################## Linter tests #################################docker-lint:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -258,8 +276,9 @@ tasks:- docker-compose run lintdocker-iwyu:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -270,8 +289,9 @@ tasks:- docker-compose run iwyudocker-clang-format:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -284,8 +304,9 @@ tasks:############################## Integration tests ############################docker-dask-integration:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -296,8 +317,9 @@ tasks:- docker-compose run dask-integrationdocker-hdfs-integration:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -308,8 +330,9 @@ tasks:- docker-compose run hdfs-integrationdocker-spark-integration:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -320,8 +343,9 @@ tasks:- docker-compose run spark-integrationdocker-turbodbc-integration:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6@@ -332,8 +356,9 @@ tasks:- docker-compose run turbodbc-integrationdocker-pandas-master:+ ci: circleplatform: linux- template: docker-tests/travis.linux.yml+ template: docker-tests/circle.linux.ymlparams:environment:PYTHON_VERSION: 3.6