Skip to content

Commit

Permalink
Renamed files and folder from redis to valkey (#1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronycsdu authored Nov 22, 2024
1 parent cb3e158 commit 8dffbdf
Show file tree
Hide file tree
Showing 72 changed files with 223 additions and 221 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ windsock-cassandra = "test --release --bench windsock --no-default-features --fe

# Compile benches in docker to ensure compiled libc version is compatible with the EC2 instances libc
windsock-cloud-docker = "run --package windsock-cloud-docker -- redis,cassandra,kafka"
windsock-cloud-docker-redis = "run --package windsock-cloud-docker -- redis"
windsock-cloud-docker-valkey = "run --package windsock-cloud-docker -- redis"
windsock-cloud-docker-kafka = "run --package windsock-cloud-docker -- kafka"
windsock-cloud-docker-cassandra = "run --package windsock-cloud-docker -- cassandra"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.idea/
*.gz
/.vscode
/shotover-proxy/tests/test-configs/redis/tls/certs
/shotover-proxy/tests/test-configs/valkey/tls/certs
/shotover-proxy/tests/test-configs/cassandra/tls/certs
/shotover-proxy/tests/test-configs/kafka/tls/certs
.workspace.code-workspace
Expand Down
4 changes: 2 additions & 2 deletions custom-transforms-example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use shotover::runner::Shotover;

#[cfg(feature = "redis")]
mod redis_get_rewrite;
mod valkey_get_rewrite;
#[cfg(feature = "redis")]
shotover::import_transform!(redis_get_rewrite::ValkeyGetRewriteConfig);
shotover::import_transform!(valkey_get_rewrite::ValkeyGetRewriteConfig);

fn main() {
Shotover::new().run_block();
Expand Down
4 changes: 2 additions & 2 deletions custom-transforms-example/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pretty_assertions::assert_eq;
use redis::aio::Connection;
use redis::Cmd;
use std::time::Duration;
use test_helpers::connection::redis_connection;
use test_helpers::connection::valkey_connection;
use test_helpers::docker_compose::docker_compose;
use test_helpers::shotover_process::{bin_path, BinProcess, EventMatcher, Level};

Expand All @@ -11,7 +11,7 @@ async fn test_custom_transform() {
// Setup shotover and the valkey server it connects to
let _compose = docker_compose("config/docker-compose.yaml");
let shotover = shotover_proxy("config/topology.yaml").await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await;

// Verify functionality of transform
assert_ok(
Expand Down
6 changes: 3 additions & 3 deletions shotover-proxy/benches/windsock/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ mod common;
#[cfg(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))]
mod kafka;
mod profilers;
#[cfg(feature = "redis")]
mod redis;
mod shotover;
#[cfg(feature = "redis")]
mod valkey;

use cloud::CloudResources;
use cloud::CloudResourcesRequired;
Expand Down Expand Up @@ -55,7 +55,7 @@ fn main() {
#[cfg(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))]
benches.extend(kafka::benches());
#[cfg(feature = "redis")]
benches.extend(redis::benches());
benches.extend(valkey::benches());

Windsock::new(benches, cloud::AwsCloud::new_boxed(), &["release"]).run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use shotover::{
tls::{TlsAcceptorConfig, TlsConnectorConfig},
transforms::{
debug::force_parse::DebugForceEncodeConfig,
redis::{sink_cluster::ValkeySinkClusterConfig, sink_single::ValkeySinkSingleConfig},
valkey::{sink_cluster::ValkeySinkClusterConfig, sink_single::ValkeySinkSingleConfig},
TransformConfig,
},
};
Expand Down Expand Up @@ -84,7 +84,7 @@ impl ValkeyBench {
}

fn generate_topology_yaml(&self, host_address: String, valkey_address: String) -> String {
let certs = "tests/test-configs/redis/tls/certs";
let certs = "tests/test-configs/valkey/tls/certs";
let tls_connector = match self.encryption {
Encryption::Tls => Some(TlsConnectorConfig {
certificate_authority_path: format!("{certs}/localhost_CA.crt"),
Expand Down Expand Up @@ -131,7 +131,7 @@ impl ValkeyBench {
}

common::generate_topology(SourceConfig::Valkey(
shotover::sources::redis::ValkeyConfig {
shotover::sources::valkey::ValkeyConfig {
name: "valkey".to_owned(),
listen_addr: host_address,
connection_limit: None,
Expand Down Expand Up @@ -314,12 +314,12 @@ impl Bench for ValkeyBench {
ValkeyTopology::Cluster3 => "172.16.1.2:6379",
};
let config_dir = match (self.topology, self.encryption) {
(ValkeyTopology::Single, Encryption::None) => "tests/test-configs/redis/passthrough",
(ValkeyTopology::Single, Encryption::None) => "tests/test-configs/valkey/passthrough",
(ValkeyTopology::Cluster3, Encryption::None) => {
"tests/test-configs/redis/cluster-hiding"
"tests/test-configs/valkey/cluster-hiding"
}
(ValkeyTopology::Single, Encryption::Tls) => "tests/test-configs/redis/tls",
(ValkeyTopology::Cluster3, Encryption::Tls) => "tests/test-configs/redis/cluster-tls",
(ValkeyTopology::Single, Encryption::Tls) => "tests/test-configs/valkey/tls",
(ValkeyTopology::Cluster3, Encryption::Tls) => "tests/test-configs/valkey/cluster-tls",
};
let _compose = docker_compose(&format!("{config_dir}/docker-compose.yaml"));
let mut profiler = ProfilerRunner::new(self.name(), profiling);
Expand Down Expand Up @@ -360,12 +360,12 @@ impl Bench for ValkeyBench {
let mut config = RedisConfig::from_url(address).unwrap();
if let Encryption::Tls = self.encryption {
let private_key =
load_private_key("tests/test-configs/redis/tls/certs/localhost.key").unwrap();
let certs = load_certs("tests/test-configs/redis/tls/certs/localhost.crt").unwrap();
load_private_key("tests/test-configs/valkey/tls/certs/localhost.key").unwrap();
let certs = load_certs("tests/test-configs/valkey/tls/certs/localhost.crt").unwrap();
config.tls = Some(
ClientConfig::builder()
.with_root_certificates(
load_ca("tests/test-configs/redis/tls/certs/localhost_CA.crt").unwrap(),
load_ca("tests/test-configs/valkey/tls/certs/localhost_CA.crt").unwrap(),
)
.with_client_auth_cert(certs, private_key)
.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use test_helpers::connection::cassandra::{
CassandraDriver, CassandraDriver::Cdrs, CassandraDriver::Java, CassandraDriver::Scylla,
CqlWsSession, ResultValue,
};
use test_helpers::connection::redis_connection;
use test_helpers::connection::valkey_connection;
use test_helpers::docker_compose::docker_compose;
#[cfg(feature = "alpha-transforms")]
use test_helpers::docker_compose::new_moto;
Expand Down Expand Up @@ -569,7 +569,7 @@ async fn cassandra_valkey_cache(#[case] driver: CassandraDriver) {
.start()
.await;

let mut valkey_connection = redis_connection::new(6379);
let mut valkey_connection = valkey_connection::new(6379);
let connection_creator = || CassandraConnectionBuilder::new("127.0.0.1", 9042, driver).build();
let connection = connection_creator().await;

Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ mod kafka_int_tests;
#[cfg(all(feature = "alpha-transforms", feature = "opensearch"))]
mod opensearch_int_tests;
#[cfg(feature = "redis")]
mod redis_int_tests;
#[cfg(feature = "redis")]
mod runner;
#[cfg(feature = "redis")]
mod transforms;
#[cfg(feature = "redis")]
mod valkey_int_tests;

pub fn shotover_process(topology_path: &str) -> ShotoverProcessBuilder {
ShotoverProcessBuilder::new_with_topology(topology_path)
Expand Down
12 changes: 6 additions & 6 deletions shotover-proxy/tests/runner/observability_int_tests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::shotover_process;
use test_helpers::connection::redis_connection;
use test_helpers::connection::valkey_connection;
use test_helpers::docker_compose::docker_compose;
use test_helpers::metrics::{assert_metrics_has_keys, assert_metrics_key_value};

#[tokio::test(flavor = "multi_thread")]
async fn test_metrics() {
let shotover = shotover_process("tests/test-configs/null-redis/topology.yaml")
let shotover = shotover_process("tests/test-configs/null-valkey/topology.yaml")
.start()
.await;

Expand Down Expand Up @@ -95,7 +95,7 @@ shotover_transform_total_count{transform="QueryCounter"}
"#;
assert_metrics_has_keys("", expected).await;

let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await;

redis::cmd("SET")
.arg("the_key")
Expand Down Expand Up @@ -151,12 +151,12 @@ shotover_query_count{name="valkey-chain",query="SET",type="valkey"}

#[tokio::test(flavor = "multi_thread")]
async fn test_shotover_with_metrics_disabled() {
let _compose = docker_compose("tests/test-configs/redis/passthrough/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml")
let _compose = docker_compose("tests/test-configs/valkey/passthrough/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/valkey/passthrough/topology.yaml")
.with_config("tests/test-configs/shotover-config/config_metrics_disabled.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await;

// Verify Shotover can still process messages with metrics disabled
redis::cmd("SET")
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/tests/runner/runner_int_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn test_early_shutdown_cassandra_source() {
async fn test_shotover_responds_sigterm() {
// Ensure it isnt reliant on timing
for _ in 0..1000 {
let shotover_process = shotover_process("tests/test-configs/null-redis/topology.yaml")
let shotover_process = shotover_process("tests/test-configs/null-valkey/topology.yaml")
.start()
.await;
shotover_process.send_sigterm();
Expand All @@ -31,7 +31,7 @@ async fn test_shotover_responds_sigterm() {

#[tokio::test]
async fn test_shotover_responds_sigint() {
let shotover_process = shotover_process("tests/test-configs/null-redis/topology.yaml")
let shotover_process = shotover_process("tests/test-configs/null-valkey/topology.yaml")
.start()
.await;
shotover_process.send_sigint();
Expand Down

This file was deleted.

20 changes: 0 additions & 20 deletions shotover-proxy/tests/test-configs/redis/tls/topology-encode.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions shotover-proxy/tests/test-configs/redis/tls/topology.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ services:
ipv4_address: 172.16.1.2
image: &image bitnami/valkey-cluster:7.2.5-debian-12-r4
volumes:
- &keys ../tls/certs:/usr/local/etc/redis/certs
- &keys ../tls/certs:/usr/local/etc/valkey/certs

environment: &node_environment
- 'ALLOW_EMPTY_PASSWORD=yes'
- 'VALKEY_NODES=valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5'
- 'VALKEY_TLS_PORT=6379'
- 'VALKEY_TLS_ENABLED=true'
- 'VALKEY_TLS_CERT_FILE=/usr/local/etc/redis/certs/localhost.crt'
- 'VALKEY_TLS_KEY_FILE=/usr/local/etc/redis/certs/localhost.key'
- 'VALKEY_TLS_CA_FILE=/usr/local/etc/redis/certs/localhost_CA.crt'
- 'VALKEY_TLS_CERT_FILE=/usr/local/etc/valkey/certs/localhost.crt'
- 'VALKEY_TLS_KEY_FILE=/usr/local/etc/valkey/certs/localhost.key'
- 'VALKEY_TLS_CA_FILE=/usr/local/etc/valkey/certs/localhost_CA.crt'
- 'VALKEY_TLS_AUTH_CLIENTS=yes'

valkey-node-1:
Expand Down Expand Up @@ -93,6 +93,6 @@ services:
- 'VALKEY_NODES=valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5'
- 'VALKEY_TLS_PORT=6379'
- 'VALKEY_TLS_ENABLED=true'
- 'VALKEY_TLS_CERT_FILE=/usr/local/etc/redis/certs/localhost.crt'
- 'VALKEY_TLS_KEY_FILE=/usr/local/etc/redis/certs/localhost.key'
- 'VALKEY_TLS_CA_FILE=/usr/local/etc/redis/certs/localhost_CA.crt'
- 'VALKEY_TLS_CERT_FILE=/usr/local/etc/valkey/certs/localhost.crt'
- 'VALKEY_TLS_KEY_FILE=/usr/local/etc/valkey/certs/localhost.key'
- 'VALKEY_TLS_CA_FILE=/usr/local/etc/valkey/certs/localhost_CA.crt'
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sources:
name: "valkey"
listen_addr: "127.0.0.1:6379"
tls:
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
chain:
- DebugForceEncode:
encode_requests: true
Expand All @@ -20,8 +20,8 @@ sources:
- "172.16.1.7:6379"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
verify_hostname: true

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ sources:
- "172.16.1.7:6379"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
verify_hostname: true

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sources:
name: "valkey"
listen_addr: "127.0.0.1:6379"
tls:
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
chain:
- ValkeySinkCluster:
first_contact_points:
Expand All @@ -17,8 +17,8 @@ sources:
- "172.16.1.7:6379"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
verify_hostname: true

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sources:
name: "valkey"
listen_addr: "127.0.0.1:6379"
tls:
certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
chain:
- ValkeySinkSingle:
remote_address: "localhost:1111"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt"
certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt"
verify_hostname: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sources:
- Valkey:
name: "valkey"
listen_addr: "127.0.0.1:6379"
tls:
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
chain:
- ValkeySinkSingle:
remote_address: "localhost:1111"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key"
verify_hostname: false
Loading

0 comments on commit 8dffbdf

Please sign in to comment.