regel / loudml

Loud ML is the first open-source AI solution for ICT and IoT automation
Other
298 stars 93 forks source link

1-click ML button not available in Chronograf #119

Closed yolkhovyy closed 4 years ago

yolkhovyy commented 5 years ago

Screenshot from 2019-06-15 13-01-40

The 1-click ML button is not available, please see attached screenshot.

Have followed a tutorial here: https://medium.com/loud-ml/a-devops-tutorial-to-setup-intelligent-machine-learning-driven-alerts-c4de93cf6d66

InfluxDB/Telegraf/Kapacitor run on a Raspberry Pi 3B: Kapacitor OSS 1.5.2 (git: HEAD 3086452d00830e01d932838d8c6d1df818648ad3) Influxdb OSS 1.7.6 de0528dc-8f69-11e9-847f-b827eb200a4c Telegraf 1.10.3 (git: HEAD 294bb666)

Chronograf/LoudML - on Ubuntu 2018.4: Docker version 18.09.6, build 481bc77

f6400ffb5415        loudml/chronograf   "/usr/bin/chronograf…"   2 hours ago         Up 2 hours          0.0.0.0:8888->8888/tcp   compose_chronograf_1
d1d044d237ce        loudml/community    "/bin/sh -c /usr/bin…"   2 hours ago         Up 2 hours          0.0.0.0:8077->8077/tcp   compose_loudml_1

loudml.yml:

datasources:
  - name: influx
    type: influxdb
    addr: 192.168.1.211:8086
    database: telegraf
  - name: kapacitor
    type: influxdb
    addr: 192.168.1.211:9092
    database: from_loudml

storage:
  path: /var/lib/loudml

server:
  listen: 0.0.0.0:8077

docker-compose:

# This is a Docker Compose file to work with Loud ML and an InfluxDB stack.

version: "2"

services:
  loudml:
    image: loudml/community
    volumes:
      - ./etc/loudml.yml:/etc/loudml/config.yml:ro
      - ./var/loudml:/var/lib/loudml
    ports:
      - "8077:8077"

  chronograf:
    image: loudml/chronograf
    depends_on:
      - loudml
    ports:
      - "8888:8888"
    volumes:
      - ./var/chronograf:/var/lib/chronograf
    environment:
      INFLUXDB_URL: http://192.168.1.211:8086
      LOUDML_URL: http://localhost:8077
      KAPACITOR_URL: http://192.168.1.211:9092

Some log:

Starting compose_loudml_1 ... done
Starting compose_chronograf_1 ... done
Attaching to compose_loudml_1, compose_chronograf_1
loudml_1      | ERROR:root:detected development environment - incremental training disabled
loudml_1      | INFO:root:starting Loud ML server on 0.0.0.0:8077
chronograf_1  | time="2019-06-15T14:44:18Z" level=info msg="Running migration 59b0cda4fc7909ff84ee5c4f9cb4b655b6a26620" 
chronograf_1  | time="2019-06-15T14:44:18Z" level=info msg="Serving chronograf at http://[::]:8888" component=server 
chronograf_1  | time="2019-06-15T14:44:18Z" level=info msg="Reporting usage stats" component=usage freq=24h reporting_addr="https://usage.influxdata.com" stats="os,arch,version,cluster_id,uptime" 

chronograf_1  | time="2019-06-15T14:44:42Z" level=info msg="Serving assets" component=server method=GET remote_addr="172.20.0.1:37192" url=/ 

This might be important:

chronograf_1  | 2019/06/15 14:45:46 http: proxy error: dial tcp 127.0.0.1:8077: connect: connection refused
chronograf_1  | time="2019-06-15T14:45:46Z" level=info msg="Response: Bad Gateway" component=server method=GET remote_addr="172.20.0.1:37226" response_time=10.004400907s status=502 
chronograf_1  | 2019/06/15 14:45:46 http: proxy error: dial tcp 127.0.0.1:8077: connect: connection refused
chronograf_1  | time="2019-06-15T14:45:46Z" level=info msg="Response: Bad Gateway" component=server method=GET remote_addr="172.20.0.1:37218" response_time=10.008969819s status=502 

