Skip to content
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

CELEBORN-1689: CLI Support for Ratis APIs #2882

Closed
wants to merge 5 commits into from

Conversation

akpatnam25
Copy link
Contributor

@akpatnam25 akpatnam25 commented Nov 5, 2024

What changes were proposed in this pull request?

Add CLI support for Ratis REST APIs that were recently added in https://issues.apache.org/jira/browse/CELEBORN-1628
Leaving out local raft meta conf APIs for no since those are not as straightforward. Will update those in another PR.

Why are the changes needed?

better ops since with REST API and CLI there is no need to log onto production hosts to manage ratis operations.

Does this PR introduce any user-facing change?

No

How was this patch tested?

added unit tests

@SteNicholas
Copy link
Member

@akpatnam25, why not directly use ratis shell of ratis? The REST API of ratis is same as the ratis shell.

@akpatnam25
Copy link
Contributor Author

@akpatnam25, why not directly use ratis shell of ratis? The REST API of ratis is same as the ratis shell.

To use ratis shell, you need to be on the host itself, and also have access to the distribution to run it. I think in most production deployments, it is not convenient (and sometimes not even possible) to access the host and run it within the host. I think from operational point of view, it is better to use the REST API via the CLI since it can be accessed from anywhere outside host. Let me know what you think :) @SteNicholas

@SteNicholas
Copy link
Member

@akpatnam25, we would use ratis-shell in master node for our production pratice. Meanwhile, CLI does not depend on the REST API, otherwise why not directly invoke the REST API?

@akpatnam25
Copy link
Contributor Author

akpatnam25 commented Nov 6, 2024

@akpatnam25, we would use ratis-shell in master node for our production pratice. Meanwhile, CLI does not depend on the REST API, otherwise why not directly invoke the REST API?

@SteNicholas CLI does depend on REST Api. It calls the REST api. Not all users would have access to their production host, and would only have access to REST api (CLI).

@akpatnam25 akpatnam25 marked this pull request as ready for review November 6, 2024 23:19
@akpatnam25
Copy link
Contributor Author

cc @FMX

@akpatnam25
Copy link
Contributor Author

cc @turboFei

@SteNicholas
Copy link
Member

SteNicholas commented Nov 7, 2024

@akpatnam25, we would use ratis-shell in master node for our production pratice. Meanwhile, CLI does not depend on the REST API, otherwise why not directly invoke the REST API?

@SteNicholas CLI does depend on REST Api. It calls the REST api. Not all users would have access to their production host, and would only have access to REST api (CLI).

@akpatnam25, how does the users choose ratis-shell or this CLI? Meanwhile, not all users would have access to REST API, because CLI needs users to provide the host and port via --hostport. If we support this CLI, we should deprecate ratis-shell, unless we can ensure that the behavior of the two is consistent. Otherwise, the user may get the different behaviour using both ratis-shell and ratis cli.
BTW, is the current CLI positioning to have corresponding commands for all Rest APIs?

@akpatnam25
Copy link
Contributor Author

@SteNicholas I think for the ratis API it makes sense to have cli support for them and we can deprecate the ratis-shell if that is ok with the community later on. We don’t need to support for all rest api’s but I think this one is especially important given the only other way to do it is to log onto a production host. We do not need cli support for every single rest api, just the main ones that help with operational management. Let me know :) thanks.

@@ -1,40 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are not needed.

@@ -120,4 +120,46 @@ final class MasterOptions {
names = Array("--delete-apps"),
description = Array("Delete resource of an application."))
private[master] var deleteApps: Boolean = _

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two more commands to implement.

  • show raft group info
  • print local raft meta conf

captureOutputAndValidateResponse(
args,
"",
"org.apache.celeborn.service.deploy.master.clustermeta.SingleMasterMetaManager" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is invlid. You can setup a minu cluster to test ratis cluster.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can refer to MiniClusterFeature.

private[master] var setRatisPeersPriorities: Boolean = _

@Option(
names = Array("--create-snapshot"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about using similar command names?

image
--election-transfer
--election-step-down
--election-pause
--election-resume

--peer-add
--peer-remove
--peer-set-priority

--snapshot-create

--local-raft-conf

@akpatnam25
Copy link
Contributor Author

spoke more with @SteNicholas - given that ratis shell is the source of truth, we can just keep it like that. We would not need CLI support for these. Closing out this PR. thanks for the feedback to everyone

@akpatnam25 akpatnam25 closed this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants