{"id":23503695,"url":"https://github.com/csdms/bmi-example-python-grpc4bmi","last_synced_at":"2026-05-02T02:35:41.116Z","repository":{"id":233950428,"uuid":"788078005","full_name":"csdms/bmi-example-python-grpc4bmi","owner":"csdms","description":"Run the Python BMI example through grpc4bmi","archived":false,"fork":false,"pushed_at":"2024-09-24T21:21:16.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T17:56:19.513Z","etag":null,"topics":["bmi","csdms","docker","grpc4bmi","python"],"latest_commit_sha":null,"homepage":"https://bmi.csdms.io","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csdms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-17T18:24:21.000Z","updated_at":"2024-11-22T18:47:40.000Z","dependencies_parsed_at":"2024-12-25T10:00:29.376Z","dependency_job_id":null,"html_url":"https://github.com/csdms/bmi-example-python-grpc4bmi","commit_stats":null,"previous_names":["mdpiper/bmi-example-python-grpc4bmi","csdms/bmi-example-python-grpc4bmi"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-grpc4bmi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-grpc4bmi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-grpc4bmi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-grpc4bmi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csdms","download_url":"https://codeload.github.com/csdms/bmi-example-python-grpc4bmi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252532774,"owners_count":21763471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bmi","csdms","docker","grpc4bmi","python"],"created_at":"2024-12-25T08:30:50.116Z","updated_at":"2026-05-02T02:35:41.063Z","avatar_url":"https://github.com/csdms.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Basic Model Interface](https://img.shields.io/badge/CSDMS-Basic%20Model%20Interface-green.svg)](https://bmi.readthedocs.io/)\n[![DOI](https://zenodo.org/badge/788078005.svg)](https://doi.org/10.5281/zenodo.17204647)\n[![Test](https://github.com/csdms/bmi-example-python-grpc4bmi/actions/workflows/test.yml/badge.svg)](https://github.com/csdms/bmi-example-python-grpc4bmi/actions/workflows/test.yml)\n[![Docker Hub](https://github.com/csdms/bmi-example-python-grpc4bmi/actions/workflows/release.yml/badge.svg)](https://github.com/csdms/bmi-example-python-grpc4bmi/actions/workflows/release.yml)\n![Docker Image Version](https://img.shields.io/docker/v/csdms/bmi-example-python-grpc4bmi)\n\n# bmi-example-python-grpc4bmi\n\nSet up a [grpc4bmi](https://grpc4bmi.readthedocs.io) server\nto run a containerized version\nof the [Basic Model Interface](https://bmi.readthedocs.io) (BMI)\n[Python example](https://github.com/csdms/bmi-example-python).\n\n## Build\n\nBuild the server image locally with:\n```\ndocker build --tag bmi-example-python-grpc4bmi .\n```\nThe image is built on the [csdms/grpc4bmi](https://hub.docker.com/r/csdms/grpc4bmi) base image,\nwhich is built on the [condaforge/miniforge3](https://hub.docker.com/r/condaforge/miniforge3) base image.\nThe OS is Linux/Ubuntu.\nThe grpc4bmi Python server,\nas well as the Python BMI mappings and example\n(consisting of the *Heat* model and a BMI implementation, *BmiHeat*)\nare installed in `CONDA_DIR=/opt/conda`.\n\n## Run\n\nUse the grpc4bmi Docker client to access the BMI methods of the containerized model.\n\nInstall grpc4bmi with *pip*:\n```\npip install grpc4bmi\n```\nThen, in a Python session, access the *Heat* model in the image built above with:\n```python\nfrom grpc4bmi.bmi_client_docker import BmiClientDocker\n\nIMAGE_NAME = \"bmi-example-python-grpc4bmi\"\nm = BmiClientDocker(image=IMAGE_NAME, image_port=55555, work_dir=\".\")\nm.get_component_name()\n\ndel m  # stop container cleanly\n```\n\nIf the image isn't found locally, it's pulled from Docker Hub\n(e.g., try substituting `IMAGE_NAME=\"csdms/bmi-example-python-grpc4bmi\"` above).\n\nFor more in-depth examples of running the *Heat* model from grpc4bmi,\nsee the [examples](./examples) directory.\n\n## Developer notes\n\nA versioned, multiplatform image built from this repository is hosted on Docker Hub\nat [csdms/bmi-example-python-grpc4bmi](https://hub.docker.com/r/csdms/bmi-example-python-grpc4bmi).\nWhen this repository is tagged,\nan image is automatically built and pushed to Docker Hub\nby the [release](./.github/workflows/release.yml) CI workflow.\nTo manually build and push an update, run:\n```\ndocker buildx build --platform linux/amd64,linux/arm64 -t csdms/bmi-example-python-grpc4bmi:latest --push .\n```\nA user can pull this image from Docker Hub with:\n```\ndocker pull csdms/bmi-example-python-grpc4bmi\n```\noptionally with the `latest` tag or with a version tag.\n\n## What are the Basic Model Interface and grpc4bmi?\n\nThe Basic Model Interface (BMI) is a set of functions for querying, modifying, running, and coupling models.\nLearn more at https://bmi.csdms.io/.\n\ngrpc4bmi is a [gRPC](https://grpc.io/) wrapper for a model with a BMI.\nLearn more at https://grpc4bmi.readthedocs.io/.\n\n## Acknowledgment\n\nThis work is supported by the U.S. National Science Foundation under Award No. [2103878](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2103878), *Frameworks: Collaborative Research: Integrative Cyberinfrastructure for Next-Generation Modeling Science*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsdms%2Fbmi-example-python-grpc4bmi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsdms%2Fbmi-example-python-grpc4bmi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsdms%2Fbmi-example-python-grpc4bmi/lists"}