Skip to content

Commit

Permalink
Refactor CI configuration for consistency and clarity
Browse files Browse the repository at this point in the history
Signed-off-by: avifenesh <[email protected]>
  • Loading branch information
avifenesh committed Nov 4, 2024
1 parent b34f739 commit 66ae222
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 114 deletions.
92 changes: 15 additions & 77 deletions .github/json_matrices/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,100 +5,48 @@
"RUNNER": "ubuntu-latest",
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-gnu",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"run": "always",
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"RUNNER": [
"self-hosted",
"Linux",
"ARM64"
],
"RUNNER": ["self-hosted", "Linux", "ARM64"],
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-gnu",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"CONTAINER": "2_28",
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-12",
"ARCH": "x64",
"TARGET": "x86_64-apple-darwin",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-latest",
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-musl",
"RUNNER": [
"self-hosted",
"Linux",
"ARM64"
],
"RUNNER": ["self-hosted", "Linux", "ARM64"],
"IMAGE": "node:lts-alpine3.19",
"CONTAINER_OPTIONS": "--user root --privileged --rm",
"PACKAGE_MANAGERS": [
"npm"
],
"languages": [
"node"
]
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
},
{
"OS": "ubuntu",
Expand All @@ -108,12 +56,8 @@
"RUNNER": "ubuntu-latest",
"IMAGE": "node:lts-alpine3.19",
"CONTAINER_OPTIONS": "--user root --privileged",
"PACKAGE_MANAGERS": [
"npm"
],
"languages": [
"node"
]
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
},
{
"OS": "amazon-linux",
Expand All @@ -123,12 +67,6 @@
"TARGET": "x86_64-unknown-linux-gnu",
"IMAGE": "amazonlinux:latest",
"PACKAGE_MANAGERS": [],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
}
]
2 changes: 1 addition & 1 deletion .github/json_matrices/supported-languages-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
{
"language": "go",
"versions": ["1.22.0", "1.18.10"],
"always-run-versions": ["1.22.0"]
"always-run-versions": ["1.22.0", "1.18.10"]
}
]
3 changes: 0 additions & 3 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ jobs:
echo "No cleaning needed"
fi
- uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -229,7 +227,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jobs:

steps:
- uses: actions/checkout@v4


- uses: gradle/actions/wrapper-validation@v3

Expand Down Expand Up @@ -207,7 +206,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4


- uses: ./.github/workflows/lint-rust
with:
Expand All @@ -226,7 +224,6 @@ jobs:
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ runs:
using: "composite"
steps:
- uses: actions/checkout@v4


- name: Install Rust toolchain and protoc
uses: ./.github/workflows/install-rust-and-protoc
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/redis-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ jobs:
engine-version: "7.2.5"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache dependencies
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: ./glide-core/redis-rs/redis

cache-on-failure: true
workspaces: ./glide-core/redis-rs/redis

- name: Build project
run: cargo build --release
Expand Down
6 changes: 3 additions & 3 deletions node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,9 @@ export async function transactionTest(
baseTransaction.xgroupDestroy(key9, groupName2);
responseData.push(["xgroupDestroy(key9, groupName2)", true]);

baseTransaction.wait(1, 200);
responseData.push(["wait(1, 200)", 0]);

baseTransaction.rename(key9, key10);
responseData.push(["rename(key9, key10)", "OK"]);
baseTransaction.exists([key10]);
Expand Down Expand Up @@ -1713,9 +1716,6 @@ export async function transactionTest(
responseData.push(["sortReadOnly(key21)", ["1", "2", "3"]]);
}

baseTransaction.wait(1, 200);
if (gte(version, "7.0.0")) responseData.push(["wait(1, 200)", 1]);
else responseData.push(["wait(1, 200)", 0]);
return responseData;
}

