Git Product home page Git Product logo

meshery-adapter-library's Introduction

Meshery Adapter Library

The Meshery Adapter Library provides a common and consistent set of functionality that Meshery adapters use for managing the lifecycle, configuration, operation, and performance of cloud native infrastructure. See Introducing MeshKit and the Meshery Adapter Library for more.

Purpose

The main purpose of the meshery-adapter-library is to

  • provide a set of interfaces, some with default implementations, to be used and extended by adapters.
  • implement common cross cutting concerns like logging, errors, and tracing
  • provide a mini framework implementing the gRPC server that allows plugging in the mesh specific configuration and operations implemented in the adapters.

Overview and usage

The library consists of interfaces and default implementations for the main and common functionality of an adapter. It also provides a mini-framework that runs the gRPC adapter service, calling the functions of handlers injected by the adapter code. This is represented in an UML-ish style in the figure below. The library is used in the Consul adapter, and others will follow.

Overview and usage of meshery-adapter-library

Package dependencies hierarchy

A clear picture of dependencies between packages in a module helps avoid circular dependencies (import cycles), understand where to put code, design coherent packages etc.

Referring to the figure below, the packages config and meshes (which contains the adapter service proto definition) are at the top of the dependency hierarchy and can be used by any other package. Thinking in layers (L), config
would be in the top layer, L1, adapter in L2, and config/provider in L3. Packages can always be imported and used in lower layers.

Package dependencies hierarchy

Β 

Join the Layer5 community!

Our projects are community-built and welcome collaboration. πŸ‘ Be sure to see the Layer5 Community Welcome Guide for a tour of resources available to you and jump into our Slack!

MeshMates

Find your MeshMate

MeshMates are experienced Layer5 community members, who will help you learn your way around, discover live projects and expand your community network. Become a Meshtee today!

Find out more on the Layer5 community.




Β 

Layer5 Service Mesh Community

Layer5 Service Mesh Community

βœ”οΈ Join any or all of the weekly meetings on community calendar.
βœ”οΈ Watch community meeting recordings.
βœ”οΈ Access the Community Drive by completing a community Member Form.
βœ”οΈ Discuss in the Community Forum.

Not sure where to start? Grab an open issue with the help-wanted label.

meshery-adapter-library's People

Contributors

acald-creator avatar aisuko avatar aminoxix avatar anita-ihuman avatar ankita13-code avatar anshgoyalevil avatar captain-akshay avatar debjani1413 avatar delusionaloptimist avatar dependabot[bot] avatar dhruv0000 avatar iambami avatar jbyers19 avatar kumarabd avatar leecalcote avatar mgfeller avatar muzairs15 avatar nebula-aac avatar ocean avatar pottekkat avatar revolyssup avatar ruhi09 avatar sakshamgupta90 avatar sayantan1413 avatar shuklaritvik06 avatar tangledbytes avatar warunicorn19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meshery-adapter-library's Issues

Enhance the common library that be more solid than before

Description

These days, we have been released so many update on

  • meshkit
  • meshsync
  • meshery-operator
  • others

And the updates does not only includes:

  • fixed issues of the code
  • bump the version of dependencies
  • bump the version of golang
  • fixed the cycle of dependencies
  • fixed the security issues

So, as a common library of all the adapters. meshery-adapter-library also should be updated. And because of it was imported by the other adapters. We should be careful to do this.

Some of them we need to merge them at first and then check the compatibility by manually.

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

[Doc] Architecture, purpose, usage, and design of the meshery-adapter-library.

Current State:

There exists a need for documentation of architecture, purpose and design of the common libraries.

There is little documentation about this now, some of it is in the Meshery Adapters document (drafts, discussions): https://docs.google.com/document/d/1b8JAMzr3Rntu7CudRaYv6r6ccACJONAB5t7ISCaPNuA/edit#heading=h.qgnry4nf3hlv

As of now, two common libraries are worked on: https://github.com/layer5io/meshkit and this one (meshery-adapter-library).

This issue is about meshery-adapter-library.

The use of these libraries by other components than adapter needs to be considered as well.

Desired State:

  • Architecture and design document
  • Documentation in the code (godoc) of the common libraries
  • Where to put new code (and why)
  • Dependency hierarchies
  • How to use the libraries (and why)
  • The documentation should be "just enough", to make it easy for contributors to use and contribute to the libraries

See also

kubeconfig context being cached incorrectly

Description

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Adapter operations not thread-safe

Description

Operation responsible for creating the adapter clients uses viper internally which is not thread safe hence concurrently accessing the function results in a go "panic".

Expected Behavior

Creating the adapter clients should be thread safe.

Screenshots

Environment:

  • OS: Manjaro Linux

