Skip to content

Commit 1d7346b

Browse files
author
Devdutt Shenoi
authored
Merge branch 'main' into deps
2 parents f32b5d9 + 59a82d2 commit 1d7346b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2567
-2642
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ key.pem
1010
helm-releases/.DS_Store
1111
.DS_Store
1212
env-file
13-
parseable
13+
parseable/*
1414
parseable_*
1515
parseable-env-secret
1616
cache

Dockerfile.debug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ RUN cargo build
3434
# final stage
3535
FROM docker.io/debian:bookworm-slim
3636

37+
RUN apt update && apt install -y curl
38+
3739
WORKDIR /parseable
3840

3941
# Copy the static binary into the final image

docker-compose-distributed-test-with-kafka.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ services:
1111
volumes:
1212
- ./parseable-ingest-haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
1313
depends_on:
14-
- parseable-ingest-one
15-
- parseable-ingest-two
14+
parseable-ingest-one:
15+
condition: service_healthy
16+
parseable-ingest-two:
17+
condition: service_healthy
1618
networks:
1719
- parseable-internal
1820
healthcheck:
@@ -28,7 +30,7 @@ services:
2830

2931
# minio
3032
minio:
31-
image: minio/minio:RELEASE.2023-02-10T18-48-39Z
33+
image: minio/minio:RELEASE.2025-02-03T21-03-04Z
3234
entrypoint:
3335
- sh
3436
- -euc
@@ -55,7 +57,7 @@ services:
5557
parseable-query:
5658
build:
5759
context: .
58-
dockerfile: Dockerfile
60+
dockerfile: Dockerfile.debug
5961
platform: linux/amd64
6062
command: [ "parseable", "s3-store" ]
6163
ports:
@@ -72,6 +74,7 @@ services:
7274
- P_CHECK_UPDATE=false
7375
- P_PARQUET_COMPRESSION_ALGO=snappy
7476
- P_MODE=query
77+
- RUST_LOG=warn
7578
networks:
7679
- parseable-internal
7780
healthcheck:
@@ -189,6 +192,7 @@ services:
189192
quest:
190193
platform: linux/amd64
191194
image: ghcr.io/parseablehq/quest:main
195+
pull_policy: always
192196
command:
193197
[
194198
"load",
@@ -209,9 +213,12 @@ services:
209213
networks:
210214
- parseable-internal
211215
depends_on:
212-
- parseable-query
213-
- parseable-ingest-haproxy
214-
- minio
216+
parseable-query:
217+
condition: service_healthy
218+
parseable-ingest-haproxy:
219+
condition: service_healthy
220+
minio:
221+
condition: service_healthy
215222
deploy:
216223
restart_policy:
217224
condition: on-failure

docker-compose-distributed-test.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ networks:
44
services:
55
# minio
66
minio:
7-
image: minio/minio:RELEASE.2023-02-10T18-48-39Z
7+
image: minio/minio:RELEASE.2025-02-03T21-03-04Z
88
entrypoint:
99
- sh
1010
- -euc
@@ -28,7 +28,7 @@ services:
2828
parseable-query:
2929
build:
3030
context: .
31-
dockerfile: Dockerfile
31+
dockerfile: Dockerfile.debug
3232
platform: linux/amd64
3333
command: [ "parseable", "s3-store" ]
3434
ports:
@@ -45,6 +45,7 @@ services:
4545
- P_CHECK_UPDATE=false
4646
- P_PARQUET_COMPRESSION_ALGO=snappy
4747
- P_MODE=query
48+
- RUST_LOG=warn
4849
networks:
4950
- parseable-internal
5051
healthcheck:
@@ -53,7 +54,8 @@ services:
5354
timeout: 20s
5455
retries: 5
5556
depends_on:
56-
- minio
57+
minio:
58+
condition: service_healthy
5759
deploy:
5860
restart_policy:
5961
condition: on-failure
@@ -63,7 +65,7 @@ services:
6365
parseable-ingest-one:
6466
build:
6567
context: .
66-
dockerfile: Dockerfile
68+
dockerfile: Dockerfile.debug
6769
platform: linux/amd64
6870
command: [ "parseable", "s3-store", ]
6971
ports:
@@ -81,6 +83,7 @@ services:
8183
- P_PARQUET_COMPRESSION_ALGO=snappy
8284
- P_MODE=ingest
8385
- P_INGESTOR_ENDPOINT=parseable-ingest-one:8000
86+
- RUST_LOG=warn
8487
networks:
8588
- parseable-internal
8689
healthcheck:
@@ -89,8 +92,10 @@ services:
8992
timeout: 20s
9093
retries: 5
9194
depends_on:
92-
- parseable-query
93-
- minio
95+
parseable-query:
96+
condition: service_healthy
97+
minio:
98+
condition: service_healthy
9499
deploy:
95100
restart_policy:
96101
condition: on-failure
@@ -100,6 +105,7 @@ services:
100105
quest:
101106
platform: linux/amd64
102107
image: ghcr.io/parseablehq/quest:main
108+
pull_policy: always
103109
command:
104110
[
105111
"load",
@@ -120,9 +126,12 @@ services:
120126
networks:
121127
- parseable-internal
122128
depends_on:
123-
- parseable-query
124-
- parseable-ingest-one
125-
- minio
129+
parseable-query:
130+
condition: service_healthy
131+
parseable-ingest-one:
132+
condition: service_healthy
133+
minio:
134+
condition: service_healthy
126135
deploy:
127136
restart_policy:
128137
condition: on-failure

docker-compose-test-with-kafka.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ networks:
33

44
services:
55
minio:
6-
image: minio/minio:RELEASE.2023-02-10T18-48-39Z
6+
image: minio/minio:RELEASE.2025-02-03T21-03-04Z
77
entrypoint:
88
- sh
99
- -euc
@@ -49,8 +49,10 @@ services:
4949
- P_KAFKA_BOOTSTRAP_SERVERS=kafka-0:9092
5050
# additional settings like security, tuning, etc.
5151
depends_on:
52-
- minio
53-
- kafka-0
52+
minio:
53+
condition: service_healthy
54+
kafka-0:
55+
condition: service_healthy
5456
healthcheck:
5557
test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/liveness" ]
5658
interval: 15s
@@ -67,6 +69,7 @@ services:
6769
quest:
6870
image: ghcr.io/parseablehq/quest:main
6971
platform: linux/amd64
72+
pull_policy: always
7073
command: [
7174
"load",
7275
"http://parseable:8000",
@@ -81,7 +84,8 @@ services:
8184
"parseable"
8285
]
8386
depends_on:
84-
- parseable
87+
parseable:
88+
condition: service_healthy
8589
networks:
8690
- parseable-internal
8791
deploy:
@@ -145,14 +149,15 @@ services:
145149
kafka-log-generator:
146150
build:
147151
context: ./scripts
148-
dockerfile: Dockerfile
152+
dockerfile: Dockerfile.debug
149153
environment:
150154
- KAFKA_BROKERS=kafka-0:9092
151155
- KAFKA_TOPIC=test-logs-stream
152156
- LOG_RATE=5000
153157
- TOTAL_LOGS=500_000
154158
depends_on:
155-
- kafka-0
159+
kafka-0:
160+
condition: service_healthy
156161
networks:
157162
- parseable-internal
158163
deploy:

docker-compose-test.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ networks:
33

44
services:
55
minio:
6-
image: minio/minio:RELEASE.2023-02-10T18-48-39Z
6+
image: minio/minio:RELEASE.2025-02-03T21-03-04Z
77
entrypoint:
88
- sh
99
- -euc
@@ -27,7 +27,7 @@ services:
2727
parseable:
2828
build:
2929
context: .
30-
dockerfile: Dockerfile
30+
dockerfile: Dockerfile.debug
3131
platform: linux/amd64
3232
command: [ "parseable", "s3-store", ]
3333
ports:
@@ -43,8 +43,10 @@ services:
4343
- P_PASSWORD=parseableadmin
4444
- P_CHECK_UPDATE=false
4545
- P_PARQUET_COMPRESSION_ALGO=snappy
46+
- RUST_LOG=warn
4647
depends_on:
47-
- minio
48+
minio:
49+
condition: service_healthy
4850
healthcheck:
4951
test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/liveness" ]
5052
interval: 15s
@@ -61,6 +63,7 @@ services:
6163
quest:
6264
image: ghcr.io/parseablehq/quest:main
6365
platform: linux/amd64
66+
pull_policy: always
6467
command: [
6568
"load",
6669
"http://parseable:8000",
@@ -75,7 +78,8 @@ services:
7578
"parseable"
7679
]
7780
depends_on:
78-
- parseable
81+
parseable:
82+
condition: service_healthy
7983
networks:
8084
- parseable-internal
8185
deploy:

src/about.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*
1818
*/
1919

