louwrentius / fio-plot

Create charts from FIO storage benchmark tool output
BSD 3-Clause "New" or "Revised" License
370 stars 87 forks source link

requires python3, tkinter; AND cannot run headless #1

Closed PatNarciso closed 4 years ago

PatNarciso commented 7 years ago

The server I was attempting to benchmark didn't have these items, that appear to be required. After installing the additional dependencies, it appears tkinter requires a working x display.

:( I was so close!

My thoughts: After the .json files are generated, send them to another machine with the additional libraries / dependencies for image generation.


Traceback (most recent call last):
  File "./fio-plot.py", line 320, in <module>
    main()
  File "./fio-plot.py", line 306, in main
    b.chart_iops_latency('read')
  File "./fio-plot.py", line 259, in chart_iops_latency
    c.plot_io_and_latency(mode)
  File "./fio-plot.py", line 26, in plot_io_and_latency
    nrows=2, gridspec_kw={'height_ratios': [7, 1]})
  File "/usr/lib64/python3.6/site-packages/matplotlib/pyplot.py", line 1202, in subplots
    fig = figure(**fig_kw)
  File "/usr/lib64/python3.6/site-packages/matplotlib/pyplot.py", line 535, in figure
    **kwargs)
  File "/usr/lib64/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager
    return new_figure_manager_given_figure(num, figure)
  File "/usr/lib64/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure
    window = Tk.Tk()
  File "/usr/lib64/python3.6/tkinter/__init__.py", line 2017, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Finally: Thank you for creating, publishing, documenting, and blogging about your work. It has been a resource of mine for the past few years.

louwrentius commented 7 years ago

Thank you, X should not be required, I will try to reproduce and fix it. Which flavour of Linux do you run?

On 9 May 2017, at 00:21, PatNarciso notifications@github.com wrote:

The server I was attempting to benchmark didn't have these items, that appear to be required. After installing the additional dependencies, it appears tkinter requires a working x display.

:( I was so close!

My thoughts: After the .json files are generated, send them to another machine with the additional libraries / dependencies for image generation.

Traceback (most recent call last): File "./fio-plot.py", line 320, in main() File "./fio-plot.py", line 306, in main b.chart_iops_latency('read') File "./fio-plot.py", line 259, in chart_iops_latency c.plot_io_and_latency(mode) File "./fio-plot.py", line 26, in plot_io_and_latency nrows=2, gridspec_kw={'height_ratios': [7, 1]}) File "/usr/lib64/python3.6/site-packages/matplotlib/pyplot.py", line 1202, in subplots fig = figure(fig_kw) File "/usr/lib64/python3.6/site-packages/matplotlib/pyplot.py", line 535, in figure kwargs) File "/usr/lib64/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager return new_figure_manager_given_figure(num, figure) File "/usr/lib64/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure window = Tk.Tk() File "/usr/lib64/python3.6/tkinter/init.py", line 2017, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable Finally: Thank you for creating, publishing, documenting, and blogging about your work. It has been a resource of mine for the past few years.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

PatNarciso commented 7 years ago

This server is: CentOS Linux release 7.3.1611 (Core)

louwrentius commented 7 years ago

This is the temporary fix:

import os import sys import json import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import argparse

I ran this on Debian and it worked, but the fonts are screwed up. I'll look at that later. The tool is written on MacOS with brew.

samuel1978 commented 7 years ago

spent lots of time on this problem, here is my solution effectively:

  1. yum -y install tkinter tcl-devel tk-devel

to your python directory: vim ......./Python3.6.2/Modules/Setup.dist

  1. Remove comments from these lines:

_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \

-L/usr/local/lib \

-I/usr/local/include \

-ltk8.5 -ltcl8.5 \ # default is 8.2 and you should change it to the version you installed in step1

-lX11

  1. ./configure make && make install

louwrentius commented 4 years ago

I have released an almost total rewrite that requires python3. I've tested it on a clean Linux box and it seems to work fine, without the issues reported above.