(python)进程管理器

pman的Python项目详细描述


https://badge.fury.io/py/pman.svghttps://travis-ci.org/FNNDSC/pman.svg?branch=masterhttps://img.shields.io/badge/python-3.5%2B-blue.svg

Overview

这个存储库证明了pman–一个流程管理器。

pman

最简单的是,pman管理进程,即由底层系统运行的程序或应用程序。通常,这些进程是命令行应用程序(即没有gui),通常根本不与用户真正交互。pman的主要目的是通过http为其他软件代理提供执行进程的能力。

最初,pman设计用于跟踪在本地系统上执行的简单进程。此外,pman还记录它已执行的进程的当前和历史状态,因此能够响应有关进程的查询。pman可以处理的一些查询是

  • state:作业<;xyz>;是否仍在运行?
  • result:job中的stdout(或stderr)是什么<;xyz>;?
  • control:终止作业<;xyz>;

pman还在作业文件系统和作业状态中维护一个持久的人类可读/友好数据库。

但是,pman的当前版本可以使用基于容器的后端(swarm和openshift)来执行进程。在这些情况下,跟踪作业的内部数据库变得多余。未来版本的pman可能会降低本地/内部数据库跟踪的成本。

Installation

安装相对简单,我们建议使用python虚拟环境或docker。

Python Virtual Environment

在ubuntu上,安装python virtual environment creator

sudo apt install virtualenv virtualenvwrapper

然后,为您的虚拟环境创建一个目录,例如:

mkdir ~/python-envs

您可能需要将这两行代码添加到.bashrc文件中:

exportWORKON_HOME=~/python-envs
source /usr/local/bin/virtualenvwrapper.sh

(注意,根据发行版的不同,virtualenvwrapper.sh路径可能是

/usr/share/virtualenvwrapper/virtualenvwrapper.sh

然后,您可以获得.bashrc源代码并创建一个新的python3虚拟环境:

source .bashrc
mkvirtualenv --python=python3 python_env

激活或“输入”虚拟环境:

workon python_env

要停用虚拟环境:

deactivate

Using the ^{tt1}$ dock

不过,最简单的选择是使用fnndsc/pmandock。

docker pull fnndsc/pman

然后运行

docker run  --name pman         \
            -v /home:/Users     \
            --rm -ti            \
            fnndsc/pman         \
            --rawmode 1 --http  \
            --port 5010\
            --listeners 12

Usage

pman用法

有关pman的详细信息,请参见pman wiki page

ARGS

    [--ip <IP>]

    The IP interface on which to listen.

    [--port <port>]
    The port on which to listen. Defaults to '5010'.

    [--protocol <protcol>]
    The protocol to interpret. Defaults to 'tcp'.

    [--rawmode]
    Internal zmq socket server mode. A value of '1' is usually used
    here.

    [--listeners <numberOfListenerThreads>]
    The number of internal threads to which requests are dispatched.

    [--http]
    Send return strings as HTTP formatted replies with content-type html.

    [--debugToFile]
    If specified, send debugging results to file.

    [--debugToFile <file>]
    In conjunction with --debugToFile, file which will receive debugging info.

    [--listenerSleep <time>]
    A small delay in the listener loop to prevent busy-wait.
    Default is 0.1 seconds.

    [--DBsavePeriod <time>]
    The periodicity in seconds for the internal DB save.

    [--enableTokenAuth]
    Enables token based authorization and can be configured to look for a .ini
    file or an openshift secret.

    [--tokenPath <tokenPath>]
    Specify the absolute path to the token in the file system.
    By default, this looks for the pfiohConfig.ini file in the current working directory.

    [-x|--desc]
    Provide an overview help page.

    [-y|--synopsis]
    Provide a synopsis help summary.

    [--version]
    Print internal version number and exit.

    [-v|--verbosity <level>]
    Set the verbosity level. "0" typically means no/minimal output. Allows for
    more fine tuned output control as opposed to '--quiet' that effectively
    silences everything.

    --container-env <env>
    The container env within which to run.

EXAMPLES

使用12个侦听器启动pman

pman                                                        \\
        --ip 127.0.0.1                                      \\
        --port 5010\\
        --rawmode 1\\
        --http                                              \\
        --listeners 12\\
        --verbosity 1

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
我们应该在测试java代码时模拟黄瓜测试吗。我们应该在多大程度上使用黄瓜?   Hibernate Weblogic 10.3.4 java。lang.NoSuchMethodError:javax/persistence/spi/PersistenceUnitInfo。getValidationMode()Ljavax/persistence/ValidationMode;   java如何在main()中访问私有静态实例变量   java JMockit无法模拟类的公共final字段   java是否可以返回特定控制器操作的输出(html)?   java如何返回正确类型的列表?   rest-OpenUI/Swagger-java-to-API   java组织。springframework。豆。工厂NoSuchBeanDefinitionException或加载ApplicationContext失败   java使用POST将参数从JSP发送到Servlet   java如何监听特定的按钮按下和主视图用户交互?   java如何让gradle在本地maven repo中覆盖库?   如何在Java中“合并”两个URI?   java如何制作一个方法来移动数组中的字符?   使用来自java的命令启动powershell窗口   java垃圾收集器和匿名类   java如何为CellTable(GWT 2.4)中的ImageResourceCell创建PanelPopup?