mario33881 / betterSIS

The modern shell for SIS (the circuit simulator and optimizer)
MIT License
8 stars 1 forks source link

[FEATURE] Aggiunta Dockerfile #56

Closed nicolasvac closed 2 years ago

nicolasvac commented 2 years ago

Buongiorno,

ho provato a creare una immagine Docker da poter utilizzare con bettersis, ma non riesco a farlo andare. bettersis restituisce degli errori all'avvio.

In allegato il mio dockerfile, e l'errore di bettersis.

In caso sarebbe bello aggiungerlo di default nella repository.

Dockerfile:

FROM ubuntu:18.04

WORKDIR /sis-main

USER root

RUN apt update && apt install sudo wget readline-common sudo rsyslog -y

RUN wget https://github.com/JackHack96/logic-synthesis/releases/download/SIS/sis_1.4-1_amd64.deb -O sis.deb

RUN dpkg -i sis.deb

RUN wget https://github.com/mario33881/betterSIS/releases/download/1.2.1/bettersis.deb

RUN sudo dpkg -i bettersis.deb

WORKDIR /sis-data

CMD [ "bsis" ]

Logs:

# bsis
--- Logging error ---
Traceback (most recent call last):
  File "logging/handlers.py", line 934, in emit
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 855, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 937, in emit
  File "logging/handlers.py", line 866, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "bettersis/bettersis.py", line 684, in <module>
  File "bettersis/bettersis.py", line 651, in main
  File "logging/__init__.py", line 1378, in info
  File "logging/__init__.py", line 1514, in _log
  File "logging/__init__.py", line 1524, in handle
  File "logging/__init__.py", line 1586, in callHandlers
  File "logging/__init__.py", line 894, in handle
  File "logging/handlers.py", line 944, in emit
Message: '[PLATFORM] Using OS: Linux-5.10.76-linuxkit-x86_64-with-debian-buster-sid'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "logging/handlers.py", line 934, in emit
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 855, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 937, in emit
  File "logging/handlers.py", line 866, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "bettersis/bettersis.py", line 684, in <module>
  File "bettersis/bettersis.py", line 652, in main
  File "logging/__init__.py", line 1378, in info
  File "logging/__init__.py", line 1514, in _log
  File "logging/__init__.py", line 1524, in handle
  File "logging/__init__.py", line 1586, in callHandlers
  File "logging/__init__.py", line 894, in handle
  File "logging/handlers.py", line 944, in emit
Message: '[PLATFORM] OS version: #1 SMP Mon Nov 8 10:21:19 UTC 2021'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "logging/handlers.py", line 934, in emit
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 855, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 937, in emit
  File "logging/handlers.py", line 866, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "bettersis/bettersis.py", line 684, in <module>
  File "bettersis/bettersis.py", line 653, in main
  File "logging/__init__.py", line 1378, in info
  File "logging/__init__.py", line 1514, in _log
  File "logging/__init__.py", line 1524, in handle
  File "logging/__init__.py", line 1586, in callHandlers
  File "logging/__init__.py", line 894, in handle
  File "logging/handlers.py", line 944, in emit
Message: '[PLATFORM] Python version: 3.7.5'
Arguments: ()

 ██████╗ ███████╗████████╗████████╗███████╗██████╗ ███████╗██╗███████╗ 
 ██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗██╔════╝██║██╔════╝ 
 ██████╔╝█████╗     ██║      ██║   █████╗  ██████╔╝███████╗██║███████╗ 
 ██╔══██╗██╔══╝     ██║      ██║   ██╔══╝  ██╔══██╗╚════██║██║╚════██║ 
 ██████╔╝███████╗   ██║      ██║   ███████╗██║  ██║███████║██║███████║ 
 ╚═════╝ ╚══════╝   ╚═╝      ╚═╝   ╚══════╝╚═╝  ╚═╝╚══════╝╚═╝╚══════╝ 

 ===================================================================== 

                              DISCLAIMER:                              
 BetterSIS, this software, controls SIS in the background and tries to 
 provide modern features                                               
 (such as command history, suggestions and autocompletion)             
 and small improvements to SIS itself. (like the simulate improvement) 
 > SIS is a tool for synthesis and optimization of sequential circuits 

 I'm not affiliated with the SIS developers in any way.                
 You can read more about SIS here:                                     
 https://jackhack96.github.io/logic-synthesis/sis.html                 

 ===================================================================== 

 BetterSIS version:    2021-09-07 1.2.1
 BetterSIS repository: https://github.com/mario33881/betterSIS
 Siswrapper version:   2021-09-05 1.2.2
 Running in the background:  None
