Skip to content

Commit

Permalink
Merge pull request #48 from vivarium-collective/remove-mongo
Browse files Browse the repository at this point in the history
remove mongo emitter
  • Loading branch information
eagmon authored Feb 28, 2024
2 parents afeec05 + 21c9fc4 commit f50e4e7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 727 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest

services:
mongodb:
image: mongo
ports:
- 27017:27017


steps:
- name: Check out repository
uses: actions/checkout@main
Expand Down
71 changes: 0 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,77 +34,6 @@ You can install `process-bigraph` using pip:
pip install process-bigraph
```

MongoDB
-------

We use a MongoDB database to store the data collected from running
simulations via the `DatabaseEmitter` class. The use of this class is specified in the
`'emitter'` section of the instance declaration for a given process as such:

...,
'emitter': {
'_type': 'step',
'address': 'local:database-emitter',
'config': {
'ports': {
'inputs': {
'table': 'string',

. This can be a remote server, but for this guide we will
run a MongoDB server locally.

**Note**: MongoDB is only required if you want to store data in MongoDB
or want to run experiments that do so via the declaration shown above. You don't need MongoDB to work
through this guide.

*Check Installation*

$ mongod --version
db version v4.2.3
...

Make sure you see a version at least 3.2.

*Install*

If you are on macOS, you can install MongoDB using [Homebrew](https://brew.sh). You will need to add the MongoDB tap following the
instructions [here](https://github.com/mongodb/homebrew-brew).

If you are on Linux, see the MongoDB documentation's [instructions](https://docs.mongodb.com/manual/administration/install-on-linux/).

*Setup*

You can get a MongoDB server up and running locally any number of ways.
Here is one:

1. Create a folder ``process_bigraph_work/mongodb``. This is where MongoDB will
store the database We store the database here instead of at the
default location in ``/usr/local/var/mongodb`` to avoid permissions
issues if you are not running as an administrator.
2. Make a copy of the ``mongod`` configuration file so we can make
changes:

$ cp /usr/local/etc/mongod.conf process_bigraph_work/mongod.conf

Note that your configuration file may be somewhere slightly
different. Check the MongoDB documentation for your system.
3. In ``process_bigraph_work/mongod.conf`` change the path after ``dbPath:`` to
point to ``process_bigraph_work/mongodb``.
4. Create a shell script ``process_bigraph_work/mongo.sh`` with the following
content:

#!/bin/bash

mongod --config mongod.conf

5. Make the script executable:

$ chmod 700 process_bigraph_work/mongo.sh

6. Now you can launch MongoDB by running this script:

$ process_bigraph_work/mongo.sh

## Tutorial

To get started with Bigraph-viz, explore our resources:
Expand Down
2 changes: 0 additions & 2 deletions process_bigraph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import pprint

from process_bigraph.composite import Process, Step, Composite, ProcessTypes


__all__ = [
'Process',
'Step',
'Composite',
'core',
'pp',
'pf',
]
Expand Down
4 changes: 2 additions & 2 deletions process_bigraph/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from typing import Dict


from bigraph_schema import Edge, TypeSystem, get_path, validate_merge, establish_path, set_path, deep_merge
from bigraph_schema.registry import Registry
from bigraph_schema import Edge, TypeSystem, get_path, establish_path, set_path, deep_merge
from bigraph_schema.registry import Registry, validate_merge

from process_bigraph.protocols import local_lookup, local_lookup_module

Expand Down
Loading

0 comments on commit f50e4e7

Please sign in to comment.