{ "info": { "author": "Gijs van den Oord", "author_email": "g.vandenoord@esciencecenter.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "[![DOI](https://zenodo.org/badge/130237165.svg)](https://zenodo.org/badge/latestdoi/130237165)\n\n# grpc4bmi\n\n## Purpose\n\nThis software allows you to wrap your BMI implementation (https://github.com/csdms/bmi) in a server process and communicate with it via the included python client. The communication is serialized to protocol buffers by GRPC (https://grpc.io/) and occurs over network ports.\n\n## Installation\n\nOptionally, create your virtual environment and activate it, Then, run\n```\npip install grpc4bmi\n```\non the client (python) side. If your server model is implemented in Python, do the same in the server environment (e.g. docker container). If the model is implemented in R, run instead\n```bash\npip install grpc4bmi[R]\n```\nin the server environment. For bleeding edge version from GitHub use\n```bash\npip install git+https://github.com/eWaterCycle/grpc4bmi.git#egg=grpc4bmi\n```\nFinally if the model is implemented in C or C++, clone this git repo and run\n```bash\nmake ; make install\n```\nin the cpp folder.\n\n## Usage\n\n### Model written in Python\nFor inspiration look at the example in the test directory. To start a server process that allows calls to your BMI implementation, type\n```bash\nrun-bmi-server --name .. --port --path \n```\nwhere ```, ``` are the python package and module containing your implementation, `````` is your \nbmi model class name, `````` is any available port on the host system, and optionally `````` denotes an \nadditional path that should be added to the system path to make your implementation work. The name option above is \noptional, and if not provided the script will look at the environment variables ```BMI_PACKAGE```, ```BMI_MODULE``` and \n```BMI_CLASS```. Similarly, the port can be defined by the environment variable ```BMI_PORT```.\nThis software assumes that your implementation constructor has no parameters.\n\n### Model written in C/C++ (beta)\nCreate an executable along the lines of cpp/run-bmi-server.cc. You can copy the file and replace the function\n```C++\nBmi* create_model_instance()\n{\n /* Return your new BMI instance pointer here... */\n}\n```\nwith the instantiation of your model BMI. The model needs to implement the csdms BMI for C, but you may also implement our more object-oriented C++ interface [BmiCppExtension](https://github.com/eWaterCycle/grpc4bmi/blob/master/cpp/bmi_cpp_extension.h).\n\n### Model written in R\nThe grpc4bmi Python package can also run BMI models written in R if the model is a subclass of [AbstractBmi](https://github.com/eWaterCycle/bmi-r/blob/master/R/abstract-bmi.R#L9)\nSee https://github.com/eWaterCycle/bmi-r for instruction on R and Docker.\n\nRun the R model a server with\n```bash\nrun-bmi-server --lang R [--path ] --name [::] --port \n```\n\nFor example with [WALRUS](https://github.com/eWaterCycle/grpc4bmi-examples/tree/master/walrus) use\n```bash\nrun-bmi-server --lang R --path ~/git/eWaterCycle/grpc4bmi-examples/walrus/walrus-bmi.r --name WalrusBmi --port 50051\n```\n\n### The client side\nThe client side has only a Python implementation. The default BMI client assumes a running server process on a given port.\n```python\nfrom grpc4bmi.bmi_grpc_client import BmiClient\nmymodel = BmiClient(grpc.insecure_channel(\"localhost:\"))\nprint mymodel.get_component_name()\nmymodel.initialize()\n...further BMI calls...\n```\n\nThe package contains also client implementation that own the server process, either as a python subprocess or a docker \nimage running the ```run-bmi-server``` script. For instance\n```python\nfrom grpc4bmi.bmi_client_subproc import BmiClientSubProcess\nmymodel = BmiClientSubProcess(..)\n```\nwill automatically launch the server in a sub-process and\n```python\nfrom grpc4bmi.bmi_client_subproc import BmiClientDocker\nmymodel = BmiClientDocker(,)\n\n```\nwill launch a docker container, assuming that a GRPC BMI server will start and exposes the port ``````.\n\n## Development: generating the grpc code\n\nWhen developers change the proto-file, it is necessary to install grpc tools python packages in your python environment:\n```bash\npip install -r requirements.txt\npip install -e .\n# For R integration also install the R extras with\npip install -e .[R]\n\n```\nand install the C++ runtime and `protoc` command as described in .\nAfter this, simply executing the `proto_gen.sh` script should do the job. \n\n## Future work\n\nMore language bindings are underway.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eWaterCycle/grpc4bmi", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "grpc4bmi", "package_url": "https://pypi.org/project/grpc4bmi/", "platform": "", "project_url": "https://pypi.org/project/grpc4bmi/", "project_urls": { "Homepage": "https://github.com/eWaterCycle/grpc4bmi" }, "release_url": "https://pypi.org/project/grpc4bmi/0.2/", "requires_dist": [ "grpcio", "grpcio-reflection", "protobuf", "numpy", "docker", "basic-modeling-interface", "futures; python_version == \"2.7\"", "rpy2; extra == 'R'" ], "requires_python": "", "summary": "Run your BMI implementation in a separate process and expose it as BMI-python with GRPC", "version": "0.2" }, "last_serial": 4377406, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f582fb5160691ae2d38f17a1cc0e4a5a", "sha256": "69aafdee6137f5e0c441d87ee2c5b27011cd4a59d3880e364663853abe036145" }, "downloads": -1, "filename": "grpc4bmi-0.1.tar.gz", "has_sig": false, "md5_digest": "f582fb5160691ae2d38f17a1cc0e4a5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17764, "upload_time": "2018-05-20T08:40:56", "url": "https://files.pythonhosted.org/packages/52/32/550a0f621b01bc0479d5aff236deb357aa89d76c2f39ff371afd2fd62658/grpc4bmi-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ece43c4c19ac1e36c53adbb3785854c5", "sha256": "815ffa69af0863783436dde30de40ad8f5315bce0c619115a455d2accc74456d" }, "downloads": -1, "filename": "grpc4bmi-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ece43c4c19ac1e36c53adbb3785854c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17918, "upload_time": "2018-05-21T10:13:38", "url": "https://files.pythonhosted.org/packages/64/7e/dd39c1c924461eeac807031a3e48df38f3723e45d0ef4933b63d6cb7829a/grpc4bmi-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "fd6961f26b3da38972d7a3e500ff406d", "sha256": "b1debbd8e45abc4c85fb4810c09431743837a3901e88dddad1820b80b525114c" }, "downloads": -1, "filename": "grpc4bmi-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fd6961f26b3da38972d7a3e500ff406d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18338, "upload_time": "2018-05-22T12:32:08", "url": "https://files.pythonhosted.org/packages/78/0e/a1950dd0f7bba1856b7c07a9c5aa6ce57a0209f3e402e05b8838e1d6a0f7/grpc4bmi-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9c4101564534ac2b88b9c22a48c9a9b7", "sha256": "812b92bbbb84a33768085cc8a4fcda77ac7aa4c867a06145ae559c0fbadea0ca" }, "downloads": -1, "filename": "grpc4bmi-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9c4101564534ac2b88b9c22a48c9a9b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18399, "upload_time": "2018-05-22T15:56:58", "url": "https://files.pythonhosted.org/packages/14/8f/bca587ff1d5e3b02cb5cb2dfa9e4a0e29444003e4c9afacbdfb98d8abd9e/grpc4bmi-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "fb34830985a89e0d85c378de71a5e961", "sha256": "ed6d87366fc1e2802e74bb7d9917210816098686d0962e9fba08d63fd75d1d7a" }, "downloads": -1, "filename": "grpc4bmi-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "fb34830985a89e0d85c378de71a5e961", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24864, "upload_time": "2018-10-15T12:35:27", "url": "https://files.pythonhosted.org/packages/e2/d0/ae22553f08fbb4c56f0f54519b7f2c66c4b7898d92d4813a911e6b461d9a/grpc4bmi-0.1.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf6c19618956db42ca92d42b6821314c", "sha256": "e64fa8ae9b490a8900a7a26e46801be02f6b93b6968f6be8286df8b5aef0f7a7" }, "downloads": -1, "filename": "grpc4bmi-0.1.4.tar.gz", "has_sig": false, "md5_digest": "cf6c19618956db42ca92d42b6821314c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20482, "upload_time": "2018-10-15T12:35:28", "url": "https://files.pythonhosted.org/packages/e2/48/a0b2261fa52181a6520d6f80a1c0cfcd219eee480e75d29e0802050569ee/grpc4bmi-0.1.4.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "2bcb74f08136b6095b241bfb6f6333d2", "sha256": "a0eea6e85cbaf5ddf61c9504952e474ae98cc09df2680d1aa69803650144f979" }, "downloads": -1, "filename": "grpc4bmi-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "2bcb74f08136b6095b241bfb6f6333d2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24840, "upload_time": "2018-10-15T12:45:45", "url": "https://files.pythonhosted.org/packages/b7/5f/c34b8e1c9c861cd221ec90dfc108602fb1108b9944b3e1bd2c8b4f75f3f4/grpc4bmi-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48cd568136e8c849b38c6430574f10c8", "sha256": "a7ade3950d5cdefde16ba4307b292d4196c7fc51baa3f489d244c9c9d892bd00" }, "downloads": -1, "filename": "grpc4bmi-0.2.tar.gz", "has_sig": false, "md5_digest": "48cd568136e8c849b38c6430574f10c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20476, "upload_time": "2018-10-15T12:45:47", "url": "https://files.pythonhosted.org/packages/e6/6d/7760b5ad1bbcdfd73fca17903e2703250a8a36f228b707ee528db6f32d07/grpc4bmi-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2bcb74f08136b6095b241bfb6f6333d2", "sha256": "a0eea6e85cbaf5ddf61c9504952e474ae98cc09df2680d1aa69803650144f979" }, "downloads": -1, "filename": "grpc4bmi-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "2bcb74f08136b6095b241bfb6f6333d2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24840, "upload_time": "2018-10-15T12:45:45", "url": "https://files.pythonhosted.org/packages/b7/5f/c34b8e1c9c861cd221ec90dfc108602fb1108b9944b3e1bd2c8b4f75f3f4/grpc4bmi-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48cd568136e8c849b38c6430574f10c8", "sha256": "a7ade3950d5cdefde16ba4307b292d4196c7fc51baa3f489d244c9c9d892bd00" }, "downloads": -1, "filename": "grpc4bmi-0.2.tar.gz", "has_sig": false, "md5_digest": "48cd568136e8c849b38c6430574f10c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20476, "upload_time": "2018-10-15T12:45:47", "url": "https://files.pythonhosted.org/packages/e6/6d/7760b5ad1bbcdfd73fca17903e2703250a8a36f228b707ee528db6f32d07/grpc4bmi-0.2.tar.gz" } ] }