To Reproduce
Steps to reproduce the behavior:

  1. Trying to create the adapter clients in a loop, that should be enough to reproduce the issue

[CI] Add new and modify existing targets in Makefile related to code quality

Current Behavior

  • Currently, there is no target to fix gofmt and goimport warnings from golangci-lint, and to tidy mod
  • the target running golangci-lintis called check(similar for clearing its cache)
  • Neither is go mod verify executed, and that could be useful too

Desired Behavior

  • Target golangci-run called from target check, or rename check to golangci-run
  • Target clean, executing go clean and golangci-lint cache clean
  • Target verify executing go mod verify
  • Target tidy executing go mod tidy, gofmt -w ., goimports -w .

Resources

Makefiles in other Layer5 (adapter) repositories.

Remove OAM support

Description

According to meshery/meshery#7434, we should remove all the code related to OAM. Meshery server and some of adapters like meshery-linkered see meshery/meshery-linkerd#519

But here we can see OAM still in current repo. We need to remove these no useful code too. Because:

  • No features are dependent on these code
  • These code does not under maintain
  • Some of out of date dependencies of these code are caused security issues to every adapter.

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

to fix error in "Slack Notify on Star" Job under GitHub Actions

Description
Under GitHub Actions of this repository "Slack Notify on Star" job is failing for which Slack.yaml is to be Updated.

Expected Behavior

To fix this issue, update the code of slack.yaml


Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

dependencies cause other adapter hard to update to dependencies.

Description

The common library's dependencies are caused the other adapter repo hard to update the dependencies version. And this needs to be fixed.

go mod tidy
go: finding module for package go.opentelemetry.io/otel/semconv/v1.17.0/httpconv
go: finding module for package github.com/layer5io/meshkit/models/meshmodel
go: finding module for package go.opentelemetry.io/otel/attribute
go: finding module for package go.opentelemetry.io/otel/semconv/v1.17.0
go: github.com/layer5io/meshery-kuma imports
        github.com/layer5io/meshery-adapter-library/adapter imports
        github.com/layer5io/meshkit/models/meshmodel: module github.com/layer5io/meshkit@latest found (v0.6.77), but does not contain package github.com/layer5io/meshkit/models/meshmodel
go: github.com/layer5io/meshery-kuma/kuma imports
        github.com/layer5io/meshkit/utils/kubernetes imports
        helm.sh/helm/v3/pkg/action imports
        helm.sh/helm/v3/pkg/registry imports
        oras.land/oras-go/pkg/auth/docker imports
        github.com/containerd/containerd/remotes/docker imports
        github.com/containerd/containerd/tracing imports
        go.opentelemetry.io/otel/attribute: module go.opentelemetry.io/otel@latest found (v1.19.0, replaced by go.opentelemetry.io/[email protected]), but does not contain package go.opentelemetry.io/otel/attribute
go: github.com/layer5io/meshery-kuma/kuma imports
        github.com/layer5io/meshkit/utils/kubernetes imports
        helm.sh/helm/v3/pkg/action imports
        helm.sh/helm/v3/pkg/registry imports
        oras.land/oras-go/pkg/auth/docker imports
        github.com/containerd/containerd/remotes/docker imports
        github.com/containerd/containerd/tracing imports
        go.opentelemetry.io/otel/semconv/v1.17.0: module go.opentelemetry.io/otel@latest found (v1.19.0, replaced by go.opentelemetry.io/[email protected]), but does not contain package go.opentelemetry.io/otel/semconv/v1.17.0
go: github.com/layer5io/meshery-kuma/kuma imports
        github.com/layer5io/meshkit/utils/kubernetes imports
        helm.sh/helm/v3/pkg/action imports
        helm.sh/helm/v3/pkg/registry imports
        oras.land/oras-go/pkg/auth/docker imports
        github.com/containerd/containerd/remotes/docker imports
        github.com/containerd/containerd/tracing imports
        go.opentelemetry.io/otel/semconv/v1.17.0/httpconv: module go.opentelemetry.io/otel@latest found (v1.19.0, replaced by go.opentelemetry.io/[email protected]), but does not contain package go.opentelemetry.io/otel/semconv/v1.17.0/httpconv

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

Add function getSVCPort to return port(s) of a named k8s-service

Current Behavior

Several adapters (meshery-consul among others) inform the user about the port numbers of main service in a log event.
This method has not yet been implemented in meshery-adapter-library.

Desired Behavior

This method is implemented in meshery-adapter-library, such that it can be used in e.g. the consul adapter.


Resources

Base the code on the code from the consul adapter.

Alternatives / Additional Context

[SMI Conformance] Tests for Kuma are failing

Description
When running an SMI Conformance test against Kuma, the following error happens:

Screen Shot 2021-03-03 at 10 13 29 AM

Expected Behavior

  1. SMI conformance tests should execute and return results (pass or fail).
  2. Errors like this are handled and the user is given a probable cause and suggested remediation.

Config issue wrt GKE Cluster

Description
Getting config error due to difference in config for GKE cluster

Expected Behavior
Istio adapter to be reachable

Logs

➜  meshery git:(master) kubectl logs deployments/meshery-istio -n meshery
app=istio-adaptor ts=2020-12-08T15:39:09.838376456Z level=info message="Adaptor Listening at port: 10000"
app=istio-adaptor ts=2020-12-08T15:42:35.757084641Z level=info message="Creating instance"
app=istio-adaptor ts=2020-12-08T15:42:35.757138734Z caller=level.go:63 level=error code=1001 severity=1 short-description=None long-description="Error creating adapter instance.Error validating kubeconfig.current-context must exist in order to minify" probable-cause=None suggested-remediation=None

[README] Need to add `Community Forum`

Description

README.md is the first file one should read when starting a new project. Our community launched Discussion forum for help seekers; needs to publish it officially on README.md for convenience.

Screenshots

Current behaviour:
image

Desired behaviour:
image

Note:
Need to add only last line for Community Forum

Environment:

  • OS: any [e.g. Ubuntu]
  • Browser: any [e.g. Chrome, Safari]
  • Version: any [e.g. 22]
  • Device: any [e.g. laptop, iPhone 8]

Reference:

no error details found for error name 'ErrApplyOperationCode' and code '1008'

Description

no error details found for error name 'ErrApplyOperationCode' and code '1008'

Expected Behavior

There should be a detailed error code for 'ErrApplyOperationCode'

This is found here https://github.com/meshery/meshery-adapter-library/blob/master/adapter/error.go#L30, but once you look through the file, there is no section to call for this error code.

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

Replace the Logo of Layer5 with Meshery in config.yml workflow

Description

Currently, we are using the Logo of Layer5 instead of Meshery. This repository is under the organization Meshery, so, there should be the image of Meshery.

How to resolve this?

  • Go to .github and replace this welcome image with the new one:

  • Make sure to display the images conditionally, based on the theme selected by user.
    Here's the sample code:

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/GiorgosXou/Random-stuff/main/Programming/StackOverflow/Answers/70200610_11465149/w.png">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/GiorgosXou/Random-stuff/main/Programming/StackOverflow/Answers/70200610_11465149/b.png">
  <img alt="Meshery Logo" src="">
</picture>

New images are:

Meshery-celebration-Light
Meshery-celebration-Dark

  • Download these images, and upload with an appropriate name. Make sure to use conditional rendering as described above.

  • After uploading the image, and removing the previous image, go to .github/config.yml folder and update the reference to previous image to the new image in the following part:

firstPRMergeComment: >
  Thanks for your contribution to the Layer5 and Meshery community! :tada:
   
  ![Congrats!](https://raw.githubusercontent.com/meshery/meshery.io/master/.github/welcome/Layer5-celebration.png)
  &nbsp; &#9; &nbsp; &#9;  &nbsp; &#9;  &nbsp; &#9; :star: Please leave a [star on the project](../stargazers). :smile:

Here, replace ![Congrats!](https://raw.githubusercontent.com/meshery/meshery.io/master/.github/welcome/Layer5-celebration.png) with the code

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/GiorgosXou/Random-stuff/main/Programming/StackOverflow/Answers/70200610_11465149/w.png">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/GiorgosXou/Random-stuff/main/Programming/StackOverflow/Answers/70200610_11465149/b.png">
  <img alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png">
</picture>

make sure to change the image sources with the path to image in the folder where you upload it.

  • That's it.

Contributor Guides and Handbook

Initial (alpha) version of the meshery adapter library code

Current Behavior

There is no code in this repository yet.

Desired Behavior

Transfer the initial version of the meshery adapter library that was created based mainly on the Kuma adapter code, with code also from the Consul adapter, to this repository. It was tested using the Kuma and Consul adapters' code it was based on.


Resources

Issue Template Updates for Figma link

Current Behavior

The project's current issue templates are missing an open invitation link where new contributors can join the community's Figma team and view user interface designs and other UX projects.

Desired Behavior

Each template that has a reference to Figma in its resources section should an invite link added.

Implementation

In each issue template that refers to Figma, replace the current line referring to Figma with this line:

- 🎨 Wireframes and [designs for Meshery UI](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9)

Acceptance Tests

  1. All references to Figma include the "open invite" link.

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

Security issues of the dependencies

Description

Please look at here, that the security issues that we have https://github.com/meshery/meshery-adapter-library/security/dependabot

And we already fixed these issues in mesh-kit repo. And meshery-adapter-library as a common library of other adapters. It should do not have these security issues. So, there issues should be fixed.

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

[CI] add label commenter workflow

Description:

This repository should have the label commenter workflow.
It would run whenever an issue/pr is labelled with one of the targeted labels and comment down any relevant information.

Contributor Reference:

The workflow would use: https://github.com/peaceiris/actions-label-commenter

A sample workflow is defined in: https://github.com/meshery/meshery/blob/master/.github/workflows/label-commenter.yml.

It would also need a sample configuration which is defined in: https://github.com/meshery/meshery/blob/master/.github/label-commenter-config.yml

NOTE:

It would be ideal if we did not hard code name operations like this.

It would be ideal if we did not hard code name operations like this.

Instead, adapters will encode the mechanics of the operation (i.e. kubectl) and operation type (apply) and operation media (single file, file path to a folder containing manifests, or URL to an endpoint that returns a manifest) externalizing the operation names ("BookInfo"), supported operation verbs (apply, delete) and supported versions (version of BookInfo) as config outside of the go code.

Originally posted by @leecalcote in #18 (comment)

[Adapters] Evolve meshes.proto to adapters.proto

This issue is child issue (labeled with kind/child). See meshery/meshery#9966 for additional context.

Current Behavior

Meshery Adapters capabilities have progressed well beyond that of managing service meshes. Adapters include the ability to manage any type of structure as well as perform advanced performance management of that into structure.

Desired Behavior

The meshes.proto in Meshery Server is no longer representative of the broader set of capabilities that Meshery Adapters have. The name of this protobuf file and aspects of its internals need to be updated to reflect this fact.

Implementation

  1. Renaming meshes.proto to adapters.proto (and the directory name) - https://github.com/meshery/meshery-adapter-library/tree/master/meshes
  2. Update and remove any service mesh specific concepts in the proto and library to be infra and capability agnostic.

Resources

Incluster Configure issues on adapters

Description
Adapters doesn't get initialised when deployed In-Cluster

Logs
Istio:
time="2021-04-27T12:37:17Z" level=error msg="Error creating adapter instance.Error validating kubeconfig.none of the auth infos are valid either the certificate path is invalid or is inaccessible" app=istio-adaptor code=1001 probable-cause=None severity=1 short-description=None suggested-remediation=None

OSM:
time="2021-04-27T12:49:58Z" level=warning msg="unable to type cast clusters to a map array"

Update the Go version to 1.21.x

Description

Other repos were already updated to v1.12.x. So, in order to avoid the non-compatible issues of dependencies' version. We need to upgrade the version soon.

Expected Behavior

Screenshots

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

[Refactor] Update OpenTelemetry implementation

Current Behavior

Right now, the current package for OpenTelemetry is at v1.3.0.

As of right now, the latest package is at v1.10.0 which have some major changes in the last couple years. This will require a refactor, and can also assist in the upgrading from Go 1.17 to 1.19.

Reference:

https://pkg.go.dev/go.opentelemetry.io/otel

Desired Behavior

By refactoring, we will also be able to update according to the rest of the Go projects that replies on this module.


Resources

Alternatives / Additional Context

[README] Update README Community Section

Description
The Community section in the README says "Access the Community Drive". There is a new procedure of having this automated based on the individual filling in a community member form

Expected Behavior
Update "Access Community Drive" to "To Access Community Drive, fill Community Member Form"

Screenshots
img

Resources
Refer to the Contributing guide

Environment:

  • OS: [e.g. Ubuntu]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]
  • Device: [e.g. laptop, iPhone 8]

[CI] Adapter Library Releases have accidentally jumped past v1.0

Description
As a project, Mistry has yet to reach that mile stone. As such, the adapter library should not have received it either.

Expected Behavior
a v0.7 version of the library should be available and no releases post v1.0


[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[Optional] Additional Context

Contributor Resources

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

Update Slack.yml and add newcomer-alert workflow

Current Behavior
Currently the slack.yml is outdated. Also there is no automated way of notifying the slack channel when a "good first issue" has been created.

Desired Behavior
Update slack.yml and add newcomer-alert.yml to the Github workflow.


Resources
Add the updated slack.yml file and the newcomer-alert.yml file to the .github/workflow folder.

Files needed:
https://github.com/meshery/meshery-istio/blob/master/.github/workflows/slack.yml
https://github.com/layer5io/layer5/blob/master/.github/workflows/newcomers-alert.yml

Meshery Events

Current Behavior

Meshery Server has an events API for receiving events from Meshery Adapters. The message format is defined in the meshes protobuf.

Desired Behavior

  1. Update Meshery Adapters to use new library event features. Reminder: all events are relayed to the Remote Provider via Meshery Server.

Related to meshery/meshery#8560


Resources

Alternatives / Additional Context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.