Giter VIP home page Giter VIP logo

douglas-quaid's People

Contributors

adulau avatar bobavince avatar codacy-badger avatar dependabot[bot] avatar rafiot avatar steveclement avatar teebor-choka avatar vincent-circl avatar vincentfalc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

douglas-quaid's Issues

Detailed installation manual is out of date (use CI to verify it)

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.

Server input handling prohibits creating systemd service units

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.

Logging misses some information leaked to stdin

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.

Missing setup.py

A setup.py file for future production/standalone development VM is missing, but would be interesting from the deployment automation perspective.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.