Apache DataFusion SQL Query Engine
ARROW-5809: [CI] [Rust] Travis runs dockerized Rust build
Andy Groveddf7bc405a91
diff --git a/.dockerignore b/.dockerignoreindex 64e3890e62..3df8c2ba5f 100644--- a/.dockerignore+++ b/.dockerignore@@ -20,6 +20,7 @@ docker_cachedocs/_build# IDE+.idea.vscode*/.vscode@@ -94,6 +95,9 @@ js/test/data/**/*.arrow# Rustrust/target+rust/arrow/target+rust/parquet/target+rust/datafusion/target# Sitesite/diff --git a/.travis.yml b/.travis.ymlindex a107bcc3f4..b5285588a6 100644--- a/.travis.yml+++ b/.travis.yml@@ -284,30 +284,12 @@ matrix:# -------------------------------------------------------------------------- name: Rustlanguage: rust- cache: cargo- addons:- apt:- packages:- - libcurl4-openssl-dev- - libelf-dev- - libdw-dev- - binutils-dev- - libssl-dev- - cmake+ os: linuxbefore_script:- if [ $ARROW_CI_RUST_AFFECTED != "1" ]; then exit; fi- - $TRAVIS_BUILD_DIR/ci/travis_install_cargo.sh+ - docker-compose build --pull rustscript:- - $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh- before_cache:- cargo install cargo-tarpaulin -f- after_success:- - pushd ${TRAVIS_BUILD_DIR}/rust- # Run coverage for codecov.io- - export ARROW_TEST_DATA=$TRAVIS_BUILD_DIR/testing/data- - export PARQUET_TEST_DATA=$TRAVIS_BUILD_DIR/cpp/submodules/parquet-testing/data- - cargo tarpaulin --out Xml- - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"+ - docker-compose run rust# -------------------------------------------------------------------------- name: Godiff --git a/ci/travis_script_rust.sh b/ci/docker_build_rust.shsimilarity index 92%rename from ci/travis_script_rust.shrename to ci/docker_build_rust.shindex 22059df228..7c71105f57 100755--- a/ci/travis_script_rust.sh+++ b/ci/docker_build_rust.sh@@ -1,5 +1,4 @@#!/usr/bin/env bash-# 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@@ -19,17 +18,18 @@set -e-source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh--RUST_DIR=${TRAVIS_BUILD_DIR}/rust--pushd $RUST_DIR+cd /arrow/rust# show activated toolchainrustup show+# clean first+cargo clean+# raises on any formatting errors+echo "Running formatting checks ..."cargo +stable fmt --all -- --check+echo "Formatting checks completed"# build entire projectRUSTFLAGS="-D warnings" cargo build --all-targetsdiff --git a/ci/travis_install_cargo.sh b/ci/travis_install_cargo.shdeleted file mode 100755index dac5522c8a..0000000000--- a/ci/travis_install_cargo.sh+++ /dev/null@@ -1,29 +0,0 @@-#!/usr/bin/env bash--# 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--# ensure that both toolchains are installed-rustup install stable-rustup component add rustfmt-rustup install nightly--export PATH=$HOME/.local/bin:$PATH-export CARGO_TARGET_DIR=$TRAVIS_BUILD_DIR/target-export PATH=$HOME/.cargo/bin:$PATHdiff --git a/docker-compose.yml b/docker-compose.ymlindex 0ce7e38bc5..c82991883b 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -384,8 +384,6 @@ services:build:context: .dockerfile: rust/Dockerfile- environment:- PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/datavolumes: *ubuntu-volumesr:diff --git a/rust/Dockerfile b/rust/Dockerfileindex a6e0463253..b9097c08e1 100644--- a/rust/Dockerfile+++ b/rust/Dockerfile@@ -15,15 +15,23 @@# specific language governing permissions and limitations# under the License.-FROM rustlang/rust:nightly+FROM rust:1.38.0-buster+RUN rustup show-# sadly cargo doesn't have a command to fetch and build the-# dependencies without building the library itself-ENV CARGO_TARGET_DIR=/build/rust-COPY rust/Cargo.toml /arrow/rust/Cargo.toml-WORKDIR /arrow/rust+# Install stable rustfmt+RUN rustup install stable+RUN rustup component add rustfmt+# Install the specific version of Rust nightly that we need so that we don't need to download it for every CI run+COPY rust/rust-toolchain /tmp+RUN rustup install "$(cat /tmp/rust-toolchain)"+RUN rustup default "$(cat /tmp/rust-toolchain)"++# Enable stable rustfmt for nightly Rust+RUN rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu++# Set environment variables for location of test data required by unit and integration testsENV ARROW_TEST_DATA=/arrow/testing/dataENV PARQUET_TEST_DATA=/arrow/cpp/submodules/parquet-testing/data-CMD ["cargo", "test"]+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_rust.sh"]