-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge standalone-binaries
to the main CLI
#259
Conversation
rust-toolchain.toml
Outdated
@@ -1,2 +1,2 @@ | |||
[toolchain] | |||
channel = "1.72.1" | |||
channel = "1.75" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small comment on this: the version of the Rust toolchain is linked to the version of Zenoh. The reason being that Zenoh-Flow can be compiled to a Zenoh plugin and, in order for Zenoh to load the plugin, it needs to have been compiled with the same version of Rust.
Hence, if you want to tackle this part, I'd suggest to make a separate PR that does both: bump Zenoh to version 1.0.x and update the toolchain to 1.75 😉
(I did not look closely at the rest of your PR as you marked it as a draft)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thx! Yeah bumping Zenoh was also in my mind, I should definitely separate it in two PR.
@Hennzau In order to accept your contribution, you need to create an account -- with the same e-mail address associated to your GitHub account (this is how Eclipse validates the contributions) -- on the Eclipse Foundation website and then sign the ECA. 😉 |
standalone
binaries to the main CLIstandalone
binaries to the main CLI
c1b4e43
to
29ca3ef
Compare
Thanks for the contribution @Hennzau! I am currently traveling so I will be able to look at it thoroughly starting next week. There is however one aspect that caught my attention, you say:
That is an odd behavior that I am unable to reproduce. I tried on my machine and that of a colleague and we both obtained the expected result. |
Oh wait... I just realized I got the command wrong! I was actually referring to the |
zfctl/src/instance_command.rs
Outdated
InstancesQuery::List => { | ||
let mut table = Table::new(); | ||
table.set_width(80); | ||
table.set_header(row!("Instance Name", "Instance ID", "Instance State")); | ||
|
||
while let Ok(response) = reply.recv_async().await { | ||
match response.sample { | ||
Ok(sample) => { | ||
match serde_json::from_slice::< | ||
HashMap<InstanceId, (Arc<str>, InstanceState)>, | ||
>(&sample.value.payload.contiguous()) | ||
{ | ||
Ok(list) => { | ||
for (id, (name, state)) in list { | ||
table.add_row(row!(name, id, state)); | ||
} | ||
} | ||
Err(e) => tracing::error!( | ||
"Failed to parse 'list' reply from < {} >: {:?}", | ||
response.replier_id, | ||
e | ||
), | ||
} | ||
} | ||
Err(err) => tracing::error!("{:?}", err), | ||
} | ||
} | ||
|
||
println!("{table}"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the code I added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, thanks for your contribution @Hennzau 🙂
Your PR is, in this state, doing multiple things at the same time and it is not making it easy to follow (it's not unreadable at all, simply not as easy as it could be).
Hence, I would like you to reduce the scope to what the title of your PR says: simply merging the standalone binaries in zfctl
.
I am not against changing the name and functionality of some of the commands but it would be better if it was done in a separate PR: that way we can discuss the changes.
For instance, I don't think the run
in zfctl daemon run
is the best verb. Something like spawn
or start
is more commonly used in similar contexts — e.g. you do systemctl start <service>
to run a background daemon/service.
Similarly, maybe we could use zfctl run-local <dataflow.yaml>
for the standalone runtime and zfctl instance deploy <dataflow.yaml>
+ zfctl instance start <uuid>
for the distributed version.
The addition of the instance list
is indeed welcomed!
Other than that I have no comment on the code itself. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have an example that does exactly this in the Zenoh repository (here). Given that you are inclined to add this, maybe more specific instructions are required in the README?
Hi! Thank you very much, I understood everything! I’ll clarify all of this. |
standalone
binaries to the main CLIstandalone-binaries
to the main CLI
It should be good now! Thx for the previous review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay.
After taking some time to play with this new version of zfctl
— having less command-line tools provides indeed a better experience — I don't think it makes sense to have zfctl runtime
+ zfctl daemon
and I would suggest to fuse them in the daemon
sub-command.
I understand this goes against my previous feedback of "just merging", so that one is on me. 😉
I can take care of it if you want.
Great! I can take care of it, but I won't have time until December 20th. So if you want this fusion done before that, you can do it; otherwise, I'll handle it :) |
I have merged it as is and I will do the changes later on. ;-) |
Merge
standalon-binaries
insidezfctl
CLIThis PR introduces improvements to the
zfctl
CLI for better usability.Daemon
The
zenoh-flow-standalone-daemon
crate has been removed and replaced by the CLI command:Runtime
The
zenoh-flow-standalone-runtime
crate has been removed and replaced by the CLI command: