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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fetching plugin dependencies #950

Merged
merged 4 commits into from
Jan 24, 2023

Conversation

pkosiec
Copy link
Member

@pkosiec pkosiec commented Jan 23, 2023

Description

Changes proposed in this pull request:

  • Support fetching plugin dependencies
    • Download plugins and its dependencies with go-getter
    • Pass PLUGIN_DEPENDENCY_DIR env variable to the plugins to use fetched dependencies
  • Fix plugin index validation
  • Fix inconsistencies in gRPC API field naming

Testing

No need to test it manually - the current integration tests prove the functionality works as expected. Helm binary is no longer there in the Botkube Docker image, but the integration tests still pass.

However, if you'd like to, then follow the tutorial here: https://docs.botkube.io/plugin/local-testing

I used the following file as the /tmp/config-values.yaml:

plugins:
  repositories:
    botkube:
      url: http://localhost:8080/plugins-index.yaml

communications:
  "default-group":
    socketSlack:
      enabled: true
      appToken: "xapp-..."
      botToken: "xoxb-..."
      notification:
        type: "short"
      channels:
        "default":
          name: botkube-demo
          bindings:
            executors:

              - helm
            sources: []

executors:
  helm:
    botkube/helm:
      config:
        helmCacheDir: /tmp/helm/.cache
        helmConfigDir: /tmp/helm/
        helmDriver: secret
      enabled: true

In botkube repo, run:

npx serve --listen 8080

Then in a new terminal run:

export BOTKUBE_SETTINGS_LOG_LEVEL=info
export BOTKUBE_PLUGINS_CACHE__DIR="/tmp/plugins"
export BOTKUBE_CONFIG_PATHS="$(pwd)/resource_config.yaml,/tmp/config-values.yaml"
PLUGIN_DOWNLOAD_URL_BASE_PATH="http://localhost:8080/plugin-dist" make gen-plugins-index; rm -rf /tmp/plugins; go run cmd/botkube/main.go

I hope you have different Helm version installed on your system - if not, upgrade it locally to anything different than v3.6.3 (e.g. 3.10+) 馃槃
Once Botkube is run, run @Botkube helm version on the botkube-demo channel to see the Helm version used. The output should be equal to:

image

Related PRs:

kubeshop/botkube-docs#203

Related issue(s)

#899

@pkosiec pkosiec added the enhancement New feature or request label Jan 23, 2023
@pkosiec pkosiec requested a review from mszostok January 23, 2023 16:26
@pkosiec pkosiec marked this pull request as ready for review January 23, 2023 16:27
@pkosiec pkosiec requested review from a team and PrasadG193 as code owners January 23, 2023 16:27
Copy link
Contributor

@mszostok mszostok left a comment

Choose a reason for hiding this comment

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

I have only minor comments, overall it LGTM

internal/plugin/index.go Outdated Show resolved Hide resolved
internal/plugin/index_test.go Outdated Show resolved Hide resolved
pkg/api/plugin.go Outdated Show resolved Hide resolved
proto/source.proto Outdated Show resolved Hide resolved
internal/plugin/manager.go Outdated Show resolved Hide resolved
@pkosiec pkosiec merged commit 94702cf into kubeshop:main Jan 24, 2023
@pkosiec pkosiec deleted the plugin-deps-management branch January 24, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants