Skip to content

[SETUP] Use #!/usr/bin/env bash instead of #!/bin/bash in scripts… #2447

[SETUP] Use #!/usr/bin/env bash instead of #!/bin/bash in scripts…

[SETUP] Use #!/usr/bin/env bash instead of #!/bin/bash in scripts… #2447

# 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: Velox backend Dependency Cache
on:
push:
branches:
- 'main'
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
CCACHE_DIR: "${{ github.workspace }}/.ccache"
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: false
jobs:
cache-native-lib-centos-7:
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get Ccache
uses: actions/cache/restore@v3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos7-release-default-${{github.sha}}
restore-keys: |
ccache-centos7-release-default
- name: Build Gluten native libraries
run: |
docker run -v $GITHUB_WORKSPACE:/work -w /work apache/gluten:vcpkg-centos-7 bash -c "
export CCACHE_DIR=/work/.ccache
export CCACHE_MAXSIZE=1G
mkdir -p /work/.ccache
bash dev/ci-velox-buildstatic-centos-7.sh
"
- name: Save Ccache
uses: actions/cache/save@v3
id: ccache
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos7-release-default-${{github.sha}}
cache-native-lib-centos-8:
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ${{ matrix.os }}
container: apache/gluten:vcpkg-centos-9
strategy:
matrix:
os: [ ubuntu-22.04, ubuntu-24.04-arm ]
steps:
- uses: actions/checkout@v4
- name: Get Ccache
uses: actions/cache/restore@v3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-default-${{runner.arch}}-${{github.sha}}
restore-keys: |
ccache-centos8-release-default-${{runner.arch}}
- name: Build Gluten native libraries
run: |
export CCACHE_MAXSIZE=1G
bash dev/ci-velox-buildstatic-centos-9.sh
- name: Save Ccache
uses: actions/cache/save@v3
id: ccache
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-default-${{runner.arch}}-${{github.sha}}
cache-shared-lib-centos-8:
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, ubuntu-24.04-arm ]
container: apache/gluten:centos-8-jdk8
steps:
- uses: actions/checkout@v4
- name: Get Ccache
uses: actions/cache/restore@v3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-shared-${{runner.arch}}-${{github.sha}}
restore-keys: |
ccache-centos8-release-shared-${{runner.arch}}
- name: Build Gluten shared libraries
run: |
df -a
export CCACHE_MAXSIZE=1G
bash dev/ci-velox-buildshared-centos-8.sh
ccache -s
- name: Save Ccache
uses: actions/cache/save@v3
id: ccache
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-shared-${{runner.arch}}-${{github.sha}}
cache-enhanced-native-lib-centos-7:
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get Ccache
uses: actions/cache/restore@v3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-enhanced-centos7-release-default-${{github.sha}}
restore-keys: |
ccache-enhanced-centos7-release-default
- name: Build Gluten native libraries
run: |
docker run -v $GITHUB_WORKSPACE:/work -w /work apache/gluten:vcpkg-centos-7 bash -c "
export CCACHE_DIR=/work/.ccache
export CCACHE_MAXSIZE=1G
mkdir -p /work/.ccache
bash dev/ci-velox-buildstatic-centos-7-enhanced-features.sh
"
- name: Save Ccache
uses: actions/cache/save@v3
id: ccache
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-enhanced-centos7-release-default-${{github.sha}}
cache-shared-lib-centos-9:
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
steps:
- name: "node-cleanup" # by default the free runner does not have enough disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- uses: actions/checkout@v4
- name: Get Ccache
uses: actions/cache/restore@v3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos9-release-shared-${{runner.arch}}-${{github.sha}}
restore-keys: |
ccache-centos9-release-shared-${{runner.arch}}
- name: Build Gluten shared libraries
run: |
docker run -v $GITHUB_WORKSPACE:/work -w /work apache/gluten:centos-9-jdk8-cudf bash -c "
rm -rf /opt/rh/gcc-toolset-12 && ln -s /opt/rh/gcc-toolset-14 /opt/rh/gcc-toolset-12 # hack to use gcc 14, should upgrade in Velox build script later
df -a
dnf autoremove -y && dnf clean all
dnf remove -y cuda-toolkit-12* && dnf install -y cuda-toolkit-13-1
ls -l /usr/local/
source /opt/rh/gcc-toolset-12/enable
export CMAKE_BUILD_PARALLEL_LEVEL=4
export NUM_THREADS=4
export CCACHE_MAXSIZE=1G
export CCACHE_DIR=/work/.ccache
mkdir -p /work/.ccache
cd /work
bash dev/builddeps-veloxbe.sh --run_setup_script=OFF --build_arrow=OFF --build_tests=ON --build_benchmarks=ON --enable_gpu=ON # TODO: re-enable tests with more disk space
rm -rf ep/build-velox/build/velox_ep
./build/mvn clean package -Pbackends-velox -Pspark-3.4 -DskipTests
ccache -s
"
- name: Save Ccache
if: always()
uses: actions/cache/save@v3
id: ccache
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos9-release-shared-${{runner.arch}}-${{github.sha}}