--- Logging error ---
Traceback (most recent call last):
  File "logging/handlers.py", line 934, in emit
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 855, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 937, in emit
  File "logging/handlers.py", line 866, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "bettersis/bettersis.py", line 684, in <module>
  File "bettersis/bettersis.py", line 664, in main
  File "bettersis/bettersis.py", line 109, in __init__
  File "bettersis/bettersis.py", line 172, in show_msg_on_startup
  File "logging/__init__.py", line 1378, in info
  File "logging/__init__.py", line 1514, in _log
  File "logging/__init__.py", line 1524, in handle
  File "logging/__init__.py", line 1586, in callHandlers
  File "logging/__init__.py", line 894, in handle
  File "logging/handlers.py", line 944, in emit
Message: '[STARTUP_MESSAGE] Showing software versions (BetterSIS: 2021-09-07 1.2.1, Siswrapper: 2021-09-05 1.2.2, SIS: None)'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "bettersis/bettersis.py", line 664, in main
  File "bettersis/bettersis.py", line 126, in __init__
  File "bettersis/bettersis.py", line 191, in main
  File "bettersis/siscompleter.py", line 266, in get_siscompleter
  File "bettersis/siscompleter.py", line 132, in get_commands
AttributeError: 'NoneType' object has no attribute 'split'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 934, in emit
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 855, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logging/handlers.py", line 937, in emit
  File "logging/handlers.py", line 866, in _connect_unixsocket
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "bettersis/bettersis.py", line 684, in <module>
  File "bettersis/bettersis.py", line 671, in main
  File "logging/__init__.py", line 1425, in critical
  File "logging/__init__.py", line 1514, in _log
  File "logging/__init__.py", line 1524, in handle
  File "logging/__init__.py", line 1586, in callHandlers
  File "logging/__init__.py", line 894, in handle
  File "logging/handlers.py", line 944, in emit
Message: '[MAIN_FUNC] This error was unexpected and interrupted the program: '
Arguments: ()

Traceback:

  File "bettersis/bettersis.py", line 664, in main
  File "bettersis/bettersis.py", line 126, in __init__
  File "bettersis/bettersis.py", line 191, in main
  File "bettersis/siscompleter.py", line 266, in get_siscompleter
  File "bettersis/siscompleter.py", line 132, in get_commands

AttributeError: 'NoneType' object has no attribute 'split'

Please, (if someone didn't post this error already) create a Github Issue here: 'https://github.com/mario33881/betterSIS/issues'
and share the '/var/log/pybettersis/pybettersis.log' log file
to help the developer to fix the problem

> If you are NOT using the DEB package version, execute this command:
> 'cat /var/log/syslog | grep "bettersis" > pybettersis.log'
> to create the log file inside the current directory.

You should also make sure that no private information is present in the log file before publishing it
# 
mario33881 commented 2 years ago

Buongiorno, scusa ma non ho potuto risponderti prima.

Gli errori "OSError: [Errno 9] Bad file descriptor" e "FileNotFoundError: [Errno 2] No such file or directory" molto probabilmente sono dovuti al fatto che il processo rsyslog non e' in esecuzione e quindi quando python cerca di scrivere i log fallisce.

E' possibile avviarlo con il comando service rsyslog start.

L'errore "AttributeError: 'NoneType' object has no attribute 'split'" e' risolvibile installando libreadline7.

Senza libreadline7 sis 1.4 da errore "sis: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory" e quindi quando python prova ad eseguire sis per recuperare l'output del comando help non ci riesce. Siccome il programma si aspetta di aver ricevuto dall'output dell'help (interpretato e restituito da siswrapper) una stringa ma invece riceve None tenta di richiamare il metodo split facendo lanciare l'errore.

Ho caricato sul repository un Dockerfile e su docker hub l'immagine ottenuta dalla build per eseguire betterSIS con docker.

Per eseguirla e' sufficiente eseguire il comando docker run -it --rm -v "$(pwd):/data" mario33881/bettersis nella cartella che contiene i file da leggere in input con betterSIS.

Ho preferito utilizzare la versione 1.3.6 di SIS anziche' la versione 1.4 perche' dovrebbe contenere meno bug.

Per evitare possibili problemi con PyInstaller ho deciso di eseguire direttamente betterSIS con python all'interno del container.