N
N
Nikolay Baranenko2020-10-28 21:58:53
linux
Nikolay Baranenko, 2020-10-28 21:58:53

What is the correct way to run python scrpt using parallel?

I want to run Flask_python and scheduler in parallel in one container. I

found some parallel utility and

tried to run it like this

(source venv/bin/activate && gunicorn -w 1 -b 0.0.0.0:8228 wsgi:scope; source venv/bin/activate && python scope/checkers/main_scheduler.py) | parallel


the first part of source venv/bin/activate && gunicorn -w 1 -b 0.0.0.0:8228 wsgi:scope runs fine,
the second part of source venv/bin/activate && python scope/checkers/main_scheduler.py throws errors

/usr/bin/bash: -c: строка 0: синтаксическая ошибка рядом с неожиданным маркером «(»
/usr/bin/bash: -c: строка 0: `2020-10-28 21:55:26,313 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1'
/usr/bin/bash: -c: строка 0: синтаксическая ошибка рядом с неожиданным маркером «(»
/usr/bin/bash: -c: строка 0: `2020-10-28 21:55:26,313 INFO sqlalchemy.engine.base.Engine ()'
/usr/bin/bash: -c: строка 0: синтаксическая ошибка рядом с неожиданным маркером «(»
/usr/bin/bash: -c: строка 0: `2020-10-28 21:55:26,313 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1'


separately tried Flask - norms
$ (source venv/bin/activate && gunicorn -w 1 -b 0.0.0.0:8228 wsgi:scope) | parallel
[2020-10-28 21:55:09 +0300] [27457] [INFO] Starting gunicorn 20.0.4
[2020-10-28 21:55:09 +0300] [27457] [INFO] Listening at: http://0.0.0.0:8228 (27457)
[2020-10-28 21:55:09 +0300] [27457] [INFO] Using worker: sync
[2020-10-28 21:55:09 +0300] [27465] [INFO] Booting worker with pid: 27465
/home/drno/IdeaProjects/inclouds/msk_scope/venv/lib/python3.8/site-packages/flask_marshmallow/__init__.py:26: UserWarning: Flask-SQLAlchemy integration requires marshmallow-sqlalchemy to be installed.
  warnings.warn(
^C[2020-10-28 21:55:10 +0300] [27457] [INFO] Handling signal: int
[2020-10-28 21:55:11 +0300] [27465] [INFO] Worker exiting (pid: 27465)
[2020-10-28 21:55:11 +0300] [27457] [INFO] Shutting down: Master


python script in errors...

$ (source venv/bin/activate && python scope/checkers/main_scheduler.py) | parallel
/usr/bin/bash: -c: line 0: syntax error near unexpected token '('
/usr/bin/bash: -c: line 0: `2020-10-28 21:55:26,313 INFO sqlalchemy. engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1'
/usr/bin/bash: -c: line 0: syntax error near unexpected token '('
/usr/bin/bash : -c: line 0: `2020-10-28 21:55:26,313 INFO sqlalchemy.engine.base.Engine ()'
/usr/bin/bash: -c: line 0: syntax error near unexpected token '( »
/usr/bin/bash: -c: line 0: `2020-10-28 21:55:26,313 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns'
/usr/bin/bash: -c: line 0: syntax error near unexpected token '('

What is the correct way to run python scrpt using parallel?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question