circl / douglas-quaid Goto Github PK
View Code? Open in Web Editor NEWOpen source software for image correlation, distance and analysis
License: GNU General Public License v3.0
Open source software for image correlation, distance and analysis
License: GNU General Public License v3.0
Some steps in INSTALL are not reproducible, e.g. because the file they reference no longer exists:
/carlhauser_client pipenv run python3 ./core.py
/carlhauser_server pipenv run python3 ./core.py
Future functionality could also be verified using CI (e.g. travis-ci.com), that would contain the installation steps and trigger a build on each commit, providing an easy to check way of when/how the installation steps changed/which are broken.
While writing Ansible automation to deploy and evaluate this project, I encountered the following error when attempting to run the installed project using a systemd service unit.
0 Nov 08 08:33:31 carlhauser python3[12356]: 2019-11-08 08:33:31,605 - carlhauser_server.Processus.worker_process - INFO - ==> Worker 0 : Launched on processus=<subprocess.Popen object at 0x7f4f632099b0> worker_path=/usr/local/share/douglas-quaid/carlhauser_server/API/API_server.py start_time=2019-11-08 08:33:28.556908 status : running ...
1 Nov 08 08:33:32 carlhauser python3[12356]: =======================================================================================
2 Nov 08 08:33:32 carlhauser python3[12356]: Server is running and ready to accept queries (if no error shown upper than this line).
3 Nov 08 08:33:32 carlhauser python3[12356]: Press any key to stop ...
4 Nov 08 08:33:32 carlhauser python3[12356]: Traceback (most recent call last):
5 Nov 08 08:33:32 carlhauser python3[12356]: File "/usr/local/share/douglas-quaid/carlhauser_server/safe_launcher.py", line 49, in launch
6 Nov 08 08:33:32 carlhauser python3[12356]: input()
7 Nov 08 08:33:32 carlhauser python3[12356]: EOFError: EOF when reading a line
8 Nov 08 08:33:32 carlhauser python3[12356]: Critical problem during execution EOF when reading a line
9 Nov 08 08:33:32 carlhauser python3[12356]: Server is asked to stop, please wait until complete shutdown of the server by itself.
10 Nov 08 08:33:32 carlhauser python3[12356]: =======================================================================================
11 Nov 08 08:33:32 carlhauser python3[12356]: 2019-11-08 08:33:32,607 - __main__ - INFO - Stopping webservice ...
The service starts correctly, but once it reaches the code block here it fails with an EOFError
(no input in systemd started service).
The culprit is here:
time.sleep(1)
do_stop = False
while not do_stop and not auto_stop:
print("Press any key to stop ... ")
input()
print("Are you sure you want to stop ? [yes/no] ")
value = input()
if value == "yes":
do_stop = True
self._do_stop()
except KeyboardInterrupt:
print('Interruption detected')
try:
print('Handling interruptions ...')
self._do_stop()
# TODO : Handle interrupt and shutdown, and clean ...
sys.exit(0)
except SystemExit:
traceback.print_exc(file=sys.stdout)
except Exception as e:
traceback.print_exc(file=sys.stdout)
...
There is very little reason to actually keep the input()
present, since the KeyboardInterrupt
also handles the service stop attempts. A production friendly approach would benefit from removing the input()
section altogether.
I'm open to creating a pull request removing the input()
functionality altogether.
While analyzing logs on a development setup I noticed that a lot if information is passed to stdin using the print()
function. Some of the more crucial information (such as input check) did not even make it into logger facilities.
A preferable solution would be to use a dedicated (configurable) logger for each such output instead of the print()
functions (those should be removed). The default destination for the logging could be set as stdin
, which is by default captured on external systems.
Using logger allows to select the logging message granularity and allows easier debugging.
A setup.py
file for future production/standalone development VM is missing, but would be interesting from the deployment automation perspective.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.