Skip to content

Commit

Permalink
[KYUUBI #4348] [INFRA] Cache engine archives in CI jobs for maven dow…
Browse files Browse the repository at this point in the history
…nload 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

a9deeea [liangbowen] apply engine caching to all jobs in master
d253a49 [liangbowen] Merge commit '38eb74c26ebbdbb57aba51ad18c7e4a6bb9e1144' into cache-downloaded-archives
0cf2a75 [liangbowen] remove conditions for action
38eb74c [Bowen Liang] Merge branch 'master' into cache-downloaded-archives
105d507 [liangbowen] remove
c654279 [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>
  • Loading branch information
2 people authored and pan3793 committed Feb 18, 2023
1 parent 4feb83d commit 8cc8052
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/actions/cache-engine-archives/action.yaml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 21 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions externals/kyuubi-download/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 8cc8052

Please sign in to comment.