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

[Feat][kubectl-plugin] Add instructions for static shell completion #2384

Conversation

MortalHappiness
Copy link
Member

@MortalHappiness MortalHappiness commented Sep 16, 2024

Why are these changes needed?

This PR updates README.md to add instruction for static shell completion for kubectl ray plugin. Static means that we haven't implemented Dynamic completion of nouns yet.

Also the default completion command in cobra is disabled because the shell completion for kubectl plugin works differently from normal commands. Therefore this command is useless. I removed it to avoid confusion. See kubernetes/kubernetes#74178 and kubernetes/kubernetes#105867 for details.

Screenshot (my shell is fish shell):

image

Related issue number

N/A

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@MortalHappiness
Copy link
Member Author

@kevin85421 @andrewsykim PTAL

@andrewsykim
Copy link
Collaborator

cc @chiayi


### Retrieve Ray Cluster Head Logs
1. Install [Krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/).
2. (TODO: Replace this step with the installation command).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we plan to add this instruction before merging this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am considering distributing our kubectl plugin with krew, but this requires we to

  1. Package our plugin and then put it on GitHub release page
  2. Open a pull request to krew index github repo

So I think it's better to merge this PR so that we can implement dynamic completion of nouns.

See https://krew.sigs.k8s.io/docs/developer-guide/distributing-with-krew/ for details.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the idea of using Krew, but until it's published we should still providing working solution here to install the plugin even if that involves manually compiling it. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is an offline slack discussion here:

https://ray.slack.com/archives/C07M825T94Z/p1726476910442009

The message is:

I just found this repository, which can automatically release our plugin to Krew. However, it relies on git release tags. Currently KubeRay is a monorepo, with all Kubernetes-related items stored in it. So, I'm thinking that the tag format might need to be something like kubectl-ray/v0.1.0, and the versioning might need to be separate from the ray-operator version. I'm just not sure if this will look odd because I noticed that the current tags match the release tags, such as ray-operator/v1.2.1 and v1.2.1. Does anyone have any thoughts on this?
https://github.com/ray-project/kuberay/tags

Copy link
Member Author

@MortalHappiness MortalHappiness Sep 16, 2024

Choose a reason for hiding this comment

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

I moved the manually installation guide to Development section. Do you think its better to rename it to "Compile from source"?

Copy link
Member Author

@MortalHappiness MortalHappiness Sep 16, 2024

Choose a reason for hiding this comment

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

Also before the PR to Krew index repo is merged, we can tell the users to install from our manifest file like this:

kubectl krew install --manifest-url <url>

But we still need to package the binary and put it on GitHub release page.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I moved the manually installation guide to Development section. Do you think its better to rename it to "Compile from source"?

I think it should still be at the top under "Installation" until the installation with krew is simpler.

Also, once we have a released binary of the we should also provide installation steps without krew:

curl -LO <binary-releases-url>
mv ./kubectl-ray $GOBIN 

Or something like that

Copy link
Member Author

Choose a reason for hiding this comment

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

Make senses to me. Updated.

Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
Copy link
Collaborator

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

LGTM

Aliases:
log, logs
1. Install [Krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/).
2. (TODO: Replace this step with the installation command).
Copy link
Collaborator

Choose a reason for hiding this comment

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

To clarify, this TODO will be blocked until we release KubeRay v1.3 which includes the binray release of the plugin right?

Copy link
Member Author

@MortalHappiness MortalHappiness Sep 16, 2024

Choose a reason for hiding this comment

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

I mentioned a discussion above here

#2384 (comment)

I don't know whether we want to use the same version for ray-operator and kubectl-plugin or not. If we want to use different versioning for them, then this will block untill to kubectl-plugin v0.1.0 release. If we want to use the same version, then yes, this will block until the release of KubeRay v1.3.0.

cc @kevin85421

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah gotcha, that makes sense to me

Copy link
Collaborator

Choose a reason for hiding this comment

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

Personally I think we should keep the releases together but I'm also fine to do it separately. Will defer to you and @chiayi

Copy link
Member

Choose a reason for hiding this comment

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

Personally I think we should keep the releases together but I'm also fine to do it separately.

I also prefer to keep the releases together to simplify the release process, unless there is a strong benefit to separating them.

@kevin85421 kevin85421 merged commit 800ac16 into ray-project:master Sep 17, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants