GithubHelp home page GithubHelp logo

infinimesh / infinimesh Goto Github PK

View Code? Open in Web Editor NEW
93.0 14.0 18.0 135.4 MB

Home of infinimesh, the first portable cloud-native IoT platform

Home Page: https://infinitedevices.io

License: Apache License 2.0

Dockerfile 0.69% Go 56.21% Shell 0.28% JavaScript 7.93% Vue 34.52% HTML 0.10% CSS 0.07% Makefile 0.20%
iot-platform iot cloud-native industry-40 iot-cloud golang kubernetes mqtt infinimesh go

infinimesh's Introduction

infinimesh IoT Platform

infinimesh is a opinionated multi-tenant hyperscale Internet of Things platform to connect IoT devices fast and securely with minimal TCO. It features a unique Graph-based authorization system, allowing users & engineers to create arbitrary hierarchical ontologies, with the possibility to scope permissions down to single sub-devices to specific users (e.g. suppliers). It exposes simple to consume RESTful & gRPC APIs with both high-level (e.g. device shadow) and low-level (sending messages) concepts. The infinimesh IoT platform is open source and fully kubernetes compliant. No vendor lock-in - run it yourself on Kubernetes in your own datacenter, under your control with maximum data privacy.

Our API's (REST / gRPC / ConnectRPC) are considered as beta and may change in future. infinimesh has already available:

  • MQTT support for version 3 and 5
  • State management (digital twin)
  • Graph-based permission management (multi-dimensional permissons at data layer)
  • TLS 1.2 / 1.3 support
  • Device-to-Cloud and Cloud-to-Device messages
  • Enhanced UI
  • k8s and Docker environments

Documentation

Check out our:

Build status

CI(Build Docker images) Go Report Card

Community

You can reach out to the community via Discord.

Client libraries

The recommended way to interact with infinimesh API is gRPC and ConnectRPC. Thus, we provide protobuf files at infinimesh/proto, using which you can generate a client library for your programming language of choice.

Additionally, we have pregenerated libraries:

Golang

Can be added to your project via:

go get github.com/infinimesh/proto@latest

JS

Can be obtained from npm via:

npm install infinimesh-proto

Dart / FLutter

Has to be downloaded from infinimesh/proto, you can copy the whole build/dart dir into your Flutter project

CLI

Usage

Start with inf help and inf help login ;)

Homebrew

See macOS.

Snap

Just run

snap install inf

and see usage usage

Linux

.deb (Debian, Ubuntu, etc.)

  1. Go to CLI Releases
  2. Get .deb package for your CPU arch (arm64 or x86_64)
  3. dpkg -i path/to/.deb

If you're using some other arch, let us know, we'll add it to the build. Meanwhile - try building from source

Then see usage usage

.rpm (RedHat, CentOS, Fedora, etc.)

  1. Go to CLI Releases
  2. Get .rpm package for your CPU arch (arm64 or x86_64)
  3. yum localinstall path/to/.rpm or dnf install path/to/.rpm

If you're using some other arch, let us know, we'll add it to the build. Meanwhile - try building from source

Then see usage usage

AUR (Arch Linux, Manjaro, etc.)

If you have yaourt or yay package must be found automatically by label inf-bin

Otherwise,

  1. git clone https://aur.archlinux.org/packages/inf-bin
  2. cd inf-bin
  3. makepkg -i

Then see usage usage

Others

If you're using other package manager or have none, you can download prebuilt binary in .tar.gz archive for arm64 or x86_64, unpack it and put inf binary to /usr/bin or your $PATH/bin.

If you're using some other arch, let us know, we'll add it to the build. Meanwhile - try building from source

Then see usage usage

macOS

If you're using Homebrew:

brew tap infinimesh/inf
brew install inf

You're good to go!

Then see usage usage

If you don't have Homebrew, consider using it ;), otherwise you can get prebuilt binary from CLI Releases page as an .tar.gz archive.

# if you have wget then
wget https://github/infinimesh/inf/releases/#version/inf-version-darwin-arch.tar.gz
# if you don't, just download it
tar -xvzf #inf-version-darwin-arch.tar.gz
# move binary to /usr/local/bin or alike
mv #inf-version-darwin-arch/inf /usr/local/bin

You're good to go!

Then see usage usage

Windows

  1. Go to CLI Releases
  2. Get prebuilt binary from CLI Releases page as an .zip archive.
  3. Unpack it
  4. Put it somewhere in $PATH

Then see usage usage

Build From Source

See CLI repo for source and instructions.

Development

Local development installation

We have built an automated local development setup based on Docker.

  1. Add this entries to /etc/hosts:
127.0.0.1 api.infinimesh.local 
127.0.0.1 console.infinimesh.local
127.0.0.1 traefik.infinimesh.local
127.0.0.1 rbmq.infinimesh.local
127.0.0.1 db.infinimesh.local
127.0.0.1 media.infinimesh.local
127.0.0.1 mqtt.infinimesh.local
  1. Clone this repo via git clone https://github.com/infinimesh/infinimesh.git
  2. cd into the fresh cloned repo
  3. Run docker compose up

Swagger API: https://infinimesh.github.io/infinimesh/

Generating proto files

Clone proto repo

Navigate to cloned repo directory and run:

docker run -it \
  -v $(pwd):/go/src/github.com/infinimesh/proto \
  ghcr.io/infinimesh/proto/buf:latest

Right now we keep protos generated only for Go. If you need one of the other languages, add according module to buf.gen.yaml.

PRs are as always welcome.

Mocks

infinimesh is using mockery. To generate mocks it is recommended to use Docker image:

docker pull vektra/mockery
docker run -v "$PWD":/src -w /src vektra/mockery --all

Otherwise just get the mockery binary and run it at the root of the project.

Local Development

Start the local dev environment via docker compose up -d.

Login locally via CLI:

inf login api.infinimesh.local infinimesh infinimesh --insecure

Access the Console at http://console.infinimesh.local

License

Copyright 2018 - 2024 the infinimesh committers, 2pk03, birdayz, slntopp and The Infinite AI Audio GmbH team

Licensed under the Apache License, Version 2.0 (the "Licenses"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://github.com/infinimesh/infinimesh/blob/master/LICENSE

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The authors of infinimesh are The Infinite AI Audio GmbH, birdayz, 2pk03 and slntopp, all rights reserved.

infinimesh's People

Contributors

2pk03 avatar atr43 avatar ayesha54 avatar birdayz avatar deepdiver1975 avatar dependabot[bot] avatar dnobel avatar fossabot avatar gorobot-nz avatar julianfeinauer avatar lorentzc avatar prmau avatar slntopp avatar zebon43 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

infinimesh's Issues

initial root account can't be set

{"level":"info","ts":1569833459.7483516,"logger":"controller.rootpw.setPassword","msg":"Failed to set pw. Have to create account","err":"rpc error: code = Internal desc = grpc: error unmarshalling request: proto: wrong wireType = 2 for field StartTsโ€}

fix:
use the DGO github.com/dgraph-io/dgo/v2 or make graph v1.0 persistent in docker files on quay

mqtt router freeze after 2weeks @SaaS

after exactly 2 weeks the MQTT router freezes, as an consequence the timescale-connector, too. Workaround is to periodically restart the routes.
Solve: add health checks to the operator, and scale the routers before restart them to avoid interruptions.

403 error breaks page

The app becomes completely unresponsive if some error occurs during api call.
e.g. 403 is returned when opening the detail view of a device. then nothing works anymore, no logout or returning to the device overview. and the device overview is then empty.

User can't be activated via REST Api

Using the Swagger API a user can be added, edited, deleted - but a new created user cannot login. Its a documentation bug, since the password needs to be encrypted, but the API does not have a callable object yet.

Test failed

Test in CircleCI fails with:

rpc error: code = PermissionDenied desc = Unable to get permissions for the account

Link: CircleCI

MQTT5 Compatibility

  • Check how easily we can implement it backwards-compatible
  • Request/Response feature is very helpful for platform specific features (eg request desired state, ..)
  • Are last value semantics part of the spec?
  • Header Metadata properties are nice

Separate "ticks" (incoming changes) from deltas (actual difference from last full state)

Example:
Full State (old):
{"a" : 1, "b" : "blah"}

Tick:
{"a" : 1, "b" : "test"}

In this case, the tick contains a part of the full state ("a" : 1), which is not a part of the actual delta. So we should emit the delta separately in the shadow-delta-merger.

Incoming data: shadow.xxx-state.ticks
Full State: shadow.xxx-state.full
Delta: shadow.xxx-state.delta

Events Bus: accounts, namespaces, devices CRUD notifications and such

Create internal notification service, to notify other services about CRUD actions

Service(service.go) has to have:

  • stream Subscribe(struct {entity, uuid}) -> chan Event method
  • Internally available method Notify(struct{event, entity, uuid, metadata})

Recommended to make EventBusService a generic type, like:

type Event[T InfinimeshProtobufEntity] struct {
  Event string
  Entity T // Split into Entity type string and Uuid string
  Metadata map[string]interface{}
}

type EventBusService[T InfinimeshProtobufEntity] interface {
  Subscribe(entity T) (chan Event[T])
  Notify(Event[T]) error
}

Handler(handler.go):

  • Subscribe(connect.AnyRequest[EmptyRequest]) (connect.AnyStream[Event]) method

Postgres.yaml is missing for local test deployment ...

To Reproduce
Steps to reproduce the behavior:
bash <(curl -s https://raw.githubusercontent.com/infinimesh/infinimesh/master/hack/microk8s/infinimesh-setup-ubuntu.sh)
and after some time:

=> now we install infinimesh ...

error: unable to read URL "https://raw.githubusercontent.com/infinimesh/infinimesh/master/hack/microk8s/postgres.yaml", server reported 404 Not Found, status code=404
platform.infinimesh.infinimesh.io/my-infinimesh created
kafka.kafka.strimzi.io/infinimesh created
 checking for host entries

UI doesn't display updates after some time

The UI stops visualizing that new data is arrived (flashing) after a while. Browser reload doesn't help much.

To Reproduce
Steps to reproduce the behavior:

  1. Go to UI, klick on a device -> details
  2. the last reported state is shown
  3. wait some time and send data
  4. UI stops refreshing

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.