Skip to content

Commit

Permalink
Promote keda and flight-sql to optional features (#1079)
Browse files Browse the repository at this point in the history
* remove flight-sql from scheduler default options

* keda-scheduler is optional feature (off by default)
  • Loading branch information
milenkovicm authored Oct 14, 2024
1 parent 428169f commit 5c7f4af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ballista/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ name = "ballista-scheduler"
path = "src/bin/main.rs"

[features]
default = ["flight-sql"]
default = []
flight-sql = []
keda-scaler = []
prometheus-metrics = ["prometheus", "once_cell"]

[dependencies]
Expand Down
10 changes: 6 additions & 4 deletions ballista/scheduler/src/scheduler_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ use std::{net::SocketAddr, sync::Arc};
use crate::api::get_routes;
use crate::cluster::BallistaCluster;
use crate::config::SchedulerConfig;
#[cfg(feature = "flight-sql")]
use crate::flight_sql::FlightSqlServiceImpl;
use crate::metrics::default_metrics_collector;
#[cfg(feature = "keda-scaler")]
use crate::scheduler_server::externalscaler::external_scaler_server::ExternalScalerServer;
use crate::scheduler_server::SchedulerServer;

Expand Down Expand Up @@ -67,11 +69,11 @@ pub async fn start_server(
.max_encoding_message_size(config.grpc_server_max_encoding_message_size as usize)
.max_decoding_message_size(config.grpc_server_max_decoding_message_size as usize);

let keda_scaler = ExternalScalerServer::new(scheduler_server.clone());
let tonic_builder = create_grpc_server().add_service(scheduler_grpc_server);

let tonic_builder = create_grpc_server()
.add_service(scheduler_grpc_server)
.add_service(keda_scaler);
#[cfg(feature = "keda-scaler")]
let tonic_builder =
tonic_builder.add_service(ExternalScalerServer::new(scheduler_server.clone()));

#[cfg(feature = "flight-sql")]
let tonic_builder = tonic_builder.add_service(FlightServiceServer::new(
Expand Down
2 changes: 2 additions & 0 deletions ballista/scheduler/src/scheduler_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ use crate::state::task_manager::TaskLauncher;
use crate::state::SchedulerState;

// include the generated protobuf source as a submodule
#[cfg(feature = "keda-scaler")]
#[allow(clippy::all)]
pub mod externalscaler {
include!(concat!(env!("OUT_DIR"), "/externalscaler.rs"));
}

pub mod event;
#[cfg(feature = "keda-scaler")]
mod external_scaler;
mod grpc;
pub(crate) mod query_stage_scheduler;
Expand Down

0 comments on commit 5c7f4af

Please sign in to comment.