Just noticed that linear fill is not supported, have tried previous - no change.

When mouse is over the button I see a pop up with the following message (among other things that look ok):

Unable to find LoadML datasource for selected database. Check configuration.

localhost:8077 returns:

{"host_id":"52b5926e7a3120d537f86eff37162d2c","tagline":"The Disruptive Machine Learning API","version":"1.5.0"}
regel commented 5 years ago

Hey @yolkhovyy, the 1click button was renamed "Create baseline" in the latest prototypes. You can see the button is not active so you may have to select your bucket_interval, or aggregation type. If you hover your mouse on the button it will tell you what's missing.

You're right, linear fill is not supported. Using "previous" is a good choice when you have time series with irregular data points.

yolkhovyy commented 5 years ago

Yes, the button is called Create baseline indeed, when I hover mouse over the button I see a pop up with the following message:

Unable to find LoadML datasource for selected database. Check configuration.

What does that mean?

Here is my loadml.yml:

datasources:
  - name: influx
    type: influxdb
    addr: 192.168.1.211:8086
    database: telegraf
  - name: kapacitor
    type: influxdb
    addr: 192.168.1.211:9092
    database: from_loudml

storage:
  path: /var/lib/loudml

server:
  listen: 0.0.0.0:8077

I guess this line

database: from_loudml

is not quite correct - what should be in there?

Or, should I created the from_loudml database manually?

regel commented 5 years ago

Yes, you can create the from_loudml database manually.

Unable to find Loud ML datasource for selected database. Check configuration.

The above message will appear if there is a mismatch in settings. Chronograf defines its own "data sources". Loud ML is a separate software so it does the same with another config.yml file. The UI demo is trying to match data sources by name, but if it fails you will see the above error message.

Using the docker-compose file should prevent this issue.

yolkhovyy commented 5 years ago

Do I understand it correct that the Chronograf, Kapacitor and LoudML use the same database?

I am not sure I understand what the database is in the kapacitor section in the loudml.yml

datasources:
  - name: influx
    type: influxdb
    addr: 192.168.1.211:8086
    database: telegraf
  - name: kapacitor
    type: influxdb
    addr: 192.168.1.211:9092
    database: from_loudml

storage:
  path: /var/lib/loudml

server:
  listen: 0.0.0.0:8077
regel commented 5 years ago

In this example, Loud ML reads data from the influx source and then writes data to kapacitor for alerting purposes.

Kapacitor is not the database, it's a stream processor: data in - data out. Sometimes there is no data out, and it's only used for alerting.

danielcoakley commented 5 years ago

Hi, I'm getting the same issue as above.

"Unable to find LoadML datasource for selected database. Check configuration."

I'm using the exact same settings as @yolkhovyy above. I've tried a number of different configurations, and removed DB authentication, in case this was blocking LoudML.

`datasources:
 - name: influx
   type: influxdb
   addr: localhost:8086
   database: plc
 - name: kapacitor
   type: influxdb
   addr: localhost:9092
   database: from_loudml
`
pramodpk89 commented 5 years ago

I am having the exact same issue as mentioned by @yolkhovyy . Any suggestions?

loudml.yml

datasources:

server: listen: 0.0.0.0:8077

pramodpk89 commented 5 years ago

I got the issue , had to specify the retention policy with below entry :

retention_policy:myRetentionPolicy

hatdropper1977 commented 5 years ago

Try three solution here. Latest-devel (September 2019) may not be compatible with the current chronograf https://github.com/regel/loudml/issues/151#issuecomment-539701633

regel commented 4 years ago

Compatibility issues solved by latest loudml and Chronograf docker images.