Gridworks Base
Project description
Gridworks Base
This repository serves two purposes:
-
it provides the base class for the default GridWorks actor using pika, the main python package for interacting with RabbitMQ
- install the
gwbase
package via
$ pip install gridworks-base
- install the
-
It provides scripts for runnig a local dev rabbit broker, which is the recommended way to develop.
Dev Rabbit Broker
All GridWorks repos require a running rabbitMQ dev broker running to pass tests or run dev simulations. Instructions for setting it up:
- Make sure you have docker installed
- Know whether your computer architecture is x86 or arm
- Start the dev broker in a docker container:
- x86 architecture:
./x86.sh
- arm architecture:
./arm.sh
- x86 architecture:
Tests for success:
- go to http://0.0.0.0:15672/ - it should look like this:
- Username/password for the dev rabbit broker: smqPublic/smqPublic
- [More info]](https://gridworks.readthedocs.io/en/latest/gridworks-broker.html) on the GridWorks use of rabbit brokers
- tests pass
poetry install
poetry shell
pytest -v
This, and most other GridWorks repositories, use poetry installed via pipx to handle package management. They are also kicked off via Cookiecutter, which also sets up a template for continuous integration in github actions, package publishing on pypi as well as documentation at pypi.
TODO: EXPLAIN MORE ABOUT CI, BLACK, NOX, DEPENDABOT. A MORE LINKS TO WHY THIS STUFF IS IMPORTANT IN A PRODUCTION SYSTEM.
Hello Rabbit
Quick start for seeing how the actor base can send a message on the rabbit broker. Run hello_rabbit.py (after starting up the dev rabbit broker, see dev broker above) and look at the src/gwbase/actor_base.py
code.
TODO: explain more about what this code does. Links to the type registroy, code generation. TODO: create a second hello script with two actors sending heartbeats back and forth.
Distributed under the terms of the MIT license, Gridworks Base is free and open source software.
Credits
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gridworks_base-0.1.0.tar.gz
.
File metadata
- Download URL: gridworks_base-0.1.0.tar.gz
- Upload date:
- Size: 49.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d9d5a121622ddea002918ad6b07055853d102edc0bf6bc1d2b11e502d0f8da4 |
|
MD5 | 7707153d3b8e6894005941a5a93de592 |
|
BLAKE2b-256 | decafd5c254626857f10d8cb6a23ab3bb2fcd6e7ca246a15984edc9346964e4a |
File details
Details for the file gridworks_base-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: gridworks_base-0.1.0-py3-none-any.whl
- Upload date:
- Size: 86.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd865bdee7df24ef84f1e5e2091e67fcae6a6efbff68aa4a5a6595356297fa0f |
|
MD5 | 2b57f4f126e5ba6b43b6ff72c516ca49 |
|
BLAKE2b-256 | a8f27759f57c621d98fb94ed5c085befd50523c99b4a2c1d1c34d3d50c897849 |