20-
use crate::analytics;
21-
use crate::option::Config;
22-
use crate::storage::StorageMetadata;
23-
use crate::utils::update::{self, LatestRelease};
2420
use chrono::Duration;
2521
use chrono_humanize::{Accuracy, Tense};
2622
use crossterm::style::Stylize;
@@ -30,6 +26,11 @@ use std::path::Path;
3026
use sysinfo::System;
3127
use ulid::Ulid;
3228

29+
use crate::analytics;
30+
use crate::cli::Options;
31+
use crate::storage::StorageMetadata;
32+
use crate::utils::update::{self, LatestRelease};
33+
3334
// Expose some static variables for internal usage
3435
pub static LATEST_RELEASE: OnceCell<Option<LatestRelease>> = OnceCell::new();
3536

@@ -99,7 +100,7 @@ impl ParseableVersion {
99100

100101
pub fn print_about(
101102
current_version: semver::Version,
102-
latest_release: Option<update::LatestRelease>,
103+
latest_release: Option<LatestRelease>,
103104
commit_hash: String,
104105
) {
105106
eprint!(
@@ -123,7 +124,7 @@ pub fn print_about(
123124
);
124125
}
125126

126-
fn print_latest_release(latest_release: update::LatestRelease) {
127+
fn print_latest_release(latest_release: LatestRelease) {
127128
let time_since_latest_release = chrono::Utc::now() - latest_release.date;
128129
let time_since_latest_release = humanize_time(time_since_latest_release);
129130
let fmt_latest_version = format!(
@@ -133,10 +134,10 @@ fn print_latest_release(latest_release: update::LatestRelease) {
133134
eprint!("{}", fmt_latest_version.red());
134135
}
135136

136-
pub async fn print(config: &Config, meta: &StorageMetadata) {
137+
pub async fn print(options: &Options, meta: &StorageMetadata) {
137138
// print current version
138139
let current = current();
139-
let latest_release = if config.options.check_update {
140+
let latest_release = if options.check_update {
140141
update::get_latest(&meta.deployment_id).await.ok()
141142
} else {
142143
None

src/alerts/mod.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use once_cell::sync::Lazy;
2727
use serde_json::Error as SerdeError;
2828
use std::collections::{HashMap, HashSet};
2929
use std::fmt::{self, Display};
30-
use tokio::sync::oneshot::{Receiver, Sender};
30+
use tokio::sync::oneshot::{self, Receiver, Sender};
3131
use tokio::sync::RwLock;
3232
use tokio::task::JoinHandle;
3333
use tracing::{trace, warn};
@@ -36,7 +36,7 @@ use ulid::Ulid;
3636
pub mod alerts_utils;
3737
pub mod target;
3838

39-
use crate::option::CONFIG;
39+
use crate::parseable::PARSEABLE;
4040
use crate::query::{TableScanVisitor, QUERY_SESSION};
4141
use crate::rbac::map::SessionKey;
4242
use crate::storage;
@@ -650,8 +650,8 @@ impl AlertConfig {
650650
fn get_context(&self) -> Context {
651651
let deployment_instance = format!(
652652
"{}://{}",
653-
CONFIG.options.get_scheme(),
654-
CONFIG.options.address
653+
PARSEABLE.options.get_scheme(),
654+
PARSEABLE.options.address
655655
);
656656
let deployment_id = storage::StorageMetadata::global().deployment_id;
657657
let deployment_mode = storage::StorageMetadata::global().mode.to_string();
@@ -730,13 +730,20 @@ impl Alerts {
730730
/// Loads alerts from disk, blocks
731731
pub async fn load(&self) -> Result<(), AlertError> {
732732
let mut map = self.alerts.write().await;
733-
let store = CONFIG.storage().get_object_store();
733+
let store = PARSEABLE.storage.get_object_store();
734734

735735
for alert in store.get_alerts().await.unwrap_or_default() {
736-
let (handle, rx, tx) =
737-
schedule_alert_task(alert.get_eval_frequency(), alert.clone()).await?;
738-
739-
self.update_task(alert.id, handle, rx, tx).await;
736+
let (outbox_tx, outbox_rx) = oneshot::channel::<()>();
737+
let (inbox_tx, inbox_rx) = oneshot::channel::<()>();
738+
let handle = schedule_alert_task(
739+
alert.get_eval_frequency(),
740+
alert.clone(),
741+
inbox_rx,
742+
outbox_tx,
743+
)?;
744+
745+
self.update_task(alert.id, handle, outbox_rx, inbox_tx)
746+
.await;
740747

741748
map.insert(alert.id, alert);
742749
}
@@ -785,7 +792,7 @@ impl Alerts {
785792
new_state: AlertState,
786793
trigger_notif: Option<String>,
787794
) -> Result<(), AlertError> {
788-
let store = CONFIG.storage().get_object_store();
795+
let store = PARSEABLE.storage.get_object_store();
789796

790797
// read and modify alert
791798
let mut alert = self.get_alert_by_id(alert_id).await?;

0 commit comments

Comments
 (0)