From 0679b1cc3ca46776f9af3401ee0e71cfb3ff88f7 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2023 10:59:08 +0200 Subject: [PATCH 01/15] CLI: Improve error messages when coordinator is not running --- binaries/cli/src/attach.rs | 8 ++--- binaries/cli/src/check.rs | 64 ++++++++++++++++++-------------------- binaries/cli/src/main.rs | 60 ++++++++++++++++++----------------- binaries/cli/src/up.rs | 54 ++++++++++++++++++-------------- 4 files changed, 95 insertions(+), 91 deletions(-) diff --git a/binaries/cli/src/attach.rs b/binaries/cli/src/attach.rs index e9e34549..aec86562 100644 --- a/binaries/cli/src/attach.rs +++ b/binaries/cli/src/attach.rs @@ -11,13 +11,11 @@ use std::{path::PathBuf, sync::mpsc, time::Duration}; use tracing::{error, info}; use uuid::Uuid; -use crate::control_connection; - pub fn attach_dataflow( dataflow: Descriptor, dataflow_path: PathBuf, dataflow_id: Uuid, - session: &mut Option>, + session: &mut TcpRequestReplyConnection, hot_reload: bool, ) -> Result<(), eyre::ErrReport> { let (tx, rx) = mpsc::sync_channel(2); @@ -70,7 +68,7 @@ pub fn attach_dataflow( if let Some((dataflow_id, node_id, operator_id)) = node_path_lookup.get(&path) { watcher_tx .send(ControlRequest::Reload { - dataflow_id: dataflow_id.clone(), + dataflow_id: *dataflow_id, node_id: node_id.clone(), operator_id: operator_id.clone(), }) @@ -123,7 +121,7 @@ pub fn attach_dataflow( Ok(reload_event) => reload_event, }; - let reply_raw = control_connection(session)? + let reply_raw = session .request(&serde_json::to_vec(&control_request)?) .wrap_err("failed to send request message to coordinator")?; let result: ControlRequestReply = diff --git a/binaries/cli/src/check.rs b/binaries/cli/src/check.rs index a364630f..4b77eb13 100644 --- a/binaries/cli/src/check.rs +++ b/binaries/cli/src/check.rs @@ -1,4 +1,5 @@ -use crate::control_connection; +use crate::connect_to_coordinator; +use communication_layer_request_reply::TcpRequestReplyConnection; use dora_core::topics::{ControlRequest, ControlRequestReply}; use eyre::{bail, Context}; use std::io::Write; @@ -16,19 +17,30 @@ pub fn check_environment() -> eyre::Result<()> { // check whether coordinator is running write!(stdout, "Dora Coordinator: ")?; - if coordinator_running()? { - let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Green))); - writeln!(stdout, "ok")?; - } else { - let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red))); - writeln!(stdout, "not running")?; - error_occured = true; - } + let mut session = match connect_to_coordinator() { + Ok(session) => { + let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Green))); + writeln!(stdout, "ok")?; + Some(session) + } + Err(_) => { + let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red))); + writeln!(stdout, "not running")?; + error_occured = true; + None + } + }; + let _ = stdout.reset(); // check whether daemon is running write!(stdout, "Dora Daemon: ")?; - if daemon_running()? { + if session + .as_deref_mut() + .map(daemon_running) + .transpose()? + .unwrap_or(false) + { let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Green))); writeln!(stdout, "ok")?; } else { @@ -47,30 +59,16 @@ pub fn check_environment() -> eyre::Result<()> { Ok(()) } -pub fn coordinator_running() -> Result { - let mut control_session = None; - let connected = control_connection(&mut control_session).is_ok(); - Ok(connected) -} - -pub fn daemon_running() -> Result { - let mut control_session = None; - let running = match control_connection(&mut control_session) { - Ok(connection) => { - let reply_raw = connection - .request(&serde_json::to_vec(&ControlRequest::DaemonConnected).unwrap()) - .wrap_err("failed to send DaemonConnected message")?; +pub fn daemon_running(session: &mut TcpRequestReplyConnection) -> Result { + let reply_raw = session + .request(&serde_json::to_vec(&ControlRequest::DaemonConnected).unwrap()) + .wrap_err("failed to send DaemonConnected message")?; - let reply = serde_json::from_slice(&reply_raw).wrap_err("failed to parse reply")?; - match reply { - ControlRequestReply::DaemonConnected(running) => running, - other => bail!("unexpected reply to daemon connection check: {other:?}"), - } - } - Err(_) => { - // coordinator is not running - false - } + let reply = serde_json::from_slice(&reply_raw).wrap_err("failed to parse reply")?; + let running = match reply { + ControlRequestReply::DaemonConnected(running) => running, + other => bail!("unexpected reply to daemon connection check: {other:?}"), }; + Ok(running) } diff --git a/binaries/cli/src/main.rs b/binaries/cli/src/main.rs index 521becc4..4781c1c8 100644 --- a/binaries/cli/src/main.rs +++ b/binaries/cli/src/main.rs @@ -124,8 +124,6 @@ fn main() -> eyre::Result<()> { set_up_tracing("dora-cli").context("failed to set up tracing subscriber")?; let args = Args::parse(); - let mut session = None; - match args.command { Command::Check { dataflow, @@ -171,25 +169,36 @@ fn main() -> eyre::Result<()> { dataflow_description .check(&dataflow, None) .wrap_err("Could not validate yaml")?; - let dataflow_id = start_dataflow(dataflow.clone(), name, &mut session)?; + let mut session = + connect_to_coordinator().wrap_err("failed to connect to dora coordinator")?; + let dataflow_id = start_dataflow(dataflow.clone(), name, &mut *session)?; if attach { attach_dataflow( dataflow_description, dataflow, dataflow_id, - &mut session, + &mut *session, hot_reload, )? } } - Command::List => list(&mut session)?, - Command::Stop { uuid, name } => match (uuid, name) { - (Some(uuid), _) => stop_dataflow(uuid, &mut session)?, - (None, Some(name)) => stop_dataflow_by_name(name, &mut session)?, - (None, None) => stop_dataflow_interactive(&mut session)?, + Command::List => match connect_to_coordinator() { + Ok(mut session) => list(&mut *session)?, + Err(_) => { + eprintln!("No dora coordinator seems to be running."); + } }, - Command::Destroy { config } => up::destroy(config.as_deref(), &mut session)?, + Command::Stop { uuid, name } => { + let mut session = + connect_to_coordinator().wrap_err("could not connect to dora coordinator")?; + match (uuid, name) { + (Some(uuid), _) => stop_dataflow(uuid, &mut *session)?, + (None, Some(name)) => stop_dataflow_by_name(name, &mut *session)?, + (None, None) => stop_dataflow_interactive(&mut *session)?, + } + } + Command::Destroy { config } => up::destroy(config.as_deref())?, } Ok(()) @@ -198,12 +207,12 @@ fn main() -> eyre::Result<()> { fn start_dataflow( dataflow: PathBuf, name: Option, - session: &mut Option>, + session: &mut TcpRequestReplyConnection, ) -> Result { let canonicalized = dataflow .canonicalize() .wrap_err("given dataflow file does not exist")?; - let reply_raw = control_connection(session)? + let reply_raw = session .request( &serde_json::to_vec(&ControlRequest::Start { dataflow_path: canonicalized, @@ -225,9 +234,7 @@ fn start_dataflow( } } -fn stop_dataflow_interactive( - session: &mut Option>, -) -> eyre::Result<()> { +fn stop_dataflow_interactive(session: &mut TcpRequestReplyConnection) -> eyre::Result<()> { let uuids = query_running_dataflows(session).wrap_err("failed to query running dataflows")?; if uuids.is_empty() { eprintln!("No dataflows are running"); @@ -241,9 +248,9 @@ fn stop_dataflow_interactive( fn stop_dataflow( uuid: Uuid, - session: &mut Option>, + session: &mut TcpRequestReplyConnection, ) -> Result<(), eyre::ErrReport> { - let reply_raw = control_connection(session)? + let reply_raw = session .request( &serde_json::to_vec(&ControlRequest::Stop { dataflow_uuid: uuid, @@ -262,9 +269,9 @@ fn stop_dataflow( fn stop_dataflow_by_name( name: String, - session: &mut Option>, + session: &mut TcpRequestReplyConnection, ) -> Result<(), eyre::ErrReport> { - let reply_raw = control_connection(session)? + let reply_raw = session .request(&serde_json::to_vec(&ControlRequest::StopByName { name }).unwrap()) .wrap_err("failed to send dataflow stop_by_name message")?; let result: ControlRequestReply = @@ -276,7 +283,7 @@ fn stop_dataflow_by_name( } } -fn list(session: &mut Option>) -> Result<(), eyre::ErrReport> { +fn list(session: &mut TcpRequestReplyConnection) -> Result<(), eyre::ErrReport> { let ids = query_running_dataflows(session)?; if ids.is_empty() { @@ -292,9 +299,9 @@ fn list(session: &mut Option>) -> Result<(), eyre } fn query_running_dataflows( - session: &mut Option>, + session: &mut TcpRequestReplyConnection, ) -> Result, eyre::ErrReport> { - let reply_raw = control_connection(session)? + let reply_raw = session .request(&serde_json::to_vec(&ControlRequest::List).unwrap()) .wrap_err("failed to send list message")?; let reply: ControlRequestReply = @@ -308,11 +315,6 @@ fn query_running_dataflows( Ok(ids) } -fn control_connection( - session: &mut Option>, -) -> eyre::Result<&mut Box> { - Ok(match session { - Some(session) => session, - None => session.insert(TcpLayer::new().connect(control_socket_addr())?), - }) +fn connect_to_coordinator() -> std::io::Result> { + TcpLayer::new().connect(control_socket_addr()) } diff --git a/binaries/cli/src/up.rs b/binaries/cli/src/up.rs index 54cd6b5f..499cf8b2 100644 --- a/binaries/cli/src/up.rs +++ b/binaries/cli/src/up.rs @@ -1,8 +1,4 @@ -use crate::{ - check::{coordinator_running, daemon_running}, - control_connection, -}; -use communication_layer_request_reply::TcpRequestReplyConnection; +use crate::{check::daemon_running, connect_to_coordinator}; use dora_core::topics::ControlRequest; use eyre::Context; use std::{fs, path::Path, process::Command, time::Duration}; @@ -17,34 +13,44 @@ pub(crate) fn up( ) -> eyre::Result<()> { let UpConfig {} = parse_dora_config(config_path)?; - if !coordinator_running()? { - start_coordinator(coordinator).wrap_err("failed to start dora-coordinator")?; - // sleep a bit until the coordinator accepts connections - while !coordinator_running()? { - std::thread::sleep(Duration::from_millis(50)); + let mut session = match connect_to_coordinator() { + Ok(session) => session, + Err(_) => { + start_coordinator(coordinator).wrap_err("failed to start dora-coordinator")?; + + loop { + match connect_to_coordinator() { + Ok(session) => break session, + Err(_) => { + // sleep a bit until the coordinator accepts connections + std::thread::sleep(Duration::from_millis(50)); + } + } + } } - } - if !daemon_running()? { + }; + + if !daemon_running(&mut *session)? { start_daemon(daemon).wrap_err("failed to start dora-daemon")?; } Ok(()) } -pub(crate) fn destroy( - config_path: Option<&Path>, - session: &mut Option>, -) -> Result<(), eyre::ErrReport> { +pub(crate) fn destroy(config_path: Option<&Path>) -> Result<(), eyre::ErrReport> { let UpConfig {} = parse_dora_config(config_path)?; - if coordinator_running()? { - // send destroy command to dora-coordinator - control_connection(session)? - .request(&serde_json::to_vec(&ControlRequest::Destroy).unwrap()) - .wrap_err("failed to send destroy message")?; - println!("Send destroy command to dora-coordinator"); - } else { - eprintln!("The dora-coordinator is not running"); + match connect_to_coordinator() { + Ok(mut session) => { + // send destroy command to dora-coordinator + session + .request(&serde_json::to_vec(&ControlRequest::Destroy).unwrap()) + .wrap_err("failed to send destroy message")?; + println!("Send destroy command to dora-coordinator"); + } + Err(_) => { + eprintln!("The dora-coordinator does not seem to be running"); + } } Ok(()) From c80a1958cb808cecfc996fc709baedf073f1f38d Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Tue, 18 Apr 2023 20:49:09 +0800 Subject: [PATCH 02/15] Show node name in process and put error after Traceback In #229, I renamed `eyre::eyre!("{err}{traceback}")` where it should have `eyre::eyre!("{traceback}\n{err}")` . This PR fix this issue. This Pull Request also add the name of the node process at the end of the process call to help with debugging. --- binaries/daemon/src/spawn.rs | 5 ++++- binaries/runtime/src/operator/python.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/binaries/daemon/src/spawn.rs b/binaries/daemon/src/spawn.rs index b079783d..d76c011f 100644 --- a/binaries/daemon/src/spawn.rs +++ b/binaries/daemon/src/spawn.rs @@ -111,7 +111,10 @@ pub async fn spawn_node( let mut command = if has_python_operator && !has_other_operator { // Use python to spawn runtime if there is a python operator let mut command = tokio::process::Command::new("python3"); - command.args(["-c", "import dora; dora.start_runtime()"]); + command.args([ + "-c", + format!("import dora; dora.start_runtime() # {}", node.id).as_str(), + ]); command } else if !has_python_operator && has_other_operator { tokio::process::Command::new( diff --git a/binaries/runtime/src/operator/python.rs b/binaries/runtime/src/operator/python.rs index b94001a5..3414c959 100644 --- a/binaries/runtime/src/operator/python.rs +++ b/binaries/runtime/src/operator/python.rs @@ -25,7 +25,7 @@ use tracing::{error, field, span, warn}; fn traceback(err: pyo3::PyErr) -> eyre::Report { let traceback = Python::with_gil(|py| err.traceback(py).and_then(|t| t.format().ok())); if let Some(traceback) = traceback { - eyre::eyre!("{err}{traceback}") + eyre::eyre!("{traceback}\n{err}") } else { eyre::eyre!("{err}") } From f0b10261a4401fd7c93948ac1bf53fe0bbb0f912 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 19 Apr 2023 12:02:42 +0200 Subject: [PATCH 03/15] Remove special-casing of dora list again We now exit with an error exit code again when no coordinator is running. --- binaries/cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/cli/src/main.rs b/binaries/cli/src/main.rs index 4781c1c8..b2f8222f 100644 --- a/binaries/cli/src/main.rs +++ b/binaries/cli/src/main.rs @@ -186,7 +186,7 @@ fn main() -> eyre::Result<()> { Command::List => match connect_to_coordinator() { Ok(mut session) => list(&mut *session)?, Err(_) => { - eprintln!("No dora coordinator seems to be running."); + bail!("No dora coordinator seems to be running."); } }, Command::Stop { uuid, name } => { From d3e380a80f15fc4643eab6fb7e23516d51a90ab1 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 19 Apr 2023 12:04:29 +0200 Subject: [PATCH 04/15] Don't print file location on errors in dora CLI This information is not relevant to users and might confuse them. --- binaries/cli/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/binaries/cli/src/main.rs b/binaries/cli/src/main.rs index b2f8222f..ee38ce4e 100644 --- a/binaries/cli/src/main.rs +++ b/binaries/cli/src/main.rs @@ -119,7 +119,14 @@ enum Lang { Cxx, } -fn main() -> eyre::Result<()> { +fn main() { + if let Err(err) = run() { + eprintln!("{err:#}"); + std::process::exit(1); + } +} + +fn run() -> eyre::Result<()> { #[cfg(feature = "tracing")] set_up_tracing("dora-cli").context("failed to set up tracing subscriber")?; let args = Args::parse(); From 5068e14fb1756d5677fd2af2d49cb0b35f309070 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 19 Apr 2023 12:06:12 +0200 Subject: [PATCH 05/15] Improve error message when failing to connect to coordinator --- binaries/cli/src/up.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/cli/src/up.rs b/binaries/cli/src/up.rs index 499cf8b2..7d551a74 100644 --- a/binaries/cli/src/up.rs +++ b/binaries/cli/src/up.rs @@ -49,7 +49,7 @@ pub(crate) fn destroy(config_path: Option<&Path>) -> Result<(), eyre::ErrReport> println!("Send destroy command to dora-coordinator"); } Err(_) => { - eprintln!("The dora-coordinator does not seem to be running"); + eprintln!("Could not connect to dora-coordinator"); } } From c2feb451a0784119563925bdf7488aa4f3c742f5 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 24 Apr 2023 16:30:12 +0800 Subject: [PATCH 06/15] Add a support matrix with planned feature to clarify dora status --- .github/workflows/ci.yml | 2 +- .github/workflows/pip-release.yml | 2 +- README.md | 43 ++++++++++++++++++++++++++----- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b34cb7e..d2497538 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: name: "CLI Test" strategy: matrix: - platform: [ubuntu-latest, macos-latest] + platform: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/pip-release.yml b/.github/workflows/pip-release.yml index 35879de0..314b5de1 100644 --- a/.github/workflows/pip-release.yml +++ b/.github/workflows/pip-release.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - platform: [ubuntu-latest, ubuntu-20.04] + platform: [ubuntu-latest, ubuntu-20.04, macos-latest, windows-latest] python-version: ["3.7"] fail-fast: false runs-on: ${{ matrix.platform }} diff --git a/README.md b/README.md index 550e453f..1e746d43 100644 --- a/README.md +++ b/README.md @@ -119,22 +119,53 @@ nodes: Composability as: - [x] `YAML` declarative programming -- [x] polyglot: - - [x] Rust - - [x] C - - [x] C++ - - [x] Python - [x] Isolated operators and custom nodes that can be reused. Low latency as: - [x] written in ...Cough...blazingly fast ...Cough... Rust. - [x] PubSub communication with shared memory! -- [ ] Zero-copy on read! +- [x] Zero-copy! Distributed as: - [ ] PubSub communication between machines with [`zenoh`](https://github.com/eclipse-zenoh/zenoh) - [x] Distributed telemetry with [`opentelemetry`](https://github.com/open-telemetry/opentelemetry-rust) +## Support matrix + +### Programming Language API: + +- [x] Rust +- [x] Python +- [x] C +- [x] C++ +- [ ] WebAssembly (Wished for) + +### OS: +- [x] Linux Ubuntu (tested) +- [x] MacOS (tested) +- [x] Windows (tested) + +> Although, MacOS and Windows has a low priority for us now. + +### Platform: +- [x] x86 (tested) + +> Other platforms should also work althougth we haven't tested them yet. + +### Data Format +- [x] Bytes +- [x] Arrow Array (Uint8) +- [ ] Arrow Array (Uint16, Int32, ...) (Planned feature) +- [ ] Arrow Map (Wished feature) + +### Local Communication +- [x] TCP +- [x] Shared Memory + +### Remote Communication +- [x] TCP +- [ ] Zenoh + --- From a8ac15b272636f87f5038e82c7fd21c9dc482aec Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 24 Apr 2023 17:06:04 +0800 Subject: [PATCH 07/15] Add automatic issue labeler to organize opened issues This PR is based on Github Regex labeler https://github.com/marketplace/actions/regex-issue-labeler?version=v3.1 and use a configuration file to set label to issues. I want to organize issues based on which part of dora they affect. --- .github/labeler.yml | 43 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 15 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..11cf06c6 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,43 @@ +# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' +critical: + - '(critical|urgent)' + +cli: + - 'cli' + +daemon: + - 'daemon' + +coordinator: + - 'coordinator' + +runtime: + - 'runtime' + +python: + - 'python' + +c: + - 'c' + +c++: + - '(c++/cxx)' + +rust: + - 'rust' + +windows: + - 'windows' + +macos: + - 'macos' + +linux: + - '(linux|ubuntu)' + +bug: + - 'bug' + +documentation: + - '(doc|documentation)' + \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..a3b53ebf --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,15 @@ +name: "Issue Labeler" +on: + issues: + types: [opened, edited] + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v3.1 #May not be the latest version + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + enable-versioned-regex: 0 + include-title: 1 From bfda1fe22c316d69707409a502e171566a1734bc Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Tue, 25 Apr 2023 10:29:25 +0800 Subject: [PATCH 08/15] Add precision that arrow array is only for python for now --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e746d43..d2278715 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ nodes: Composability as: - [x] `YAML` declarative programming - [x] Isolated operators and custom nodes that can be reused. +- [x] Hot Reloading for Python Operators Low latency as: - [x] written in ...Cough...blazingly fast ...Cough... Rust. @@ -154,7 +155,7 @@ Distributed as: ### Data Format - [x] Bytes -- [x] Arrow Array (Uint8) +- [x] Arrow Array (Uint8) for Python - [ ] Arrow Array (Uint16, Int32, ...) (Planned feature) - [ ] Arrow Map (Wished feature) From ed5d559b99afcc5caedd677f2f24ade7890ded3e Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Wed, 26 Apr 2023 15:26:50 +0800 Subject: [PATCH 09/15] Add arm family into planned feature as it is a common robotic architecture --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d2278715..f48398cd 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ Distributed as: ### Platform: - [x] x86 (tested) +- [ ] aarch64 > Other platforms should also work althougth we haven't tested them yet. From d4b3468d454f9d1138f1a656ae29cf7bf3e2c588 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Wed, 26 Apr 2023 21:07:40 +0800 Subject: [PATCH 10/15] Filter default log level at `warn` for `tokio::tracing` --- libraries/extensions/telemetry/tracing/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/extensions/telemetry/tracing/src/lib.rs b/libraries/extensions/telemetry/tracing/src/lib.rs index 4d069e55..75c10783 100644 --- a/libraries/extensions/telemetry/tracing/src/lib.rs +++ b/libraries/extensions/telemetry/tracing/src/lib.rs @@ -4,6 +4,7 @@ //! able to serialize and deserialize context that has been sent via the middleware. use eyre::Context as EyreContext; +use tracing::metadata::LevelFilter; use tracing_subscriber::{prelude::__tracing_subscriber_SubscriberExt, EnvFilter, Layer}; use eyre::ContextCompat; @@ -12,7 +13,7 @@ pub mod telemetry; pub fn set_up_tracing(name: &str) -> eyre::Result<()> { // Filter log using `RUST_LOG`. More useful for CLI. - let filter = EnvFilter::from_default_env(); + let filter = EnvFilter::from_default_env().add_directive(LevelFilter::WARN.into()); let stdout_log = tracing_subscriber::fmt::layer() .pretty() .with_filter(filter); From fc24a4241ee1f541d27ff88cf0f34c93b6b1fef1 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Thu, 27 Apr 2023 13:30:02 +0800 Subject: [PATCH 11/15] Add case insentivity and isolate c in regex --- .github/labeler.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 11cf06c6..4816d38d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,43 +1,42 @@ # Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' critical: - - '(critical|urgent)' + - "(critical|urgent)" cli: - - 'cli' + - "/(cli|command)/i" daemon: - - 'daemon' + - "daemon" coordinator: - - 'coordinator' + - "coordinator" runtime: - - 'runtime' + - "runtime" python: - - 'python' + - "python" c: - - 'c' + - "/\bc\b/i" c++: - - '(c++/cxx)' + - "/(c++/cxx)/i" rust: - - 'rust' + - "rust" windows: - - 'windows' + - "windows" macos: - - 'macos' + - "macos" linux: - - '(linux|ubuntu)' + - "(linux|ubuntu)" bug: - - 'bug' + - "bug" documentation: - - '(doc|documentation)' - \ No newline at end of file + - "(doc|documentation)" From e0729e3423335ac4fab60c677290fe73be2e4704 Mon Sep 17 00:00:00 2001 From: Haixuan Xavier Tao Date: Thu, 27 Apr 2023 15:44:22 +0800 Subject: [PATCH 12/15] Update labeler.yml Fix typo --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 4816d38d..96a93328 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -21,7 +21,7 @@ c: - "/\bc\b/i" c++: - - "/(c++/cxx)/i" + - "/(c++|cxx)/i" rust: - "rust" From 3c46c256f16506d9fddf0ec37721843976bd1bff Mon Sep 17 00:00:00 2001 From: Haixuan Xavier Tao Date: Thu, 27 Apr 2023 15:52:21 +0800 Subject: [PATCH 13/15] Change `c++` to `c\+\+` as + is a special character --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 96a93328..332192be 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -21,7 +21,7 @@ c: - "/\bc\b/i" c++: - - "/(c++|cxx)/i" + - "/(c\+\+|cxx)/i" rust: - "rust" From 6c9a41cb17d31f93885b369ab16e6e01b2492245 Mon Sep 17 00:00:00 2001 From: Haixuan Xavier Tao Date: Thu, 27 Apr 2023 16:08:25 +0800 Subject: [PATCH 14/15] Remove `\+` as it seems to be a YAML escape sequence --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 332192be..8cb24d34 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -21,7 +21,7 @@ c: - "/\bc\b/i" c++: - - "/(c\+\+|cxx)/i" + - "cxx" rust: - "rust" From be8b6904bd80eb521ba9da96c2e2ce526cbcf132 Mon Sep 17 00:00:00 2001 From: Haixuan Xavier Tao Date: Thu, 27 Apr 2023 16:47:58 +0800 Subject: [PATCH 15/15] Use default github token --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a3b53ebf..1fe3e190 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: github/issue-labeler@v3.1 #May not be the latest version with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + repo-token: "${{ github.token }}" configuration-path: .github/labeler.yml enable-versioned-regex: 0 include-title: 1