From 757838baf25af2e8b01f4abf8d060848629fada6 Mon Sep 17 00:00:00 2001 From: Guian Gumpac Date: Wed, 11 Sep 2024 14:19:04 -0700 Subject: [PATCH] Test running server Signed-off-by: Guian Gumpac --- .github/workflows/java-cd.yml | 75 +++++++++++++++++++++++------------ java/benchmarks/build.gradle | 14 ++----- 2 files changed, 53 insertions(+), 36 deletions(-) diff --git a/.github/workflows/java-cd.yml b/.github/workflows/java-cd.yml index 58e69ed851..77a79e71fd 100644 --- a/.github/workflows/java-cd.yml +++ b/.github/workflows/java-cd.yml @@ -38,10 +38,31 @@ jobs: export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["maven"])))' < .github/json_matrices/build-matrix.json | jq -c .)" echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT + set-release-version: + runs-on: ubuntu-latest + outputs: + RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }} + steps: + - name: Set the release version + id: release-version + shell: bash + run: | + if ${{ github.event_name == 'workflow_dispatch' }}; then + R_VERSION="${{ env.INPUT_VERSION }}" + else + R_VERSION=${GITHUB_REF:11} + fi + echo "RELEASE_VERSION=${R_VERSION}" >> $GITHUB_ENV + echo "Release version detected: $R_VERSION" + echo "RELEASE_VERSION=$R_VERSION" >> $GITHUB_OUTPUT + env: + INPUT_VERSION: ${{ github.event.inputs.version }} + deployment-all-platforms: - needs: load-platform-matrix + needs: [set-release-version, load-platform-matrix] env: JAVA_VERSION: "11" + RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} strategy: # Run all jobs fail-fast: false @@ -58,7 +79,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: ${{ env.JAVA_VERSION }} - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies @@ -73,31 +94,33 @@ jobs: version: "26.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Test deployment - working-directory: java - run: | - ./gradlew :benchmarks:run --args="--minimal --clients glide" + - name: Start Valkey server + run: | + if ${{ matrix.host.OS }} == 'ubuntu'; then + apt-get install valkey + systemctl start valkey + else + brew install valkey + brew services start valkey + fi + + - name: Test deployment + working-directory: java + run: | +# export ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderName="Authorization" +# export ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderValue="Bearer $(echo "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" | base64)" +# export GLIDE_RELEASE_VERSION=${{ env.RELEASE_VERSION }} + ./gradlew :benchmarks:run --args="--minimal --clients glide" + + - name: Stop Valkey server + if: ${{ always() }} + run: | + if ${{ matrix.host.OS }} == 'ubuntu'; then + systemctl stop valkey + else + brew systemctl stop valkey + fi -# -# set-release-version: -# runs-on: ubuntu-latest -# outputs: -# RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }} -# steps: -# - name: Set the release version -# id: release-version -# shell: bash -# run: | -# if ${{ github.event_name == 'workflow_dispatch' }}; then -# R_VERSION="${{ env.INPUT_VERSION }}" -# else -# R_VERSION=${GITHUB_REF:11} -# fi -# echo "RELEASE_VERSION=${R_VERSION}" >> $GITHUB_ENV -# echo "Release version detected: $R_VERSION" -# echo "RELEASE_VERSION=$R_VERSION" >> $GITHUB_OUTPUT -# env: -# INPUT_VERSION: ${{ github.event.inputs.version }} # # create-binaries-to-publish: # needs: [set-release-version, load-platform-matrix] diff --git a/java/benchmarks/build.gradle b/java/benchmarks/build.gradle index 467967ef75..a454723cdb 100644 --- a/java/benchmarks/build.gradle +++ b/java/benchmarks/build.gradle @@ -13,7 +13,7 @@ dependencies { def releaseVersion = System.getenv("GLIDE_RELEASE_VERSION"); // if (releaseVersion) { - implementation "io.valkey:valkey-glide:1.0.0:${osdetector.classifier}" + implementation "io.valkey:valkey-glide:1.0.1:${osdetector.classifier}" // } else { // implementation project(':client') // } @@ -26,12 +26,6 @@ dependencies { implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0' implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.5' implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' - - implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-x86_64' - implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-aarch_64' - implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-x86_64' - implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-aarch_64' - } run.dependsOn ':client:buildRustRelease' @@ -41,7 +35,7 @@ application { mainClass = 'glide.benchmarks.BenchmarkingApp' // Runs for GITHUB_ACTIONS for testing release Maven deployment. Force benchmarks to use glide-rs from Maven Central // deployments. -// if (!System.getenv("ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderName")) { -// applicationDefaultJvmArgs = ['-Djava.library.path=../target/release'] -// } + if (!System.getenv("ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderName")) { + applicationDefaultJvmArgs = ['-Djava.library.path=../target/release'] + } }