21 Commits

Author SHA1 Message Date
4d8c91f4cb fix(deps): update rust crate serde to v1.0.228 2025-12-19 04:50:05 +00:00
70ba5b10c7 chore(deps): update rust crate tracing to v0.1.44 2025-12-19 01:53:33 +00:00
3581bf1265 chore(deps): update tokio-tracing monorepo 2025-11-29 01:49:07 +00:00
c6f00031be chore(deps): update rust crate tracing-subscriber to v0.3.20 2025-11-13 02:21:54 +00:00
489b30e028 fix(deps): update aws-sdk-rust monorepo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-03-06 02:02:25 +00:00
430240d751 fix(deps): update rust crate aws-sdk-s3 to v1.76.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-02-15 01:49:37 +00:00
707d1e2263 chore(deps): update tokio-prost monorepo to v0.13.5
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-02-13 01:55:42 +00:00
d0bd8b938f fix(deps): update aws-sdk-rust monorepo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-02-07 01:54:57 +00:00
6f3a5129bd fix(deps): update aws-sdk-rust monorepo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-01-30 02:06:16 +00:00
68c9820aae fix(deps): update rust crate aws-sdk-s3 to v1.70.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-01-22 01:54:31 +00:00
e44cb6dd23 fix(deps): update aws-sdk-rust monorepo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-01-16 01:55:25 +00:00
6aa881048c fix(deps): update aws-sdk-rust monorepo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-12-29 01:50:13 +00:00
5356303e7b fix(deps): update rust crate serde to v1.0.216
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-12-11 05:44:02 +00:00
1bd6fc06c5 chore(deps): update tokio-prost monorepo to v0.13.4
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-12-07 01:51:42 +00:00
f342e3c0df fix(deps): update rust crate aws-sdk-s3 to v1.65.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-12-05 01:52:45 +00:00
25182f14c1 chore(deps): update rust crate tracing-subscriber to v0.3.19
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-11-30 06:30:57 +00:00
9a72f2f6c2 chore(deps): update rust crate tracing to v0.1.41
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-11-28 01:56:50 +00:00
2352c00736 fix(deps): update rust crate aws-sdk-s3 to v1.63.0
Some checks failed
continuous-integration/drone/push Build is running
continuous-integration/drone/pr Build is failing
2024-11-26 02:28:02 +00:00
089c1d502f feat: with updated notmad
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-19 17:30:18 +01:00
8b24dc23e0 feat: added please and release
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-17 20:57:48 +01:00
7510c9a333 feat: change order of grpc host
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-17 16:26:21 +01:00
7 changed files with 209 additions and 759 deletions

903
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,8 +2,11 @@
members = ["crates/*"] members = ["crates/*"]
resolver = "2" resolver = "2"
[workspace.package]
version = "0.1.0"
[workspace.dependencies] [workspace.dependencies]
nodata-storage = { path = "crates/nodata-storage" } nodata-storage = { path = "crates/nodata-storage", version = "0.1.0" }
anyhow = { version = "1" } anyhow = { version = "1" }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
@@ -12,9 +15,9 @@ tracing-subscriber = { version = "0.3.18" }
clap = { version = "4", features = ["derive", "env"] } clap = { version = "4", features = ["derive", "env"] }
dotenv = { version = "0.15" } dotenv = { version = "0.15" }
axum = { version = "0.7" } axum = { version = "0.7" }
drift = { git = "https://github.com/kjuulh/drift", branch = "main" } nodrift = { version = "0.2.0" }
async-trait = "0.1" async-trait = "0.1"
tonic = "0.12.1" tonic = { version = "0.12.3", features = ["tls", "tls-roots"] }
bytes = "1.7.1" bytes = "1.7.1"
prost = "0.13.1" prost = "0.13.1"
prost-types = "0.13.1" prost-types = "0.13.1"

View File

@@ -1,6 +1,8 @@
[package] [package]
name = "nodata-storage" name = "nodata-storage"
version = "0.1.0" version.workspace = true
description = "nodata storage is the backend that serves the nodata message broker, it allows storing data in many different types of backends"
license = "MIT"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View File

@@ -2,6 +2,8 @@
name = "nodata" name = "nodata"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
description = "nodata is a kafka like message broker that is simple and easy to use, while relying on either local or s3 like data storage for consistency"
license = "MIT"
[dependencies] [dependencies]
nodata-storage.workspace = true nodata-storage.workspace = true
@@ -13,17 +15,10 @@ tracing-subscriber.workspace = true
clap.workspace = true clap.workspace = true
dotenv.workspace = true dotenv.workspace = true
axum.workspace = true axum.workspace = true
drift.workspace = true nodrift.workspace = true
uuid.workspace = true uuid.workspace = true
serde = { version = "1.0.197", features = ["derive"] } serde = { version = "1.0.197", features = ["derive"] }
sqlx = { version = "0.8.0", features = [
"runtime-tokio",
"tls-rustls",
"postgres",
"uuid",
"time",
] }
tower-http = { version = "0.6.0", features = ["cors", "trace"] } tower-http = { version = "0.6.0", features = ["cors", "trace"] }
tokio-util = "0.7.11" tokio-util = "0.7.11"
tonic.workspace = true tonic.workspace = true
@@ -34,7 +29,7 @@ chrono = { version = "0.4.38", features = ["serde"] }
tokio-stream = "0.1.15" tokio-stream = "0.1.15"
dagger-sdk = "0.13.0" dagger-sdk = "0.13.0"
rand = "0.8.5" rand = "0.8.5"
notmad = "0.4.0" notmad = "0.5.0"
prometheus = "0.13.4" prometheus = "0.13.4"
[dev-dependencies] [dev-dependencies]

View File

@@ -1,7 +1,7 @@
use std::{collections::BTreeMap, sync::Arc, time::Duration}; use std::{collections::BTreeMap, sync::Arc, time::Duration};
use axum::async_trait; use axum::async_trait;
use drift::Drifter; use nodrift::Drifter;
use notmad::Component; use notmad::Component;
use tokio::sync::RwLock; use tokio::sync::RwLock;
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
@@ -33,7 +33,7 @@ impl Component for Broker {
&self, &self,
cancellation_token: tokio_util::sync::CancellationToken, cancellation_token: tokio_util::sync::CancellationToken,
) -> Result<(), notmad::MadError> { ) -> Result<(), notmad::MadError> {
let token = drift::schedule_drifter(Duration::from_secs(1), self.clone()); let token = nodrift::schedule_drifter(Duration::from_secs(1), self.clone());
tokio::select! { tokio::select! {
_ = token.cancelled() => {}, _ = token.cancelled() => {},
@@ -95,7 +95,7 @@ impl BrokerHandler {
_parent_token: CancellationToken, _parent_token: CancellationToken,
) -> Self { ) -> Self {
let inner_state = state.clone(); let inner_state = state.clone();
let token = drift::schedule(Duration::from_secs(1), move || { let token = nodrift::schedule(Duration::from_secs(1), move || {
let consumer_group = consumer_group.clone(); let consumer_group = consumer_group.clone();
let state = inner_state.clone(); let state = inner_state.clone();

View File

@@ -10,6 +10,7 @@ mod services;
use std::net::SocketAddr; use std::net::SocketAddr;
use anyhow::Context;
use broker::Broker; use broker::Broker;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use grpc::{GetTopicsRequest, GrpcServer, PublishEventRequest, SubscribeRequest}; use grpc::{GetTopicsRequest, GrpcServer, PublishEventRequest, SubscribeRequest};
@@ -17,6 +18,7 @@ use grpc_component::GrpcComponentClient;
use http::HttpServer; use http::HttpServer;
use notmad::Mad; use notmad::Mad;
use state::SharedState; use state::SharedState;
use tonic::transport::{Channel, ClientTlsConfig};
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None, subcommand_required = true)] #[command(author, version, about, long_about = None, subcommand_required = true)]
@@ -35,7 +37,7 @@ enum Commands {
)] )]
host: SocketAddr, host: SocketAddr,
#[arg( #[arg(
env = "GRPC_SERVICE_HOST", env = "SERVICE_GRPC_HOST",
long = "service-grpc-host", long = "service-grpc-host",
default_value = "127.0.0.1:7900" default_value = "127.0.0.1:7900"
)] )]
@@ -46,7 +48,7 @@ enum Commands {
// #[arg(env = "SERVICE_HOST", long, default_value = "http://127.0.0.1:3000")] // #[arg(env = "SERVICE_HOST", long, default_value = "http://127.0.0.1:3000")]
//host: String, //host: String,
#[arg( #[arg(
env = "GRPC_SERVICE_HOST", env = "SERVICE_GRPC_HOST",
long = "service-grpc-host", long = "service-grpc-host",
default_value = "http://127.0.0.1:7900" default_value = "http://127.0.0.1:7900"
)] )]
@@ -192,8 +194,22 @@ async fn create_client(
) -> anyhow::Result< ) -> anyhow::Result<
crate::grpc::no_data_service_client::NoDataServiceClient<tonic::transport::Channel>, crate::grpc::no_data_service_client::NoDataServiceClient<tonic::transport::Channel>,
> { > {
let client = let channel = if grpc_host.starts_with("https") {
crate::grpc::no_data_service_client::NoDataServiceClient::connect(grpc_host).await?; Channel::from_shared(grpc_host.to_owned())
.context(format!("failed to connect to: {}", &grpc_host))?
.tls_config(ClientTlsConfig::new().with_native_roots())?
.connect()
.await
.context(format!("failed to connect to: {}", &grpc_host))?
} else {
Channel::from_shared(grpc_host.to_owned())
.context(format!("failed to connect to: {}", &grpc_host))?
.connect()
.await
.context(format!("failed to connect to: {}", &grpc_host))?
};
let client = crate::grpc::no_data_service_client::NoDataServiceClient::new(channel);
Ok(client) Ok(client)
} }

View File

@@ -13,6 +13,15 @@ vars:
- internal: "true" - internal: "true"
- internal_grpc: "true" - internal_grpc: "true"
please:
project:
owner: kjuulh
repository: nodata
branch: main
settings:
api_url: https://git.front.kjuulh.io
actions:
rust:
cuddle/clusters: cuddle/clusters:
dev: dev: