Replies: 3 comments 8 replies
-
Overall really useful commands @raulb ! The ones that just read from the setup are the most useful to me. I can always edit the pipeline configuration myself, but it is veeery useful to easily see what does conduit understand about the configuration that I've written into it, how many connectors are available, have I installed them correctly, etc. |
Beta Was this translation helpful? Give feedback.
-
Seems comprehensive with ease of use in mind. It would be a nice to have to mark the commands that are interactive and the ones that require no further input. |
Beta Was this translation helpful? Give feedback.
-
I would also love to see this. It would make it easier to configure, deploy and interact with Conduit. Moreover, having cli commands available would make it easier for other tools (or even just bash scripts) to interact with Conduit via executing cli commands, rather than using the http api. For example, I just learned of this tool, which might be useful to replace and augment the deprecated web UI https://github.com/dagu-org/dagu, and it appears to just run cli commands @gedw99 do you have any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
Goal
Conduit Binary offers a variety of configuration options necessary for setting up your streaming service with Conduit. These meticulously designed flags are tailored to streamline the service's functionality:
While these flags serve specific purposes for running the service, they assume an already familiarized user with steps to have a pipeline(s) successfully configured. This setting up process requires prior knowledge of the following elements:
What I’m proposing here is adding additional commands to extend a Conduit CLI to support those needs.
All commands, even when presenting potential interactivity, should be able to run via arguments and never require a prompt. For more information, see the CLIG guidelines on arguments and flags.
Assumptions
connectors
alias toconnector
. So they’ll be used interchangeably.pipeline restart
,pipeline stop
. Once a pipeline is running, the way to interrupt the processing will be the same as up until now.--pipeline
flag will be optional and it’ll use the only pipeline.Step 0.
In order to accommodate new commands, I’d suggest moving existing root configuration options under
start
. To maintain backwards compatibility, these options will remain available on root, but will be hidden when typingconduit --help
.conduit start
start
.conduit --help
will show only the commands added to root.conduit help COMMAND
as it’s usual on CLIs.Step 1. Getting started commands
When installing the binary for the first time, as a user, I’d like to have commands to help me getting started. Instructions we could refer to from our documentation for easy access.
Initializing a new pipeline:
init
This command will initialize a simple pipeline that shows some basic features of Conduit. One example pipeline could be
generator
as a source andlog
as a destination (simplest setup, not requiring a provisioned resource).The idea is that right after
conduit init
a user could simply doconduit run
to show how Conduit works.Additionally, this command could include a dialog in which we could present some example pipelines so anyone could use (postgres to log, etc...). This would require including some Docker images for easier installation.
Running the conduit service
conduit start
If we wanted to introduce commands such as
stop
, orrestart
, thisstart
command should return an ID that could be used to later be referenced. However, this discussion post is making the assumption that the CLI will run alongside existing Conduit binary.Step 2. Extensibility
Installing a new pipeline
pipelines install [--url] [--path]
This command will browse through the existing pipelines examples created in a specific repository for this purpose when
--url
is not provided. Specifying a pipeline that contains standalone connectors or processors will automatically add them.When a url wasn’t specified, and optionally, to make the experience a bit less overwhelming, we could have a curated list on top and then others in case the user would like to explore more.
Edit a pipeline
pipeline edit NAME [--path]
This command would open the
$EDITOR
to edit the associated pipeline configuration file.Listing available pipelines
pipelines ls [--path]
It’ll list the registered pipelines in
--path
(or/pipelines
as default).Removing a pipeline
pipeline remove [--force]
This will require either deleting the
yml
file completely (in the event of this one having only one pipeline) or deleting just the pipeline that’s contained in that file.Describe a pipeline
pipeline describe
Describes a pipeline showing name, connectors, and processors.
Installing a new connector
connector install [--url]
This command will install any standalone connectors available via ConduitIO Labs and will add it the
connectors
directory by default or to--path
when specified via that flag. If--url
is not provided, it’ll browse through a list of available connectors to be selected, and then installed.$ conduit connectors install [--url] [--path] $ conduit connectors install --url https://github.com/conduitio-labs/conduit-connector-mongo Installing conduit-connector-mongo connector... Done!
Once installed, it’ll be available to use by any pipeline afterwards via
connector add NAME --pipeline NAME
.Uninstall a connector
connector uninstall NAME [--path]
This command will remove the specified standalone connector. If it’s used by a pipeline will require confirmation. The
--confirm
flag can be used to bypass the confirmation warning.Listing available connectors
connectors ls
The ones that could be used locally (builtin + standalone). This list will indicate in what pipelines are being used (if they are). The idea of this command is to illustrate what connectors are already available if they were configured in a pipeline. This list would indicate how to reference the connector to make it easier.
Describe a connector:
connectors describe NAME
This command could be used to describe the configuration needed, and if it’s used by a pipeline.
Add a connector to a pipeline
connectors add NAME --pipeline P-NAME --source | --destination
Once a connector has been installed, it’ll be ready to be used. If a user attempts to add a connector that’s not available yet, it’ll prompt to install it first. Adding will require configuration parameters that will depend on each connector. These options will be added to the pipeline, but the user will need to edit the pipeline afterwards. The optional options will be added to the pipeline configuration file, but commented out.
$ conduit connectors add plugin-name@version --pipeline pipeline --source # e.g.: $ conduit connectors add postgres --pipeline my-pipeline --destination
Removing a connector
connectors remove NAME --pipeline P-NAME
This will remove the connector configuration used by the specified pipeline. It’ll check if it’s used by a pipeline and will prompt configuration ahead of time.
Init a processor
processor init [NAME] [--lang]
This will initialize a processor with the specified language (we’ll start with Go as default). Eventually, we could use the provided lang to indicate how to build one using a different language. We should have a processors template to have the same experience with pipelines and connectors. We’ll start with a simple processor such as the one in our documentation.
Listing available processors
processors ls
The ones that could be used locally (builtin + standalone ones):
Install a processor
processors install [--url]
Similarly to connectors, when
--url
is not specified, it’ll browse through a list of available standalone processors.Uninstall a processor
processors uninstall NAME [--force]
If a processor is being used by a pipeline it’ll mention it to confirm. Only standalone processors could be uninstalled.
Adding a new processor
processors add NAME --pipeline P-NAME
Will add an available processor (all builtin + any standalone that could be available) to the specified pipeline.
Removing a processor
processors remove NAME --pipeline P-NAME [--force]
Remove a processor used in a specified pipeline.
Describe a processor
processors describe PLUGIN
Show the available options for any processor that’s available (all builtin ones + the standalone that have been added).
Building a processor
processor build NAME [--path]
# GOARCH=wasm GOOS=wasip1 go build -o processor.wasm cmd/processor/main.go` $ conduit processor build NAME [--path]
Step 3. Maintenance
Check pipelines via
doctor
This will check whether there’s a more up to date version of conduit and if some connectors / processors could also be updated.
Beta Was this translation helpful? Give feedback.
All reactions