From d75f90b8574194fd659622f7e875f8dd1cb1da20 Mon Sep 17 00:00:00 2001 From: Stamatis Zampetakis Date: Thu, 1 Aug 2024 11:15:16 +0300 Subject: [PATCH] [CALCITE-5034] Remove unused remote S3 build cache At the moment the cache is not used since nobody is paying for the service. Remove all related logic since the code does not serve any purpose. If we ever decide to use another remote cache we can bring back the code. --- .github/workflows/buildcache.yml | 59 -------------------------------- .github/workflows/main.yml | 27 --------------- gradle.properties | 2 -- settings.gradle.kts | 15 -------- 4 files changed, 103 deletions(-) delete mode 100644 .github/workflows/buildcache.yml diff --git a/.github/workflows/buildcache.yml b/.github/workflows/buildcache.yml deleted file mode 100644 index 419588304f3f..000000000000 --- a/.github/workflows/buildcache.yml +++ /dev/null @@ -1,59 +0,0 @@ -# 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: Seed build cache - -on: - push: - branches: - - main - -concurrency: - # On main/release, we don't want any jobs cancelled so the sha is used to name the group - # On PR branches, we cancel the job if new commits are pushed - # More info: https://stackoverflow.com/a/68422069/253468 - group: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release' ) && format('ci-buildcache-{0}', github.sha) || format('ci-buildcache-{0}', github.ref) }} - cancel-in-progress: true - -jobs: - seed-build-cache: - strategy: - # CI resources are shared, so reduce concurrent builds - max-parallel: 3 - fail-fast: false - matrix: - os: [ubuntu, macos, windows] - jdk: [8, 11, 17, 21] - - name: '${{ matrix.os }}, ${{ matrix.jdk }} seed build cache' - runs-on: ${{ matrix.os }}-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 50 - - name: 'Set up JDK ${{ matrix.jdk }}' - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.jdk }} - distribution: 'zulu' - - uses: burrunan/gradle-cache-action@v1 - name: Build Calcite - env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - with: - job-id: jdk${{ matrix.jdk }} - remote-build-cache-proxy-enabled: false - arguments: --scan --no-parallel --no-daemon build -x test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c380a56c4e02..ab8e73039a18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,12 +63,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Test env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: jdk${{ matrix.jdk }} - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon build javadoc - name: 'sqlline and sqllsh' shell: cmd @@ -322,12 +319,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Build Avatica env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: avatica-jdk${{ matrix.jdk }} - remote-build-cache-proxy-enabled: false build-root-directory: ../calcite-avatica arguments: publishToMavenLocal properties: | @@ -339,12 +333,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Test env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: jdk${{ matrix.jdk }} - remote-build-cache-proxy-enabled: false execution-only-caches: true arguments: --scan --no-parallel --no-daemon build javadoc properties: | @@ -367,12 +358,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Test env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: jdk21 - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon build javadoc - name: 'sqlline and sqllsh' run: | @@ -402,12 +390,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Test env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: errprone - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon -Pguava.version=${{ env.GUAVA }} -PenableErrorprone classes linux-checkerframework: @@ -425,12 +410,9 @@ jobs: - name: 'Run CheckerFramework' uses: burrunan/gradle-cache-action@v1 env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: checkerframework-jdk11 - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon -PenableCheckerframework :linq4j:classes :core:classes linux-checkerframework-guava29: @@ -450,12 +432,9 @@ jobs: - name: 'Run CheckerFramework' uses: burrunan/gradle-cache-action@v1 env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: checkerframework-jdk11 - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon -Pguava.version=${{ env.GUAVA }} -PenableCheckerframework :linq4j:classes :core:classes linux-slow: @@ -476,12 +455,9 @@ jobs: - uses: burrunan/gradle-cache-action@v1 name: Test env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: job-id: jdk8 - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon testSlow linux-druid: @@ -523,11 +499,8 @@ jobs: name: 'Run Druid tests' timeout-minutes: 10 env: - S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} - S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} with: build-root-directory: ./calcite job-id: Druid8 - remote-build-cache-proxy-enabled: false arguments: --scan --no-parallel --no-daemon :druid:test -Dcalcite.test.druid=true diff --git a/gradle.properties b/gradle.properties index ca8ca2d824dd..db2295a9707f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,6 @@ org.gradle.parallel=true # Build cache can be disabled with --no-build-cache option org.gradle.caching=true #org.gradle.caching.debug=true -s3.build.cache=true # See https://github.com/gradle/gradle/pull/11358 , https://issues.apache.org/jira/browse/INFRA-14923 # repository.apache.org does not yet support .sha256 and .sha512 checksums systemProp.org.gradle.internal.publish.checksums.insecure=true @@ -45,7 +44,6 @@ calcite.avatica.version=1.25.0 com.autonomousapps.dependency-analysis.version=0.71.0 org.checkerframework.version=0.5.16 com.github.autostyle.version=3.0 -com.github.burrunan.s3-build-cache.version=1.2 com.github.johnrengelman.shadow.version=5.1.0 com.github.spotbugs.version=2.0.0 com.github.vlsi.vlsi-release-plugins.version=1.90 diff --git a/settings.gradle.kts b/settings.gradle.kts index 9033080d1d41..3a42bd808658 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,7 +26,6 @@ pluginManagement { idv("com.autonomousapps.dependency-analysis") idv("org.checkerframework") idv("com.github.autostyle") - idv("com.github.burrunan.s3-build-cache") idv("com.github.johnrengelman.shadow") idv("com.github.spotbugs") idv("com.github.vlsi.crlf", "com.github.vlsi.vlsi-release-plugins") @@ -57,7 +56,6 @@ pluginManagement { plugins { id("com.gradle.enterprise") id("com.gradle.common-custom-user-data-gradle-plugin") - id("com.github.burrunan.s3-build-cache") } // This is the name of a current project @@ -123,23 +121,10 @@ gradleEnterprise { } // Cache build artifacts, so expensive operations do not need to be re-computed -// The logic is as follows: -// 1. Cache is populated only in CI that has S3_BUILD_CACHE_ACCESS_KEY_ID and -// S3_BUILD_CACHE_SECRET_KEY (GitHub Actions in main branch) -// 2. Otherwise the cache is read-only (e.g. everyday builds and PR builds) buildCache { local { isEnabled = !isCiServer } - if (property("s3.build.cache")?.ifBlank { "true" }?.toBoolean() == true) { - val pushAllowed = property("s3.build.cache.push")?.ifBlank { "true" }?.toBoolean() ?: true - remote { - region = "us-east-2" - bucket = "calcite-gradle-cache" - endpoint = "s3.us-east-2.wasabisys.com" - isPush = isCiServer && pushAllowed && !awsAccessKeyId.isNullOrBlank() - } - } } // This enables to use local clone of vlsi-release-plugins for debugging purposes