Expand Down
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pyo3 = { version = "^0.22", features = [
"num-bigint",
"gil-refs",
] }
bytes = { version = "1.6.0" }
bytes = { version = "^1.8" }
redis = { path = "../glide-core/redis-rs/redis", features = [
"aio",
"tokio-comp",
Expand Down
4 changes: 2 additions & 2 deletions python/python/tests/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
GlideClusterClientConfiguration,
ProtocolVersion,
)
from glide.constants import OK, TEncodable
from glide.constants import OK
from glide.exceptions import ConfigurationError
from glide.glide_client import BaseClient, GlideClient, GlideClusterClient, TGlideClient
from glide.glide_client import GlideClient, GlideClusterClient, TGlideClient
from tests.conftest import create_client
from tests.utils.utils import check_if_server_version_lt, get_random_string

Expand Down
48 changes: 29 additions & 19 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use pyo3::prelude::*;
use pyo3::types::{PyAny, PyBool, PyBytes, PyDict, PyFloat, PyList, PySet};
use pyo3::Python;
use redis::Value;
use std::sync::Arc;

pub const DEFAULT_TIMEOUT_IN_MILLISECONDS: u32 =
glide_core::client::DEFAULT_RESPONSE_TIMEOUT.as_millis() as u32;
Expand Down Expand Up @@ -113,31 +114,41 @@ fn glide(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
DEFAULT_TIMEOUT_IN_MILLISECONDS,
)?;
m.add("MAX_REQUEST_ARGS_LEN", MAX_REQUEST_ARGS_LEN)?;
m.add_function(wrap_pyfunction!(py_log, m)?)?;
m.add_function(wrap_pyfunction!(py_init, m)?)?;
m.add_function(wrap_pyfunction!(start_socket_listener_external, m)?)?;
m.add_function(wrap_pyfunction!(value_from_pointer, m)?)?;
m.add_function(wrap_pyfunction!(create_leaked_value, m)?)?;
m.add_function(wrap_pyfunction!(create_leaked_bytes_vec, m)?)?;

#[pyfn(m)]
#[pyfunction]
fn py_log(log_level: Level, log_identifier: String, message: String) {
log(log_level, log_identifier, message);
}

#[pyfn(m)]
#[pyfunction]
#[pyo3(signature = (level=None, file_name=None))]
fn py_init(level: Option<Level>, file_name: Option<&str>) -> Level {
init(level, file_name)
}

#[pyfn(m)]
#[pyfunction]
fn start_socket_listener_external(init_callback: PyObject) -> PyResult<PyObject> {
start_socket_listener(move |socket_path| {
Python::with_gil(|py| {
match socket_path {
Ok(path) => {
let _ = init_callback.call_bound(py, (path, py.None()), None);
}
Err(error_message) => {
let _ = init_callback.call_bound(py, (py.None(), error_message), None);
}
};
});
let init_callback = Arc::new(init_callback);
start_socket_listener({
let init_callback = Arc::clone(&init_callback);
move |socket_path| {
let init_callback = Arc::clone(&init_callback);
Python::with_gil(|py| {
match socket_path {
Ok(path) => {
let _ = init_callback.call_bound(py, (path, py.None()), None);
}
Err(error_message) => {
let _ = init_callback.call_bound(py, (py.None(), error_message), None);
}
};
});
}
});
Ok(Python::with_gil(|py| "OK".into_py(py)))
}
Expand Down Expand Up @@ -213,21 +224,21 @@ fn glide(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
}
}

#[pyfn(m)]
#[pyfunction]
pub fn value_from_pointer(py: Python, pointer: u64) -> PyResult<PyObject> {
let value = unsafe { Box::from_raw(pointer as *mut Value) };
resp_value_to_py(py, *value)
}

#[pyfn(m)]
#[pyfunction]
/// This function is for tests that require a value allocated on the heap.
/// Should NOT be used in production.
pub fn create_leaked_value(message: String) -> usize {
let value = Value::SimpleString(message);
Box::leak(Box::new(value)) as *mut Value as usize
}

#[pyfn(m)]
#[pyfunction]
pub fn create_leaked_bytes_vec(args_vec: Vec<&PyBytes>) -> usize {
// Convert the bytes vec -> Bytes vector
let bytes_vec: Vec<Bytes> = args_vec
Expand All @@ -241,7 +252,6 @@ fn glide(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
}
Ok(())
}

impl From<logger_core::Level> for Level {
fn from(level: logger_core::Level) -> Self {
match level {
Expand Down

0 comments on commit 66ae222

Please sign in to comment.