earthgecko / skyline

Anomaly detection
http://earthgecko-skyline.readthedocs.io/en/latest/
Other
554 stars 64 forks source link

Frontend Issue | Docker | CentOS 9 Shell Script #651

Open Soumya624 opened 3 days ago

Soumya624 commented 3 days ago

Hi @earthgecko ,

Thanks for the amazing work.

I have started the Skyline server and the aligned services through Docker from MAC. But, when pushing a random metric data through Postman (/metric_data_post) or uploading a CSV from web app, the data is not getting shown in the index page. It's going to Graphite from Flux. But, then nothing happening. Would be great if you can help.

image image image
earthgecko commented 3 days ago

Hi @Soumya624

If you just want to test analysing a time series in an adhoc manner you should navigate to the Vortex page in the UI (localhost:1500/vortex read the page text) and upload a reasonably sized time series as a csv with >= 1000 data points and then the analysis will be carried out immediately and the results returned to you in the UI (https://earthgecko-skyline.readthedocs.io/en/v4.0.0/vortex.html)

You are currently testing the real time pipeline by using the flux /metric_data_post which is meant for continuous real time data and there needs to at least 100 data points (MIN_TOLERABLE_LENGTH = 100 in settings.py) in the system before analysis begins on metrics submitted via this method. Equally, uploading a csv via flux will just result in flux submitting that data to Graphite, if that csv contained more than 100 data points then Analyzer will only evaluate the last data point in the analysis unless the metric is part of a namespace that is defined in BATCH_PROCESSING_NAMESPACES . This is because flux for the real time and batch processing pipelines which both require continuous data.

If you are wanting to test /metric_data_post in this manner just create a script that runs on cron every minute and submits data, but generally you would just send metrics via collectors of some sort, Telegraf, Prometheus, etc.

I hope this helps.

earthgecko commented 3 days ago

Also @Soumya624 Skyline is not the metrics frontend, the frontend for metrics will be Graphite, Prometheus, VictoriaMetrics or Influxdb depending on what TSDB you are using. Skyline is not meant to provide a frontend to view metrics, it provides a view of the significant changes in metrics.

Soumya624 commented 3 days ago

Hi @earthgecko ,

Thanks a lot for the help. One small doubt. While trying out the Vortex, I got this. Do I need to change any URL anywhere?

image

Data used: metrics.dummy.ts.csv

Would be really helpful if you can take a look!

earthgecko commented 3 days ago

Hi @Soumya624 that is related to the variables in settings.py, specifically you have not changed the SKYLINE_URL. I am not certain as to how you set this skyline instance up, but I am reading on docker? I could be mistaken, but if you have set this up on docker, just be advised that Skyline is no longer supporting running on docker and the docker patterns pre-date the additional of Vortex and do not support it, I am sorry.

If you are not using docker then ensure that you have nginx set up to serve the webapp and flux as per https://github.com/earthgecko/skyline/blob/master/etc/skyline.nginx.conf.d.example

Instead of localhost use a hostname and there should be no port defined as nginx should route the request appropriately.

SKYLINE_URL = 'http://<HOSTNAME_OR_FQDN>'

Ensure that you properly define any variables in settings.py that are tagged with [USER_DEFINED] with the appropriate values.

You will have an issue using Vortex because although you are serving the webapp on port 1500, the /flux endpoint should be handled and routed by nginx to the flux instance which would be on 127.0.0.1:8000

For all the functionality to work properly you need to use nginx to route requests to the appropriate backend, be that the webapp or flux. Seeing as you are accessing the webapp directly and not via nginx I did not think Vortex will probably not work.

If you are using docker and have used the deprecated docker patterns as is then you should be using:

SKYLINE_URL = 'https://skyline-docker-skyline-1'

But once again the docker set up will not support Vortex and as the docs and code says, docker has been deprecated, please use a proper VM or server.

If you want to deploy Skyline on a VM let me know and I will provide an updated skyline.dawn.sh build script for CentOS Stream 9, which is the next OS that going to be supported and in the process of finalising for the next release.

Soumya624 commented 2 days ago

An updated .sh would be really helpful @earthgecko . Based on your suggestion, I just spinned up the docker containers with the latest SKYLINE_URL. Vortex didn't work.

I was wondering whether Flux and Cron Jobs which you had suggested earlier would go with the current docker!

Soumya624 commented 2 days ago

Hi @earthgecko ,

Initiated a VM with CentOS Stream 9. Would be great if you can share the script. Thanks a lot again for the help!

earthgecko commented 2 days ago

Hi @Soumya624 I will try to cut an alpha release at some point later today. It does not make sense to deploy the new OS version with Python 3.8 or on version v4.0.0. I know that in the Python ecosystem a number of libraries jumped the gun on Python 3.8 EOL and I know some of the dependencies with 3.8 will not be available and there will be dependency conflicts with new packages. The alpha release will be for Python 3.10.15 with the latest dependencies which are all tested and working.

Soumya624 commented 2 days ago

Awesome. Thanks for the much needed Python version update for 4.0.0!

earthgecko commented 1 day ago

Hi @Soumya624 sorry for the delay. I have not managed to cut a release yet because I ran into some issue updating some libraries, algorithms and numba jit functions to run with numpy >= 2 and some changes between pandas 2.0.3 and 2.2.3 (which now supports numpy 2) relating to stricter handling of the pd.concat function. I shall attempt to fix/handle these before cutting a release and when these are either fixed or handled I will update you, that should be in the next day or two I hope.

Soumya624 commented 1 day ago

Sure @earthgecko !