fluvio icon indicating copy to clipboard operation
fluvio copied to clipboard

No command help for `fluvio cloud` in latest channel

Open ajhunyady opened this issue 2 years ago • 2 comments

CLI for cloud is critical for discovering available commands.

% fluvio cloud -h
Unable to find plugin 'fluvio-cloud'. Make sure it is installed in "/Users/aj/.fluvio/extensions-latest".

I wanted to run logs command, but I don't remember the keywords, and the command is not yet documented. From user perspective, without command help, they will not know this command exists.

ajhunyady avatar Aug 10 '22 05:08 ajhunyady

Could you switch back to stable channel and try again?

I think that the issue here is that the plugins are not working as expected when we are using a different channel

morenol avatar Aug 10 '22 13:08 morenol

@morenol that worked!

Can we also fix:

fluvio version -h
fluvio-stable-version 
Print Fluvio version information

USAGE:
    fluvio-stable version

OPTIONS:
    -h, --help    Print help information

It doesn't show switch

ajhunyady avatar Aug 10 '22 13:08 ajhunyady

This is not a bug, it is working as intended. The core issue is that extensions don't get automatically installed when you switch channels.

The only time extensions are installed are at

  • Install time via install.sh, where we install fluvio-cloud and fluvio-run (The "official" way)

    • https://github.com/infinyon/fluvio/blob/b8967fc44dbaa8ff9a103d9edfabd715bd9940ed/install.sh#L599-L605
  • Manually, by running fluvio install <extension name>

tjtelan avatar Aug 12 '22 02:08 tjtelan

Since cloud is installed by default on stable, I would expect the command completion to be installed automatically. That doesn't seem to be the case.

ajhunyady avatar Aug 12 '22 04:08 ajhunyady

There's a few semantic misunderstandings here with respect to channels, installation. I think with this additional context makes a case that your expectations are a little impractical.

But first, a very minor clarification that overall, is not critically relevant for this conversation.

You're actually referring to CLI help docs, not command completion (e.g. fluvio completions). The main point being the difference of activity for learning the subcommands and option flags. Tab complete vs reading help docs.

Anyway...


fluvio and fluvio-cloud are completely separate CLI. They are maintained in separate code repos (that is, Cloud is not in this repo) Cloud is installed separately.

Only after the "installation script" downloads and installs fluvio-cloud, does it appear to be part of fluvio as a subcommand. Otherwise, the main fluvio CLI has very little knowledge of cloud.


The channels feature is only an abstraction for switching between the build artifacts produced by CI, so we don't have to ask users to compile code. The latest channel is intended for developers, CI, or for devs collaborating with users to test fixes between releases.

It's not intended for daily use. This is reinforced by how channels keeps separate extensions between stable vs latest.

~/.fluvio/channel example config

current_channel = "latest"
[channel.latest]
binary_location = "/home/telant/.fluvio/bin/fluvio-latest"
extensions = "/home/telant/.fluvio/extensions-latest"
image_tag_strategy = "VersionGit"

[channel.stable]
binary_location = "/home/telant/.fluvio/bin/fluvio-stable"
extensions = "/home/telant/.fluvio/extensions"
image_tag_strategy = "Version"

tjtelan avatar Aug 12 '22 15:08 tjtelan

Yes, I was referring to command help. The issue I was facing is that fluvio cloud was actually working, but it was not visible in fluvio -h subtree.

ajhunyady avatar Aug 12 '22 15:08 ajhunyady

The problem cleared-up after I re-installed fluvio cloud. So, the question I have is:

  • on a fresh install by a new fluvio user, does cloud show up in fluvio -h ?

If the answer is yes, I agree that this is not a bug and my issue may have been due to updating rather than installing.

ajhunyady avatar Aug 12 '22 16:08 ajhunyady

* on a fresh install by a new fluvio user, does `cloud` show up in `fluvio -h` ?

Yes, it does


Here's a quick test in a docker container

A quick verification that fluvio isn't installed

root@e11ea0746ade:/# fluvio
bash: fluvio: command not found

Installation

root@e11ea0746ade:/# curl -fsS https://packages.fluvio.io/v1/install.sh | bash
fluvio: ⏳ Downloading Fluvio 0.9.33 for x86_64-unknown-linux-musl...
fluvio: ⬇️  Downloaded Fluvio, installing...
fluvio: ✅ Successfully installed /root/.fluvio/bin/fluvio-stable
fluvio: ⏳ Downloading Fluvio channel frontend 0.9.33 for x86_64-unknown-linux-musl...
fluvio: ✅ Successfully installed /root/.fluvio/bin/fluvio
fluvio: ☁️ Installing Fluvio Cloud...
Current channel: stable
fluvio: 🎣 Fetching latest version for package: fluvio/fluvio-cloud...
fluvio: ⏳ Downloading package with latest version: fluvio/fluvio-cloud:0.1.8...
fluvio: 🔑 Downloaded and verified package file
fluvio: ☁️ Installing Fluvio Runner...
Current channel: stable
fluvio: ⏳ Downloading package with provided version: fluvio/fluvio-run:stable...
fluvio: 🔑 Downloaded and verified package file
fluvio: 🎉 Install complete!
fluvio: 💡 You'll need to add '~/.fluvio/bin/' to your PATH variable
fluvio:     You can run the following to set your PATH on shell startup:
fluvio:       echo 'export PATH="${HOME}/.fluvio/bin:${PATH}"' >> ~/.bashrc

Help docs

root@e11ea0746ade:/# ~/.fluvio/bin/fluvio -h
Fluvio Command Line Interface

fluvio-cli [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -c, --cluster <host:port>          Address of cluster
        --tls                          Enable TLS
        --enable-client-cert           TLS: use client cert
        --domain <DOMAIN>              Required if client cert is used
        --ca-cert <CA_CERT>            Path to TLS ca cert, required when client cert is enabled
        --client-cert <CLIENT_CERT>    Path to TLS client certificate
        --client-key <CLIENT_KEY>      Path to TLS client private key
    -P, --profile <profile>
    -h, --help                         Print help information

SUBCOMMANDS:
    consume           Read messages from a topic/partition
    produce           Write messages to a topic/partition
    topic             Manage and view Topics
    partition         Manage and view Partitions
    smart-module      Create and manage SmartModules [aliases: sm]
    table-format      Create a TableFormat display specification [aliases: tf]
    derived-stream    Create and manage DerivedStreams [aliases: ds]
    profile           Manage Profiles, which describe linked clusters
    cluster           Install or uninstall Fluvio cluster
    install           Install Fluvio plugins
    update            Update the Fluvio CLI
    version           Print Fluvio version information
    completions       Generate command-line completions for Fluvio
    connector         Create and work with Managed Connectors
    cloud             Cloud Operations
    run               Run Fluvio cluster components (SC and SPU)
    help              Print this message or the help of the given subcommand(s)

tjtelan avatar Aug 12 '22 16:08 tjtelan

Ok, closing.

ajhunyady avatar Aug 12 '22 16:08 ajhunyady