[KYUUBI #4348] [INFRA] Cache engine archives in CI jobs for maven download plugin

### _Why are the changes needed?_

- to avoid violation in Apache archives website's daily total download size quote, prevent repeatedly downloading engine archives by manual cache in actions

### _How was this patch tested?_
- [ ] Pass CI jobs and check cached engine archives

Closes #4348 from bowenliang123/cache-downloaded-archives.

Closes #4348

a9deeea4 [liangbowen] apply engine caching to all jobs in master
d253a497 [liangbowen] Merge commit '38eb74c26ebbdbb57aba51ad18c7e4a6bb9e1144' into cache-downloaded-archives
0cf2a759 [liangbowen] remove conditions for action
38eb74c2 [Bowen Liang] Merge branch 'master' into cache-downloaded-archives
105d507e [liangbowen] remove
c6542797 [liangbowen] extract `cache-engine-archives` action and cache engine archives

Lead-authored-by: liangbowen <liangbowen@gf.com.cn>
Co-authored-by: Bowen Liang <bowenliang@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
liangbowen 2023-02-18 22:34:02 +08:00 committed by Cheng Pan
parent 4feb83d0f3
commit 8cc8052f76
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
4 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,27 @@
#
# 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: cache-engine-archives
description: 'Cache download engine archives from Apache Archives website used by Maven download plugin'
runs:
using: composite
steps:
- name: Cache Engine Archives
uses: actions/cache@v3
with:
path: /tmp/engine-archives
key: engine-archives

View File

@ -32,7 +32,7 @@ concurrency:
cancel-in-progress: true
env:
MVN_OPT: -Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Pjdbc-shaded
MVN_OPT: -Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Pjdbc-shaded -Dmaven.plugin.download.cache.path=/tmp/engine-archives
KUBERNETES_VERSION: v1.26.1
MINIKUBE_VERSION: v1.29.0
@ -77,6 +77,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Setup Python
uses: actions/setup-python@v4
with:
@ -129,6 +131,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Kyuubi AuthZ with supported Spark versions
run: |
TEST_MODULES="extensions/spark/kyuubi-spark-authz"
@ -178,6 +182,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build Flink with maven w/o linters
run: |
TEST_MODULES="externals/kyuubi-flink-sql-engine,integration-tests/kyuubi-flink-it"
@ -222,6 +228,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Hive with maven w/o linters
run: |
TEST_MODULES="externals/kyuubi-hive-sql-engine,integration-tests/kyuubi-hive-it"
@ -257,6 +265,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test JDBC with maven w/o linters
run: |
TEST_MODULES="externals/kyuubi-jdbc-engine,integration-tests/kyuubi-jdbc-it"
@ -292,6 +302,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Trino with maven w/o linters
run: |
TEST_MODULES="kyuubi-server,externals/kyuubi-trino-engine,externals/kyuubi-spark-sql-engine,externals/kyuubi-download,integration-tests/kyuubi-trino-it"
@ -322,6 +334,8 @@ jobs:
java-version: 8
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Run TPC-DS Tests
run: |
TEST_MODULES="kyuubi-server,extensions/spark/kyuubi-spark-connector-tpcds,extensions/spark/kyuubi-spark-connector-tpch"
@ -350,6 +364,8 @@ jobs:
file: build/Dockerfile
load: true
tags: apache/kyuubi:latest
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Setup Minikube
run: |
# https://minikube.sigs.k8s.io/docs/start/
@ -399,6 +415,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Setup Minikube
run: |
# https://minikube.sigs.k8s.io/docs/start/
@ -454,6 +472,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: zookeeper integration tests
run: |
export KYUUBI_IT_ZOOKEEPER_VERSION=${{ matrix.zookeeper }}

View File

@ -36,6 +36,7 @@
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<configuration>
<cacheDirectory>${maven.plugin.download.cache.path}</cacheDirectory>
<outputDirectory>${project.build.directory}</outputDirectory>
<readTimeOut>60000</readTimeOut>
<retries>3</retries>

View File

@ -213,6 +213,7 @@
<maven.plugin.build.helper.version>3.3.0</maven.plugin.build.helper.version>
<maven.plugin.download.version>1.6.8</maven.plugin.download.version>
<maven.plugin.download.cache.path></maven.plugin.download.cache.path>
<maven.plugin.enforcer.mojo.rules.version>1.6.1</maven.plugin.enforcer.mojo.rules.version>
<maven.plugin.scala.version>4.8.0</maven.plugin.scala.version>
<maven.plugin.surefire.version>3.0.0-M8</maven.plugin.surefire.version>