Skip to content

Commit

Permalink
simplify feature gate
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Mar 14, 2024
1 parent 64f6b0e commit 5790364
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion ci/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ source "$HOME/.cargo/env"
rustup show
source ci/scripts/common.sh
unset RUSTC_WRAPPER # disable sccache
export TODO_DISABLE_EMBEDDED_DASHBOARD=1 # TODO(bugen): remove this after the embedded dashboard is ready

echo "--- Install protoc3"
PROTOC_ARCH=${ARCH}
Expand Down
2 changes: 0 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ ENV GIT_SHA=$GIT_SHA
COPY ./ /risingwave
WORKDIR /risingwave

# TODO(bugen): remove this after the embedded dashboard is ready
ENV TODO_DISABLE_EMBEDDED_DASHBOARD=1
RUN cargo fetch && \
cargo build -p risingwave_cmd_all --release --features "rw-static-link" --features embedded-python-udf && \
mkdir -p /risingwave/bin && \
Expand Down
8 changes: 1 addition & 7 deletions src/meta/dashboard/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ fn build() -> anyhow::Result<()> {
}

fn main() -> anyhow::Result<()> {
rerun_if_changed!("build.rs");

let should_build = env_var_is_true("ENABLE_BUILD_DASHBOARD") // asked to build by RiseDev
|| (std::env::var("PROFILE").unwrap() == "release" && !env_var_is_true("RISINGWAVE_CI")); // release build and not in CI

// TODO(bugen): remove this after the embedded dashboard is ready
let should_build = should_build && !env_var_is_true("TODO_DISABLE_EMBEDDED_DASHBOARD");
let should_build = env_var_is_true("ENABLE_BUILD_DASHBOARD");

if should_build {
build()?;
Expand Down
15 changes: 9 additions & 6 deletions src/meta/dashboard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ mod proxy;
/// Based on the configuration, it will either serve the assets embedded in the binary,
/// or proxy all requests to the latest static files built and hosted on GitHub.
///
/// - For development and CI builds, the requests to the dashboard will be proxied. This
/// is to reduce the build time and eliminate the dependency on `node`, so that the
/// developer experience can be better.
/// - If env var `ENABLE_BUILD_DASHBOARD` is not set during the build, the requests to
/// the dashboard will be proxied. This is to reduce the build time and eliminate the
/// dependency on `node`, so that the developer experience can be better. This is the
/// default behavior for CI and development builds.
///
/// - For release builds, the assets will built in the build script and embedded in the
/// binary. This is to make the deployment easier and the dashboard more reliable
/// without relying on external or remote resources.
/// - If env var `ENABLE_BUILD_DASHBOARD` is set during the build, the assets will be
/// built in the build script and embedded in the binary. This is to make the
/// deployment easier and the dashboard more reliable without relying on external or
/// remote resources. This is the default behavior for versioned releases, and can be
/// manually enabled for development builds with RiseDev.
///
/// If you're going to develop with the dashboard, see `dashboard/README.md` for more
/// details.
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ impl DashboardService {

let trace_ui_router = otlp_embedded::ui_app(srv.trace_state.clone(), "/trace/");
let dashboard_router = if let Some(ui_path) = ui_path {
// TODO(bugen): remove `ui_path`
// TODO(bugen): remove `ui_path` and all in the embedded `risingwave_meta_dashboard`.
get_service(ServeDir::new(ui_path))
.handle_error(|e| async move { match e {} })
.boxed_clone()
Expand Down

0 comments on commit 5790364

Please sign in to comment.