simonsobs / sisock

Sisock ('saɪsɒk): streaming of Simons Obs. data over websockets for quicklook
Other
2 stars 0 forks source link

Dockerize each server for sisock/grafana demo #5

Closed BrianJKoopman closed 5 years ago

BrianJKoopman commented 5 years ago

This mostly just adds the Dockerfiles for containerizing each server for the sisock/grafana demo on grumpy. I've also added documentation for how to setup all the containers to README.md.

The change that would affect running this locally is within each of the servers. They used to all run locally, so they pointed to the localhost. Now they point to a hostname called sisock_crossbar. Name resolution is provided by the Docker bridge network that is setup when going through the README notes. This should be portable, so as long as you have Docker on your system you should be able to replicate all these steps and have a working demo accessible from localhost:3000.

We had discussed organizing things better. I had started to do so, but I think it would be beneficial to first rearrange the repo such that you can install sisock with pip, i.e. put code like sisock.py, hub.py, etc into a 'sisock' directory and create a setup.py (see for example how the ocs repo is organized). That way when creating the Docker containers one can install sisock for use in the servers (which I would put in a directory called servers/). Right now it's sort of dependent on sisock.py being in the same directory the servers are run for import. I'm happy to do that organization as well, if we agree it's a good plan.

ahincks commented 5 years ago

I've tested the dockerisation & it works well, and your plan for organisation sounds OK to me as well (i.e., putting things in "sisock" and "servers" directories—and probably also a "grafana" directory (or similar as well).

If you prefer, you can add those to this branch before merging the pull request, or do it in two steps. At any rate, I'll approve this current pull request, in case you want to merge it first and then reorganise.

BrianJKoopman commented 5 years ago

Thanks Adam. Just merged, will reorganize in separate commit.