simonsobs / sisock

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

Organize repo for pip install and Docker #7

Closed BrianJKoopman closed 5 years ago

BrianJKoopman commented 5 years ago

As indicated in #5, the repo should be organized so one can install sisock via pip install. This'll help clean up the repo w.r.t. the dockerization as well, allowing one to move the servers and their associated Dockerfiles to a separate directory.

BrianJKoopman commented 5 years ago

So packaging this is proving to be a bit more difficult than I thought it would be. I think it comes down to me not understanding what's going on in the crossbar configuration.

The actual packaging is fine, however once installed, trying to run crossbar results in it's failure to import hub.hub and exiting. I've pushed a branch a0055ac that does the packaging. @ahincks maybe you can take a look and see if it's an obvious fix? I'm going to deal with the repo in its flat structure for now.

Steps to reproduce would be to checkout the package branch and install with pip3 install --user -r requirements.txt .. Then try running crossbar start.

On a side note, I ran into a rather frustrating bug on grumpy where if I pip install crossbar more than once (which happens if you have crossbar installed already and you run with the requirements.txt file) pip segfaults. I honestly don't know what's going on there, but in trying to fix it I wrecked my pip installation.

BrianJKoopman commented 5 years ago

Trying again this morning I find that even moving only sisock.py to the sisock/ directory, leaving hub.py next to the .crossbar/ directory causes crossbar to fail. The traceback is pretty messy, but it looks like the culprit is:

File "/home/bjk49/git/sisock/hub.py", line 161, in hub\n    @wamp.register(sisock.uri("data_node.add"))\nbuiltins.AttributeError: module \'sisock\' has no attribute \'uri\'\n'],

This is the same error that gets produced on the a0055ac branch when you try to run from sisock import hub:

>>> from sisock import hub
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bjk49/git/sisock/sisock/hub.py", line 40, in <module>
    class hub(ApplicationSession):
  File "/home/bjk49/git/sisock/sisock/hub.py", line 161, in hub
    @wamp.register(sisock.uri("data_node.add"))
AttributeError: module 'sisock' has no attribute 'uri'