diff --git a/.github/workflows/build-matrix.json b/.github/json_matrices/build-matrix.json similarity index 100% rename from .github/workflows/build-matrix.json rename to .github/json_matrices/build-matrix.json diff --git a/.github/json_matrices/engine-matrix.json b/.github/json_matrices/engine-matrix.json new file mode 100644 index 0000000000..2973b43285 --- /dev/null +++ b/.github/json_matrices/engine-matrix.json @@ -0,0 +1,14 @@ +[ + { + "type": "valkey", + "version": "7.2.5" + }, + { + "type": "valkey", + "version": "redis-7.0.15" + }, + { + "type": "valkey", + "version": "redis-6.2.14" + } +] diff --git a/.github/workflows/build-node-wrapper/action.yml b/.github/workflows/build-node-wrapper/action.yml index e471ca5e1a..7462f47f65 100644 --- a/.github/workflows/build-node-wrapper/action.yml +++ b/.github/workflows/build-node-wrapper/action.yml @@ -29,6 +29,10 @@ inputs: description: "Specified target for rust toolchain, ex. x86_64-apple-darwin" type: string required: true + engine-version: + description: "Engine version to install" + required: true + type: string publish: description: "Enable building the wrapper in release mode" required: false @@ -56,6 +60,7 @@ runs: os: ${{ inputs.os }} target: ${{ inputs.target }} github-token: ${{ inputs.github-token }} + engine-version: ${{ inputs.engine-version }} - name: Create package.json file uses: ./.github/workflows/node-create-package-file diff --git a/.github/workflows/build-python-wrapper/action.yml b/.github/workflows/build-python-wrapper/action.yml index f1a60d605c..72863c6a43 100644 --- a/.github/workflows/build-python-wrapper/action.yml +++ b/.github/workflows/build-python-wrapper/action.yml @@ -13,6 +13,10 @@ inputs: description: "Specified target for rust toolchain, ex. x86_64-apple-darwin" type: string required: true + engine-version: + description: "Engine version to install" + required: true + type: string publish: description: "Enable building the wrapper in release mode" required: false @@ -34,6 +38,7 @@ runs: os: ${{ inputs.os }} target: ${{ inputs.target }} github-token: ${{ inputs.github-token }} + engine-version: ${{ inputs.engine-version }} - name: Install Python software dependencies shell: bash diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 38dd17bd2e..bb0ef39034 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -9,9 +9,9 @@ on: - submodules/** - .github/workflows/csharp.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: - csharp/** @@ -19,9 +19,9 @@ on: - submodules/** - .github/workflows/csharp.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml permissions: contents: read @@ -31,14 +31,26 @@ concurrency: cancel-in-progress: true jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + run-tests: + needs: load-engine-matrix timeout-minutes: 25 strategy: fail-fast: false matrix: - redis: - - 6.2.14 - - 7.2.3 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} dotnet: - '6.0' - '8.0' @@ -61,13 +73,6 @@ jobs: with: submodules: recursive - - name: Install redis - # TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781 - if: ${{ matrix.host.OS == 'ubuntu' }} - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} - - name: Set up dotnet ${{ matrix.dotnet }} uses: actions/setup-dotnet@v4 with: @@ -79,6 +84,7 @@ jobs: os: ${{ matrix.host.OS }} target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} - name: Format working-directory: ./csharp diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 771127062b..ebe02a12cc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -8,20 +8,41 @@ on: - submodules/** - go/** - .github/workflows/go.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: - glide-core/src/** - submodules/** - go/** - .github/workflows/go.yml - + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml concurrency: group: go-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + build-and-test-go-client: + needs: load-engine-matrix timeout-minutes: 35 strategy: # Run all jobs @@ -30,9 +51,7 @@ jobs: go: - '1.18.10' - '1.22.0' - redis: - - 6.2.14 - - 7.2.3 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} host: - { OS: ubuntu, @@ -64,13 +83,7 @@ jobs: os: ${{ matrix.host.OS }} target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install redis - # TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781 - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} + engine-version: ${{ matrix.engine.version }} - name: Install tools for Go ${{ matrix.go }} working-directory: ./go @@ -127,11 +140,7 @@ jobs: os: "amazon-linux" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Create a symbolic Link for redis6 binaries - run: | - ln -s /usr/bin/redis6-server /usr/bin/redis-server - ln -s /usr/bin/redis6-cli /usr/bin/redis-cli + engine-version: "7.2.5" - name: Install Go run: | diff --git a/.github/workflows/install-shared-dependencies/action.yml b/.github/workflows/install-shared-dependencies/action.yml index 98ca63cc32..af44e7206f 100644 --- a/.github/workflows/install-shared-dependencies/action.yml +++ b/.github/workflows/install-shared-dependencies/action.yml @@ -21,6 +21,11 @@ inputs: - aarch64-apple-darwin - aarch64-unknown-linux-musl - x86_64-unknown-linux-musl + engine-version: + description: "Engine version to install" + required: true + type: string + github-token: description: "GITHUB_TOKEN, GitHub App installation access token" required: true @@ -36,7 +41,7 @@ runs: run: | brew update brew upgrade || true - brew install git gcc pkgconfig openssl redis coreutils + brew install git gcc pkgconfig openssl coreutils - name: Install software dependencies for Ubuntu GNU shell: bash @@ -52,13 +57,13 @@ runs: apk update wget -O - https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" - apk add protobuf-dev musl-dev make gcc redis envsubst + apk add protobuf-dev musl-dev make gcc envsubst openssl libressl-dev - name: Install software dependencies for Amazon-Linux shell: bash if: "${{ inputs.os == 'amazon-linux' }}" run: | - yum install -y gcc pkgconfig openssl openssl-devel which curl redis6 gettext --allowerasing + yum install -y gcc pkgconfig openssl openssl-devel which curl gettext --allowerasing - name: Install Rust toolchain and protoc if: "${{ !contains(inputs.target, 'musl') }}" @@ -66,3 +71,9 @@ runs: with: target: ${{ inputs.target }} github-token: ${{ inputs.github-token }} + + - name: Install Valkey + uses: ./.github/workflows/install-valkey + with: + engine-version: ${{ inputs.engine-version }} + target: ${{ inputs.target }} diff --git a/.github/workflows/install-valkey/action.yml b/.github/workflows/install-valkey/action.yml new file mode 100644 index 0000000000..f15a875c03 --- /dev/null +++ b/.github/workflows/install-valkey/action.yml @@ -0,0 +1,78 @@ +name: Install Valkey + +inputs: + engine-version: + description: "Engine version to install" + required: true + type: string + target: + description: "Specified target toolchain, ex. x86_64-unknown-linux-gnu" + type: string + required: true + options: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-apple-darwin + - aarch64-apple-darwin + - aarch64-unknown-linux-musl + - x86_64-unknown-linux-musl + +env: + CARGO_TERM_COLOR: always + VALKEY_MIN_VERSION: "7.2.5" + +runs: + using: "composite" + + steps: + - name: Cache Valkey + # TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved + if: ${{ inputs.target != 'aarch64-unknown-linux-musl' }} + uses: actions/cache@v4 + id: cache-valkey + with: + path: | + ~/valkey + key: valkey-${{ inputs.engine-version }}-${{ inputs.target }} + + - name: Build Valkey + if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' }} + shell: bash + run: | + echo "Building valkey ${{ inputs.engine-version }}" + cd ~ + rm -rf valkey + git clone https://github.com/valkey-io/valkey.git + cd valkey + git checkout ${{ inputs.engine-version }} + make BUILD_TLS=yes + + - name: Install Valkey + shell: bash + run: | + cd ~/valkey + if command -v sudo &> /dev/null + then + echo "sudo command exists" + sudo make install + else + echo "sudo command does not exist" + make install + fi + echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile + + - name: Verify Valkey installation and symlinks + shell: bash + run: | + # In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli + # to redis-server and redis-cli. This step ensures that the engine is properly installed + # with the expected version and that Valkey symlinks are correctly created. + EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"` + INSTALLED_VER=$(redis-server -v) + if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then + echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER" + exit 1 + else + echo "Successfully installed the server: $INSTALLED_VER" + fi + diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 6c5574dbba..4964a7dbed 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -9,9 +9,9 @@ on: - java/** - .github/workflows/java.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: - glide-core/src/** @@ -19,16 +19,30 @@ on: - java/** - .github/workflows/java.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml concurrency: group: java-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + build-and-test-java-client: + needs: load-engine-matrix timeout-minutes: 35 strategy: # Run all jobs @@ -37,9 +51,7 @@ jobs: java: - 11 - 17 - redis: - - 6.2.14 - - 7.2.3 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} host: - { OS: ubuntu, @@ -71,6 +83,7 @@ jobs: os: ${{ matrix.host.OS }} target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} - name: Install protoc (protobuf) uses: arduino/setup-protoc@v3 @@ -78,13 +91,6 @@ jobs: version: "26.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install redis - # TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781 - if: ${{ matrix.host.OS == 'ubuntu' }} - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} - - name: Build java client working-directory: java run: ./gradlew --continue build @@ -144,6 +150,7 @@ jobs: os: "amazon-linux" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Install protoc (protobuf) uses: arduino/setup-protoc@v3 @@ -151,11 +158,6 @@ jobs: version: "26.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Create a symbolic Link for redis6 binaries - run: | - ln -s /usr/bin/redis6-server /usr/bin/redis-server - ln -s /usr/bin/redis6-cli /usr/bin/redis-cli - - name: Install Java run: | yum install -y java-${{ matrix.java }} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 62bab729ea..dc822cbd01 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -11,6 +11,9 @@ on: - .github/workflows/node.yml - .github/workflows/build-node-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: - glide-core/src/** @@ -20,6 +23,9 @@ on: - .github/workflows/node.yml - .github/workflows/build-node-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml concurrency: group: node-${{ github.head_ref || github.ref }} @@ -29,26 +35,33 @@ env: CARGO_TERM_COLOR: always jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + test-ubuntu-latest: runs-on: ubuntu-latest + needs: load-engine-matrix timeout-minutes: 15 strategy: fail-fast: false matrix: - redis: - - 6.2.14 - - 7.2.3 - + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} + steps: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install redis - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} - - name: Use Node.js 16.x uses: actions/setup-node@v3 with: @@ -60,6 +73,7 @@ jobs: os: "ubuntu" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} - name: test run: npm test @@ -124,6 +138,7 @@ jobs: arch: "arm64" target: "aarch64-apple-darwin" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Test compatibility run: npm test -- -t "set and get flow works" @@ -159,12 +174,7 @@ jobs: os: "amazon-linux" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Create a symbolic Link for redis6 binaries - working-directory: ./node - run: | - ln -s /usr/bin/redis6-server /usr/bin/redis-server - ln -s /usr/bin/redis6-cli /usr/bin/redis-cli + engine-version: "7.2.5" - name: Test compatibility run: npm test -- -t "set and get flow works" @@ -202,6 +212,7 @@ jobs: arch: x64 target: x86_64-unknown-linux-musl github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Test compatibility shell: bash diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index ae576628bc..c8d637687d 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -9,6 +9,8 @@ on: - .github/workflows/build-node-wrapper/action.yml - .github/workflows/start-self-hosted-runner/action.yml - .github/workflows/install-rust-and-protoc/action.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-valkey/action.yml push: tags: - "v*.*" @@ -51,7 +53,7 @@ jobs: shell: bash run: | # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["npm"])))' < .github/workflows/build-matrix.json | jq -c .)" + export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["npm"])))' < .github/json_matrices/build-matrix.json | jq -c .)" echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT publish-binaries: @@ -135,6 +137,7 @@ jobs: npm_scope: ${{ vars.NPM_SCOPE }} publish: "true" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Check if RC and set a distribution tag for the package shell: bash @@ -228,6 +231,7 @@ jobs: os: ubuntu target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Check if RC and set a distribution tag for the package shell: bash diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index 0889a7bcae..1241facaef 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -8,6 +8,8 @@ on: - .github/workflows/pypi-cd.yml - .github/workflows/build-python-wrapper/action.yml - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-valkey/action.yml push: tags: - "v*.*" @@ -33,7 +35,7 @@ jobs: shell: bash run: | # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["pypi"])))' < .github/workflows/build-matrix.json | jq -c .)" + export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["pypi"])))' < .github/json_matrices/build-matrix.json | jq -c .)" echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT @@ -136,6 +138,7 @@ jobs: target: ${{ matrix.build.TARGET }} publish: "true" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Include protobuf files in the package working-directory: ./python diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 915937a5f9..9f046a0a8e 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,7 +11,9 @@ on: - .github/workflows/python.yml - .github/workflows/build-python-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis-modules/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: @@ -22,7 +24,9 @@ on: - .github/workflows/python.yml - .github/workflows/build-python-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-redis-modules/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml + - .github/workflows/install-valkey/action.yml concurrency: group: python-${{ github.head_ref || github.ref }} @@ -32,26 +36,33 @@ permissions: contents: read jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + test-ubuntu-latest: runs-on: ubuntu-latest + needs: load-engine-matrix timeout-minutes: 25 strategy: fail-fast: false matrix: - redis: - - 6.2.14 - - 7.2.3 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 with: submodules: recursive - - - name: Install redis - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} - + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: @@ -87,6 +98,7 @@ jobs: os: "ubuntu" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} - name: Type check with mypy working-directory: ./python @@ -139,6 +151,7 @@ jobs: os: "macos" target: "aarch64-apple-darwin" github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: "7.2.5" - name: Test compatibility with pytest working-directory: ./python @@ -176,12 +189,7 @@ jobs: os: "amazon-linux" target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Create a symbolic Link for redis6 binaries - working-directory: ./python - run: | - ln -s /usr/bin/redis6-server /usr/bin/redis-server - ln -s /usr/bin/redis6-cli /usr/bin/redis-cli + engine-version: "7.2.5" - name: Test compatibility with pytest working-directory: ./python diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a8829f764..8cc09965e3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,6 +9,8 @@ on: - submodules/** - utils/cluster_manager.py - .github/workflows/rust.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-valkey/action.yml pull_request: paths: - logger_core/** @@ -16,6 +18,8 @@ on: - submodules/** - utils/cluster_manager.py - .github/workflows/rust.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-valkey/action.yml concurrency: group: rust-${{ github.head_ref || github.ref }} @@ -25,31 +29,39 @@ env: CARGO_TERM_COLOR: always jobs: + load-engine-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Load the engine matrix + id: load-engine-matrix + shell: bash + run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + build: runs-on: ubuntu-latest + needs: load-engine-matrix timeout-minutes: 15 strategy: fail-fast: false matrix: - redis: - - 6.2.14 - - 7.2.3 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install redis - uses: ./.github/workflows/install-redis - with: - redis-version: ${{ matrix.redis }} - - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies with: os: "ubuntu" target: "x86_64-unknown-linux-gnu" + engine-version: ${{ matrix.engine.version }} - uses: Swatinem/rust-cache@v2 diff --git a/README.md b/README.md index caf6f9eeb4..076aa59f5a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,14 @@ General Language Independent Driver for the Enterprise (GLIDE) for Redis, is an AWS-sponsored, open-source Redis client. GLIDE for Redis works with any Redis distribution that adheres to the Redis Serialization Protocol (RESP) specification, including open-source Redis, Amazon ElastiCache for Redis, and Amazon MemoryDB for Redis. Strategic, mission-critical Redis-based applications have requirements for security, optimized performance, minimal downtime, and observability. GLIDE for Redis is designed to provide a client experience that helps meet these objectives. It is sponsored and supported by AWS, and comes pre-configured with best practices learned from over a decade of operating Redis-compatible services used by hundreds of thousands of customers. To help ensure consistency in development and operations, GLIDE for Redis is implemented using a core driver framework, written in Rust, with extensions made available for each supported programming language. This design ensures that updates easily propagate to each language and reduces overall complexity. In this Preview release, GLIDE for Redis is available for Python and Javascript (Node.js), with support for Java actively under development. -## Supported Redis Versions -GLIDE for Redis is API-compatible with open source Redis version 6 and 7. +## Supported Engine Versions +GLIDE for Redis is API-compatible with the following engine versions: + +| Engine Type | Version | +|--------------------|---------| +| Valkey and Redis | 7.2 | +| Valkey and Redis | 7.0 | +| Valkey and Redis | 6.2 | ## Current Status We've made GLIDE for Redis an open-source project, and are releasing it in Preview to the community to gather feedback, and actively collaborate on the project roadmap. We welcome questions and contributions from all Redis stakeholders. diff --git a/csharp/tests/Integration/IntegrationTestBase.cs b/csharp/tests/Integration/IntegrationTestBase.cs index 8e909af17e..c91bf04101 100644 --- a/csharp/tests/Integration/IntegrationTestBase.cs +++ b/csharp/tests/Integration/IntegrationTestBase.cs @@ -133,7 +133,10 @@ private static Version GetRedisVersion() proc?.WaitForExit(); string output = proc?.StandardOutput.ReadToEnd() ?? ""; + // Redis response: // Redis server v=7.2.3 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=7504b1fedf883f2 - return new Version(output.Split(" ")[2].Split("=")[1]); + // Valkey response: + // Server v=7.2.5 sha=26388270:0 malloc=jemalloc-5.3.0 bits=64 build=ea40bb1576e402d6 + return new Version(output.Split("v=")[1].Split(" ")[0]); } } diff --git a/java/integTest/build.gradle b/java/integTest/build.gradle index f17d5d8ac8..ad1a51ada9 100644 --- a/java/integTest/build.gradle +++ b/java/integTest/build.gradle @@ -48,9 +48,11 @@ ext { return res } extractRedisVersion = { String output -> - // Line in format like + // Redis response: // Redis server v=7.2.3 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=7504b1fedf883f2 - return output.split(" ")[2].split("=")[1] + // Valkey response: + // Server v=7.2.5 sha=26388270:0 malloc=jemalloc-5.3.0 bits=64 build=ea40bb1576e402d6 + return output.split("v=")[1].split(" ")[0] } } diff --git a/java/integTest/src/test/java/glide/SharedCommandTests.java b/java/integTest/src/test/java/glide/SharedCommandTests.java index 74dbac710b..6112bb08a5 100644 --- a/java/integTest/src/test/java/glide/SharedCommandTests.java +++ b/java/integTest/src/test/java/glide/SharedCommandTests.java @@ -5176,10 +5176,10 @@ public void objectEncoding_binary_returns_string_embstr(BaseClient client) { public void objectEncoding_returns_list_listpack(BaseClient client) { String listListpackKey = UUID.randomUUID().toString(); assertEquals(1, client.lpush(listListpackKey, new String[] {"1"}).get()); - // API documentation states that a ziplist should be returned for Redis versions <= 6.2, but + // API documentation states that a ziplist should be returned for Redis versions < 7.2, but // actual behavior returns a quicklist. assertEquals( - REDIS_VERSION.isLowerThan("7.0.0") ? "quicklist" : "listpack", + REDIS_VERSION.isLowerThan("7.2.0") ? "quicklist" : "listpack", client.objectEncoding(listListpackKey).get()); } @@ -5192,7 +5192,7 @@ public void objectEncoding_binary_returns_list_listpack(BaseClient client) { // API documentation states that a ziplist should be returned for Redis versions <= 6.2, but // actual behavior returns a quicklist. assertEquals( - REDIS_VERSION.isLowerThan("7.0.0") ? "quicklist" : "listpack", + REDIS_VERSION.isLowerThan("7.2.0") ? "quicklist" : "listpack", client.objectEncoding(listListpackKey).get()); } diff --git a/node/tests/SharedTests.ts b/node/tests/SharedTests.ts index dbcdc7840a..a150a40515 100644 --- a/node/tests/SharedTests.ts +++ b/node/tests/SharedTests.ts @@ -3158,7 +3158,7 @@ export function runBaseTests(config: { expect(await client.lpush(list_key, ["1"])).toEqual(1); - if (versionLessThan7) { + if (versionLessThan72) { checkSimple(await client.objectEncoding(list_key)).toEqual( "quicklist", ); diff --git a/python/python/tests/test_async_client.py b/python/python/tests/test_async_client.py index 123f941510..6b49e6e43b 100644 --- a/python/python/tests/test_async_client.py +++ b/python/python/tests/test_async_client.py @@ -6547,7 +6547,7 @@ async def test_object_encoding(self, redis_client: TGlideClient): assert await redis_client.object_encoding(string_key) == "embstr" assert await redis_client.lpush(list_key, ["1"]) == 1 - if await check_if_server_version_lt(redis_client, "7.0.0"): + if await check_if_server_version_lt(redis_client, "7.2.0"): assert await redis_client.object_encoding(list_key) == "quicklist" else: assert await redis_client.object_encoding(list_key) == "listpack"