Skip to content

Commit

Permalink
[VL] Add a docker build job and use pre-installed arrow libs (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE authored and shamirchen committed Oct 14, 2024
1 parent 5a05723 commit 89e398b
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build_bundle_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
source /opt/rh/devtoolset-9/enable && \
source /opt/gluten//dev/vcpkg/env.sh && \
cd $GITHUB_WORKSPACE/ && \
sed -i '/^headers/d' ep/build-velox/build/velox_ep/CMakeLists.txt && \
export NUM_THREADS=4
./dev/builddeps-veloxbe.sh --build_tests=OFF --build_benchmarks=OFF --enable_s3=OFF \
--enable_gcs=OFF --enable_hdfs=ON --enable_abfs=OFF
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.

name: Build and Push Docker Image

on:
pull_request:
paths:
- '.github/workflows/docker_image.yml'
schedule:
- cron: '0 20 * * 0'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: dev/vcpkg/docker/Dockerfile.gha
push: true
tags: apache/gluten:vcpkg-centos-7
3 changes: 1 addition & 2 deletions .github/workflows/velox_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ concurrency:
jobs:
build-native-lib-centos-7:
runs-on: ubuntu-20.04
container: apache/gluten:gluten-vcpkg-builder_2024_08_05 # centos7 with dependencies installed
container: apache/gluten:vcpkg-centos-7
steps:
- uses: actions/checkout@v2
- name: Generate cache key
Expand All @@ -63,7 +63,6 @@ jobs:
with:
path: |
./cpp/build/releases/
/root/.m2/repository/org/apache/arrow/
key: cache-velox-build-centos-7-${{ hashFiles('./cache-key') }}
- name: Build Gluten native libraries
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/velox_docker_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:
jobs:
cache-native-lib-centos-7:
runs-on: ubuntu-20.04
container: apache/gluten:gluten-vcpkg-builder_2024_08_05 # centos7 with dependencies installed
container: apache/gluten:vcpkg-centos-7
steps:
- uses: actions/checkout@v2
- name: Generate cache key
Expand All @@ -43,7 +43,6 @@ jobs:
lookup-only: true
path: |
./cpp/build/releases/
/root/.m2/repository/org/apache/arrow/
key: cache-velox-build-centos-7-${{ hashFiles('./cache-key') }}
- name: Build Gluten native libraries
if: steps.check-cache.outputs.cache-hit != 'true'
Expand All @@ -57,7 +56,6 @@ jobs:
with:
path: |
./cpp/build/releases/
/root/.m2/repository/org/apache/arrow/
key: cache-velox-build-centos-7-${{ hashFiles('./cache-key') }}

cache-native-lib-centos-8:
Expand Down
7 changes: 2 additions & 5 deletions dev/ci-velox-buildstatic-centos-7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

set -e

yum install sudo patch java-1.8.0-openjdk-devel -y
cd $GITHUB_WORKSPACE/ep/build-velox/src
./get_velox.sh
source /opt/rh/devtoolset-9/enable
cd $GITHUB_WORKSPACE/
source ./dev/vcpkg/env.sh
sed -i '/^headers/d' ep/build-velox/build/velox_ep/CMakeLists.txt
export NUM_THREADS=4
./dev/builddeps-veloxbe.sh --build_tests=OFF --build_benchmarks=OFF --enable_s3=ON --enable_gcs=ON --enable_hdfs=ON --enable_abfs=ON
./dev/builddeps-veloxbe.sh --build_tests=OFF --build_benchmarks=OFF --build_arrow=OFF --enable_s3=ON \
--enable_gcs=ON --enable_hdfs=ON --enable_abfs=ON
15 changes: 10 additions & 5 deletions dev/vcpkg/docker/Dockerfile.gha
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ RUN sed -i \
-e 's/mirror\.centos\.org/vault.centos.org/' \
/etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

RUN yum install -y git patch wget sudo
RUN yum install -y git patch wget sudo java-1.8.0-openjdk-devel

# build
RUN git clone --depth=1 https://github.com/apache/incubator-gluten /opt/gluten

RUN echo "check_certificate = off" >> ~/.wgetrc
# deps

RUN cd /opt/gluten && bash ./dev/vcpkg/setup-build-depends.sh

# vcpkg env
# An actual path used for vcpkg cache.
RUN mkdir -p /var/cache/vcpkg

# Set vcpkg cache path.
ENV VCPKG_BINARY_SOURCES=clear;files,/var/cache/vcpkg,readwrite
RUN source /opt/rh/devtoolset-9/enable && cd /opt/gluten && source dev/vcpkg/env.sh

# Build arrow, then install the native libs to system paths and jar package to .m2/ directory.
RUN cd /opt/gluten && source /opt/rh/devtoolset-9/enable && source ./dev/vcpkg/env.sh && \
bash ./dev/builddeps-veloxbe.sh build_arrow && rm -rf /opt/gluten
1 change: 1 addition & 0 deletions dev/vcpkg/env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
set -e

if [ -z "${BASH_SOURCE[0]}" ] || [ "$0" == "${BASH_SOURCE[0]}" ]; then
echo "env.sh should only be sourced in bash" >&2
Expand Down

0 comments on commit 89e398b

Please sign in to comment.