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

Connectors CLI tool #1616

Merged
merged 34 commits into from
Nov 29, 2023
Merged

Connectors CLI tool #1616

merged 34 commits into from
Nov 29, 2023

Conversation

vidok
Copy link
Contributor

@vidok vidok commented Sep 11, 2023

Part of https://github.com/elastic/enterprise-search-team/issues/6245

This PR will introduce a new connector CLI.

Motivation

This tool aims to streamline data management processes, providing engineers with a faster and more efficient way to work with Connectors and Search indices, ultimately enhancing their productivity and workflow.

Usage

Installation

Before you start using you need to regenerate scripts by running make clean install

Print help page

Run ./bin/connectors --help to get detailed information about the tool.

Usage: connectors [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --version          Show the version and exit.
  -c, --config FILENAME
  --help                 Show this message and exit.

Commands:
  connector  Connectors management
  index      Search indices management
  job        Sync jobs management
  login      Authenticate Connectors CLI with an Elasticsearch instance

You can also print a help page for specific commands e.g. ./bin/connectors job --help

Connecting to an Elasticsearch instance

To start using the tool you need to authenticate with your Elasticsearch instance. Run ./bin/connector login and provide credentials. The result of the successful command is a file in .ci/config.yml. It's up to you where to store this file, however, you need to specify it using ./bin/connectors -c path_to_your_configuration command.

Known limitations

  • Supports only connectors-clients
  • Does not support API keys for authentication
  • Does not support all Kibana UI functionality

Checklists

Pre-Review Checklist

  • this PR has a meaningful title
  • this PR links to all relevant github issues that it fixes or partially addresses
  • if there is no GH issue, please create it. Each PR should have a link to an issue
  • this PR has a thorough description
  • Covered the changes with automated tests
  • Tested the changes locally
  • Added a label for each target release version (example: v7.13.2, v7.14.0, v8.0.0)
  • Considered corresponding documentation changes
  • Contributed any configuration settings changes to the configuration reference

Changes Requiring Extra Attention

  • Security-related changes (encryption, TLS, SSRF, etc)
  • New external service dependencies added.

Release Note

We have added a new Connectors CLI (technical preview). The CLI is designed to streamline and automate the management of Elastic Connectors. You can use it for scripting and automation in your own infrastructure as it can connect to any Elasticsearch instance.

Known limitations:

  • Does not support API keys for authentication
  • Does not support sync job scheduling configuration

@vidok vidok force-pushed the dmitrii/5185-connectors-clients-serverless branch 2 times, most recently from 291bf9c to d20917f Compare September 18, 2023 14:59
@vidok vidok force-pushed the dmitrii/5185-connectors-clients-serverless branch 2 times, most recently from 1884956 to 4f5f278 Compare October 18, 2023 10:04
@vidok vidok force-pushed the dmitrii/5185-connectors-clients-serverless branch from 8af68aa to 8092e82 Compare November 21, 2023 12:44
@vidok vidok self-assigned this Nov 23, 2023
@vidok vidok marked this pull request as ready for review November 24, 2023 11:07
@vidok vidok requested a review from a team November 24, 2023 11:07
@artem-shelkovnikov
Copy link
Member

CI seems to be red due to failing tests :/

I'll start the review of actual code, cause it seems like a problem in tests, but won't put approval cause it'll be dismissed anyway for now :)

Copy link
Member

@artem-shelkovnikov artem-shelkovnikov left a comment

Choose a reason for hiding this comment

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

Amazing PR! I left a couple questions/nits/suggestions, but I love the direction of it and what it allows us to do

connectors/cli/connector.py Outdated Show resolved Hide resolved
connectors/cli/connector.py Show resolved Hide resolved
connectors/cli/connector.py Outdated Show resolved Hide resolved
connectors/cli/connector.py Outdated Show resolved Hide resolved
connectors/cli/index.py Outdated Show resolved Hide resolved
connectors/connectors_cli.py Show resolved Hide resolved
connectors/connectors_cli.py Show resolved Hide resolved
connectors/es/client.py Show resolved Hide resolved
connectors/es/client.py Outdated Show resolved Hide resolved
tests/test_cli.py Show resolved Hide resolved
Copy link
Contributor

@navarone-feekery navarone-feekery left a comment

Choose a reason for hiding this comment

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

🔥

connectors/cli/connector.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@vidok vidok force-pushed the dmitrii/5185-connectors-clients-serverless branch from 3cf7087 to b1ecb79 Compare November 28, 2023 18:06
@vidok vidok requested a review from tutelaris November 29, 2023 10:42
@tutelaris tutelaris removed their assignment Nov 29, 2023
@tutelaris tutelaris removed their request for review November 29, 2023 10:43
@vidok vidok merged commit d1d7f9a into main Nov 29, 2023
1 check passed
@vidok vidok deleted the dmitrii/5185-connectors-clients-serverless branch November 29, 2023 12:04
Copy link

💔 Failed to create backport PR(s)

The backport operation could not be completed due to the following error:
There are no branches to backport to. Aborting.

The backport PRs will be merged automatically after passing CI.

To backport manually run:
backport --pr 1616 --autoMerge --autoMergeMethod squash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants