{"id":23831958,"url":"https://github.com/csdms/bmi-example-python-docker","last_synced_at":"2025-02-22T03:14:31.294Z","repository":{"id":216571743,"uuid":"741612658","full_name":"csdms/bmi-example-python-docker","owner":"csdms","description":"The Python BMI example, Dockerized","archived":false,"fork":false,"pushed_at":"2024-09-24T21:15:04.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-02T14:16:37.854Z","etag":null,"topics":["bmi","csdms","docker","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-01-10T18:49:55.000Z","updated_at":"2024-11-22T18:48:04.000Z","dependencies_parsed_at":"2024-04-19T20:30:18.875Z","dependency_job_id":"bb67061b-aa83-4301-a6fa-26f0bb0bb87f","html_url":"https://github.com/csdms/bmi-example-python-docker","commit_stats":null,"previous_names":["mdpiper/bmi-example-python-docker","csdms/bmi-example-python-docker"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csdms%2Fbmi-example-python-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csdms","download_url":"https://codeload.github.com/csdms/bmi-example-python-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118427,"owners_count":19750491,"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","python"],"created_at":"2025-01-02T14:16:44.404Z","updated_at":"2025-02-22T03:14:31.267Z","avatar_url":"https://github.com/csdms.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bmi-example-python-docker\n\nThe [Python example](https://github.com/csdms/bmi-example-python)\nfor the [Basic Model Interface](https://bmi.readthedocs.io),\ndockerized.\n\n## Build the image\n\nBuild this example locally with:\n```\ndocker build --tag bmi-example-python .\n```\nThe image is based on the [csdms/bmi](https://hub.docker.com/r/csdms/bmi) image.\nThe OS is Linux/Ubuntu.\n`conda` and `mamba` are installed in `CONDA_DIR=opt/conda`,\nand the *base* environment is activated.\nThe Python BMI specification and example are installed into it.\n\n## Run a container\n\nRun a container from this image interactively:\n```\ndocker run -it bmi-example-python\n```\nThis starts a bash shell.\nStart a Python session to run the *heat* model through its BMI.\n```python\n\u003e\u003e\u003e from heat import BmiHeat\n\u003e\u003e\u003e x = BmiHeat()\n\u003e\u003e\u003e x.get_component_name()\n'The 2D Heat Equation'\n```\n\n### Run example notebooks through a container\n\nThe Python BMI example includes a set of [example notebooks](https://github.com/csdms/bmi-example-python/tree/master/examples).\nRun them through a container.\n```\ndocker run -i -t -p 8888:8888 bmi-example-python /bin/bash -c \"\\\n    mamba install jupyter -y --quiet \u0026\u0026 \\\n    jupyter notebook \\\n    --notebook-dir=/opt/bmi-example-python/examples \\\n    --ip='*' --port=8888 \\\n    --no-browser --allow-root\"\n```\nThis is a little tricky, but\nexamine the output of the Jupyter server after it starts;\nit will include an URL from *localhost* that includes a security token.\nCopy/paste this URL into a browser to view and run the example notebooks.\n\n## Developer notes\n\nA versioned, multiplatform image built from this repository is hosted on Docker Hub\nat [csdms/bmi-example-python](https://hub.docker.com/r/csdms/bmi-example-python/).\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:latest --push .\n```\nA user can pull this image from Docker Hub with:\n```\ndocker pull csdms/bmi-example-python\n```\noptionally with the `latest` tag or with a version tag.\n\n## What is the Basic Model Interface?\n\nThe Basic Model Interface (BMI) is a set of functions for querying, modifying, running, and coupling models.\nLearn more at https://bmi.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-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsdms%2Fbmi-example-python-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsdms%2Fbmi-example-python-docker/lists"}