Skip to content

Commit

Permalink
feat: Add self-managed debug tool
Browse files Browse the repository at this point in the history
Introduces a new CLI tool for debugging self-managed Materialize deployments in Kubernetes. The tool can:
- Collect pod logs
- Collect info similar to `kubectl get all -o wide`
- Up next will be getting events, describe output, and rest of TODOs.
  • Loading branch information
SangJunBak committed Feb 4, 2025
1 parent 9c956cc commit 2460e24
Show file tree
Hide file tree
Showing 7 changed files with 817 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ members = [
"src/s3-datagen",
"src/secrets",
"src/segment",
"src/self-managed-debug",
"src/server-core",
"src/service",
"src/ssh-util",
Expand Down Expand Up @@ -202,6 +203,7 @@ default-members = [
"src/s3-datagen",
"src/secrets",
"src/segment",
"src/self-managed-debug",
"src/server-core",
"src/service",
"src/sql",
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ crates_repository(
"//:src/s3-datagen/Cargo.toml",
"//:src/secrets/Cargo.toml",
"//:src/segment/Cargo.toml",
"//:src/self-managed-debug/Cargo.toml",
"//:src/server-core/Cargo.toml",
"//:src/service/Cargo.toml",
"//:src/sql-lexer/Cargo.toml",
Expand Down
37 changes: 37 additions & 0 deletions src/self-managed-debug/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Code generated by cargo-gazelle DO NOT EDIT

# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

load("@crates_io//:defs.bzl", "aliases", "all_crate_deps")
load("@rules_rust//rust:defs.bzl", "rust_binary")

package(default_visibility = ["//visibility:public"])

rust_binary(
name = "mz_self_managed_debug",
srcs = glob(["src/**/*.rs"]),
aliases = aliases(
normal = True,
proc_macro = True,
),
compile_data = [],
crate_root = "src/main.rs",
data = [],
env = {},
features = [],
proc_macro_deps = [] + all_crate_deps(proc_macro = True),
rustc_env = {},
rustc_flags = [],
version = "0.130.1",
deps = [
"//src/build-info:mz_build_info",
"//src/ore:mz_ore",
] + all_crate_deps(normal = True),
)
32 changes: 32 additions & 0 deletions src/self-managed-debug/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "mz-self-managed-debug"
description = "Debug tool for self-managed Materialize."
version = "0.130.1"
edition.workspace = true
rust-version.workspace = true
publish = false

[lints]
workspace = true

[dependencies]
anyhow = "1.0.66"
chrono = { version = "0.4.35", default-features = false }
clap = { version = "4.5.23", features = ["derive", "env"] }
futures = "0.3.25"
k8s-openapi = { version = "0.22.0", features = ["v1_29"] }
kube = { version = "0.92.1", default-features = false, features = ["client", "runtime", "ws"] }
mz-build-info = { path = "../build-info" }
mz-ore = { path = "../ore", features = ["cli", "test"] }
serde = "1.0.152"
serde_json = "1.0.125"
tabled = "0.10.0"
tokio = "1.38.0"
tracing = "0.1.37"
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true }

[package.metadata.cargo-udeps.ignore]
normal = ["workspace-hack"]

[features]
default = ["workspace-hack"]
3 changes: 3 additions & 0 deletions src/self-managed-debug/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `self-managed-debug`

This tool allows us to debug a user's self-managed environment.
Loading

0 comments on commit 2460e24

Please sign in to comment.