Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Support for Valkey 6.2, 7.0 and 7.2 #1711

Merged
merged 26 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0546b9b
CI: Adding support in Valkey
barshaul Jun 13, 2024
6501b18
Add Valkey support for all wrappers
barshaul Jun 13, 2024
8614ff5
Fix MacOS, move matricecs into a seperate folder
barshaul Jun 13, 2024
b93d7d5
Fixed C# GetRedisVersion
barshaul Jun 13, 2024
ddb357b
Fixed Java extractRedisVersion
barshaul Jun 13, 2024
b46e700
Skip redis installation via package manager option
barshaul Jun 13, 2024
00913fb
Moved all engine versions to be built from valkey, added valkey/redis…
barshaul Jun 27, 2024
99ae1d5
Support non valkey releases
barshaul Jun 27, 2024
4d3bf38
New comparison scfript
barshaul Jun 27, 2024
2182abc
remove prev check
barshaul Jun 27, 2024
ec38065
some fixes
barshaul Jun 27, 2024
9b64f7d
Some fixes
barshaul Jun 27, 2024
ecf8fb5
Removed 6.0
barshaul Jun 27, 2024
76789ff
Move Install Valkey into the shared dependencies
barshaul Jun 27, 2024
7a438a1
Removed redis installation
barshaul Jun 27, 2024
1b076c4
Added missings
barshaul Jun 27, 2024
b5d8211
Some fixes
barshaul Jun 29, 2024
7d47ee4
Added libressl-dev to musl installation
barshaul Jun 29, 2024
7c8bb8d
Removing redis-7.2.4 version
barshaul Jun 29, 2024
1395739
Change documentation
barshaul Jun 29, 2024
c0e517a
Fixed Java
barshaul Jun 29, 2024
b370a58
Fixed Java quicklist test
barshaul Jun 29, 2024
573d357
Added install-valkey path to all actions, try to fix alpine on npm CD
barshaul Jun 29, 2024
3cb0ce6
Added documentation, addressing PR comments
barshaul Jun 29, 2024
dc87537
clean valkey repo before cloning it
barshaul Jun 29, 2024
a29be70
Removed all symlink specific checks
barshaul Jun 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/json_matrices/engine-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"type": "valkey",
"version": "7.2.5"
},
{
"type": "valkey",
"version": "redis-7.0.15"
},
{
"type": "valkey",
"version": "redis-6.2.14"
}
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not worth adding 6.0? is there something special about 6.2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 6.0 breaks a lot of our tests due to API incompatibilities. We will do it in a different PR - pre or post GA wasn't decided yet.

5 changes: 5 additions & 0 deletions .github/workflows/build-node-wrapper/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-python-wrapper/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ 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/**
- glide-core/src/**
- 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
Expand All @@ -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'
Expand All @@ -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:
Expand All @@ -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
Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -52,17 +57,23 @@ 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') }}"
uses: ./.github/workflows/install-rust-and-protoc
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 }}
78 changes: 78 additions & 0 deletions .github/workflows/install-valkey/action.yml
Original file line number Diff line number Diff line change
@@ -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

Loading
Loading