Skip to content

Commit

Permalink
[GLUTEN-6957][VL] Fix missing mvn when CI cache is hit (#6966)
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE authored Aug 22, 2024
1 parent 31dc8ed commit bd26d83
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/util/install_spark_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

# Download Spark resources, required by some Spark UTs. The resource path should be set
# for spark.test.home in mvn test.

set -e

INSTALL_DIR=$GITHUB_WORKSPACE
case "$1" in
3.2)
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/util/setup_helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/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

function install_maven {
(
cd /opt/
wget -nv https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz && mv apache-maven-3.8.8 /usr/lib/maven
)
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
}

for cmd in "$@"
do
echo "Running: $cmd"
"$cmd"
done
67 changes: 18 additions & 49 deletions .github/workflows/velox_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
MVN_CMD: 'mvn -ntp'
WGET_CMD: 'wget -nv'
SETUP: 'bash .github/workflows/util/setup_helper.sh'

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
Expand Down Expand Up @@ -206,12 +207,9 @@ jobs:
else
yum update -y && yum install -y java-1.8.0-openjdk-devel wget
fi
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
$SETUP install_maven
- name: Set environment variables
run: |
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
if [ "${{ matrix.java }}" = "java-17" ]; then
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk" >> $GITHUB_ENV
elif [ "${{ matrix.java }}" = "java-11" ]; then
Expand Down Expand Up @@ -436,13 +434,9 @@ jobs:
- name: Setup java and maven
run: |
yum update -y && yum install -y java-1.8.0-openjdk-devel wget git
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
$SETUP install_maven
- name: Build for Uniffle 0.9.0
run: |
export MAVEN_HOME=/usr/lib/maven && \
export PATH=${PATH}:${MAVEN_HOME}/bin && \
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk && \
cd /opt && \
git clone -b v0.9.0 https://github.com/apache/incubator-uniffle.git && \
Expand All @@ -461,14 +455,10 @@ jobs:
bash ./bin/start-coordinator.sh && bash ./bin/start-shuffle-server.sh
- name: Build for Spark ${{ matrix.spark }}
run: |
export MAVEN_HOME=/usr/lib/maven && \
export PATH=${PATH}:${MAVEN_HOME}/bin && \
cd $GITHUB_WORKSPACE/ && \
$MVN_CMD clean install -P${{ matrix.spark }} -Pbackends-velox -Puniffle -DskipTests
- name: TPC-H SF1.0 && TPC-DS SF1.0 Parquet local spark3.2 with uniffle-0.9.0
run: |
export MAVEN_HOME=/usr/lib/maven && \
export PATH=${PATH}:${MAVEN_HOME}/bin && \
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk && \
cd $GITHUB_WORKSPACE/tools/gluten-it && \
$MVN_CMD clean install -Pspark-3.2 -Puniffle && \
Expand Down Expand Up @@ -554,10 +544,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -614,10 +601,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -661,10 +645,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -722,10 +703,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -770,10 +748,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -831,10 +806,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -879,10 +851,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -939,10 +908,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -993,10 +959,7 @@ jobs:
- name: Setup build dependency
run: |
yum install sudo patch java-1.8.0-openjdk-devel wget -y
${WGET_CMD} https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/lib/maven
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV
$SETUP install_maven
- name: Get Ccache
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -1034,6 +997,12 @@ jobs:
./cpp/build/velox/benchmarks/
/root/.m2/repository/org/apache/arrow/
key: cache-velox-build-centos-8-${{ hashFiles('./cache-key') }}
- name: Setup java and maven
run: |
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* || true
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* || true
yum install sudo patch java-1.8.0-openjdk-devel wget -y
$SETUP install_maven
- name: Build Gluten native libraries
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/velox_backend_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
if: steps.check-cache.outputs.cache-hit != 'true'
run: |
df -a
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* || true
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* || true
yum install sudo patch java-1.8.0-openjdk-devel wget -y
bash .github/workflows/util/setup_helper.sh install_maven
bash dev/ci-velox-buildshared-centos-8.sh
- name: Cache
if: steps.check-cache.outputs.cache-hit != 'true'
Expand Down
10 changes: 0 additions & 10 deletions dev/ci-velox-buildshared-centos-8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

set -e

sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* || true
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* || true

yum install sudo patch java-1.8.0-openjdk-devel wget -y
# Required by building arrow java.
wget https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xvf apache-maven-3.8.8-bin.tar.gz && mv apache-maven-3.8.8 /usr/lib/maven
export PATH="${PATH}:/usr/lib/maven/bin"
echo "PATH=${PATH}:/usr/lib/maven/bin" >> $GITHUB_ENV

source /opt/rh/gcc-toolset-9/enable
./dev/builddeps-veloxbe.sh --run_setup_script=OFF --enable_ep_cache=OFF --build_tests=ON \
--build_examples=ON --build_benchmarks=ON --build_protobuf=ON

0 comments on commit bd26d83

Please sign in to comment.