Skip to content

Commit f9fae20

Browse files
Jiayu Liujimexist
authored andcommitted
checkout arrow
1 parent 7422928 commit f9fae20

File tree

6 files changed

+292
-1
lines changed

6 files changed

+292
-1
lines changed

.github/workflows/dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ jobs:
2727
name: Lint C++, Python, R, Rust, Docker, RAT
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v2
30+
- name: Checkout Arrow
31+
uses: actions/checkout@v2
32+
with:
33+
repository: apache/arrow
34+
submodules: true
35+
fetch-depth: 0
3136
- name: Setup Python
3237
uses: actions/setup-python@v2
3338
with:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
FROM arm64v8/ubuntu
18+
19+
ADD ballista-scheduler /
20+
ADD ballista-executor /
21+
22+
# Add benchmarks
23+
ADD tpch /
24+
RUN mkdir /queries
25+
ADD queries/*.sql /queries/
26+
27+
ENV RUST_LOG=info
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Turn .dockerignore to .dockerallow by excluding everything and explicitly
19+
# allowing specific files and directories. This enables us to quickly add
20+
# dependency files to the docker content without scanning the whole directory.
21+
# This setup requires to all of our docker containers have arrow's source
22+
# as a mounted directory.
23+
24+
25+
# Base image extends debian:buster-slim
26+
FROM rust:1.53.0-buster AS builder
27+
28+
RUN apt update && apt -y install musl musl-dev musl-tools libssl-dev openssl
29+
30+
#NOTE: the following was copied from https://github.com/emk/rust-musl-builder/blob/master/Dockerfile under Apache 2.0 license
31+
32+
# The OpenSSL version to use. We parameterize this because many Rust
33+
# projects will fail to build with 1.1.
34+
#ARG OPENSSL_VERSION=1.0.2r
35+
ARG OPENSSL_VERSION=1.1.1b
36+
37+
# Build a static library version of OpenSSL using musl-libc. This is needed by
38+
# the popular Rust `hyper` crate.
39+
#
40+
# We point /usr/local/musl/include/linux at some Linux kernel headers (not
41+
# necessarily the right ones) in an effort to compile OpenSSL 1.1's "engine"
42+
# component. It's possible that this will cause bizarre and terrible things to
43+
# happen. There may be "sanitized" header
44+
RUN echo "Building OpenSSL" && \
45+
ls /usr/include/linux && \
46+
mkdir -p /usr/local/musl/include && \
47+
ln -s /usr/include/linux /usr/local/musl/include/linux && \
48+
ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/musl/include/asm && \
49+
ln -s /usr/include/asm-generic /usr/local/musl/include/asm-generic && \
50+
cd /tmp && \
51+
curl -LO "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" && \
52+
tar xvzf "openssl-$OPENSSL_VERSION.tar.gz" && cd "openssl-$OPENSSL_VERSION" && \
53+
env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY linux-x86_64 && \
54+
env C_INCLUDE_PATH=/usr/local/musl/include/ make depend && \
55+
env C_INCLUDE_PATH=/usr/local/musl/include/ make && \
56+
make install && \
57+
rm /usr/local/musl/include/linux /usr/local/musl/include/asm /usr/local/musl/include/asm-generic && \
58+
rm -r /tmp/*
59+
60+
RUN echo "Building zlib" && \
61+
cd /tmp && \
62+
ZLIB_VERSION=1.2.11 && \
63+
curl -LO "http://zlib.net/zlib-$ZLIB_VERSION.tar.gz" && \
64+
tar xzf "zlib-$ZLIB_VERSION.tar.gz" && cd "zlib-$ZLIB_VERSION" && \
65+
CC=musl-gcc ./configure --static --prefix=/usr/local/musl && \
66+
make && make install && \
67+
rm -r /tmp/*
68+
69+
RUN echo "Building libpq" && \
70+
cd /tmp && \
71+
POSTGRESQL_VERSION=11.2 && \
72+
curl -LO "https://ftp.postgresql.org/pub/source/v$POSTGRESQL_VERSION/postgresql-$POSTGRESQL_VERSION.tar.gz" && \
73+
tar xzf "postgresql-$POSTGRESQL_VERSION.tar.gz" && cd "postgresql-$POSTGRESQL_VERSION" && \
74+
CC=musl-gcc CPPFLAGS=-I/usr/local/musl/include LDFLAGS=-L/usr/local/musl/lib ./configure --with-openssl --without-readline --prefix=/usr/local/musl && \
75+
cd src/interfaces/libpq && make all-static-lib && make install-lib-static && \
76+
cd ../../bin/pg_config && make && make install && \
77+
rm -r /tmp/*
78+
79+
ENV OPENSSL_DIR=/usr/local/musl/ \
80+
OPENSSL_INCLUDE_DIR=/usr/local/musl/include/ \
81+
DEP_OPENSSL_INCLUDE=/usr/local/musl/include/ \
82+
OPENSSL_LIB_DIR=/usr/local/musl/lib/ \
83+
OPENSSL_STATIC=1 \
84+
PQ_LIB_STATIC_X86_64_UNKNOWN_LINUX_MUSL=1 \
85+
PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config \
86+
PKG_CONFIG_ALLOW_CROSS=true \
87+
PKG_CONFIG_ALL_STATIC=true \
88+
LIBZ_SYS_STATIC=1 \
89+
TARGET=musl
90+
91+
# The content copied mentioned in the NOTE above ends here.
92+
93+
## Download the target for static linking.
94+
RUN rustup target add x86_64-unknown-linux-musl
95+
RUN cargo install cargo-build-deps
96+
97+
# prepare toolchain
98+
RUN rustup update && \
99+
rustup component add rustfmt
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Turn .dockerignore to .dockerallow by excluding everything and explicitly
19+
# allowing specific files and directories. This enables us to quickly add
20+
# dependency files to the docker content without scanning the whole directory.
21+
# This setup requires to all of our docker containers have arrow's source
22+
# as a mounted directory.
23+
24+
FROM node:14.16.0-alpine as build
25+
WORKDIR /app
26+
ENV PATH /app/node_modules/.bin:$PATH
27+
28+
COPY package.json ./
29+
COPY yarn.lock ./
30+
RUN yarn
31+
32+
COPY . ./
33+
RUN yarn build
34+
35+
FROM nginx:stable-alpine
36+
COPY --from=build /app/build /usr/share/nginx/html
37+
EXPOSE 80
38+
CMD ["nginx", "-g", "daemon off;"]

dev/docker/ballista.dockerfile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Turn .dockerignore to .dockerallow by excluding everything and explicitly
19+
# allowing specific files and directories. This enables us to quickly add
20+
# dependency files to the docker content without scanning the whole directory.
21+
# This setup requires to all of our docker containers have arrow's source
22+
# as a mounted directory.
23+
24+
ARG RELEASE_FLAG=--release
25+
FROM ballista-base:0.5.0-SNAPSHOT AS base
26+
WORKDIR /tmp/ballista
27+
RUN apt-get -y install cmake
28+
RUN cargo install cargo-chef
29+
30+
FROM base as planner
31+
RUN mkdir /tmp/ballista/ballista
32+
RUN mkdir /tmp/ballista/benchmarks
33+
RUN mkdir /tmp/ballista/datafusion
34+
RUN mkdir /tmp/ballista/datafusion-examples
35+
ADD Cargo.toml .
36+
COPY benchmarks ./benchmarks/
37+
COPY datafusion ./datafusion/
38+
COPY datafusion-cli ./datafusion-cli/
39+
COPY datafusion-examples ./datafusion-examples/
40+
COPY ballista ./ballista/
41+
RUN cargo chef prepare --recipe-path recipe.json
42+
43+
FROM base as cacher
44+
COPY --from=planner /tmp/ballista/recipe.json recipe.json
45+
RUN cargo chef cook $RELEASE_FLAG --recipe-path recipe.json
46+
47+
FROM base as builder
48+
RUN mkdir /tmp/ballista/ballista
49+
RUN mkdir /tmp/ballista/benchmarks
50+
RUN mkdir /tmp/ballista/datafusion
51+
RUN mkdir /tmp/ballista/datafusion-cli
52+
RUN mkdir /tmp/ballista/datafusion-examples
53+
ADD Cargo.toml .
54+
COPY benchmarks ./benchmarks/
55+
COPY datafusion ./datafusion/
56+
COPY ballista ./ballista/
57+
COPY datafusion-cli ./datafusion-cli/
58+
COPY datafusion-examples ./datafusion-examples/
59+
COPY --from=cacher /tmp/ballista/target target
60+
ARG RELEASE_FLAG=--release
61+
62+
# force build.rs to run to generate configure_me code.
63+
ENV FORCE_REBUILD='true'
64+
RUN cargo build $RELEASE_FLAG
65+
66+
# put the executor on /executor (need to be copied from different places depending on FLAG)
67+
ENV RELEASE_FLAG=${RELEASE_FLAG}
68+
RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/ballista-executor /executor; else mv /tmp/ballista/target/release/ballista-executor /executor; fi
69+
70+
# put the scheduler on /scheduler (need to be copied from different places depending on FLAG)
71+
ENV RELEASE_FLAG=${RELEASE_FLAG}
72+
RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/ballista-scheduler /scheduler; else mv /tmp/ballista/target/release/ballista-scheduler /scheduler; fi
73+
74+
# put the tpch on /tpch (need to be copied from different places depending on FLAG)
75+
ENV RELEASE_FLAG=${RELEASE_FLAG}
76+
RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/tpch /tpch; else mv /tmp/ballista/target/release/tpch /tpch; fi
77+
78+
# Copy the binary into a new container for a smaller docker image
79+
FROM ballista-base:0.5.0-SNAPSHOT
80+
81+
COPY --from=builder /executor /
82+
83+
COPY --from=builder /scheduler /
84+
85+
COPY --from=builder /tpch /
86+
87+
ADD benchmarks/run.sh /
88+
RUN mkdir /queries
89+
COPY benchmarks/queries/ /queries/
90+
91+
ENV RUST_LOG=info
92+
ENV RUST_BACKTRACE=full
93+
94+
CMD ["/executor"]

dev/integration-tests.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
set -e
20+
./dev/build-ballista-docker.sh
21+
pushd benchmarks
22+
./tpch-gen.sh
23+
24+
docker-compose up -d
25+
docker-compose run ballista-client /run.sh
26+
docker-compose down
27+
28+
popd

0 commit comments

Comments
 (0)