Closed ejhumphrey closed 7 years ago
Reviewed 13 of 16 files at r1. Review status: 13 of 16 files reviewed at latest revision, 1 unresolved discussion.
README.md, line 60 at r1 (raw file):
This will start the backend server (CMS), upload a few audio files, and begin serving the audio annotation tool locally. By default this will appear at [http://localhost:8000/docs/annotator.html](http://localhost:8000/docs/annotator.html). **Note**: For some reason, loading the audio seems to get "stuck" on occasion. To unblock it, manually proceed to an audio file's URL once the server is running, e.g. [http://localhost:8080/api/v0.1/audio/740c835f-a23d-41ef-b84c-0cd1de4edfa5](http://localhost:8080/api/v0.1/audio/740c835f-a23d-41ef-b84c-0cd1de4edfa5).
Is hard-coding this really useful? I imagine the hash could change, and break this link.
Comments from Reviewable
Review status: 13 of 16 files reviewed at latest revision, 2 unresolved discussions.
README.md, line 66 at r1 (raw file):
### Content Management System See the [ReadMe](https://github.com/cosmir/open-mic/blob/master/backend_server/README.md) for details on running the backend web server.
Can this link be relative?
Comments from Reviewable
Review status: 13 of 16 files reviewed at latest revision, 3 unresolved discussions.
run_demo.sh, line 6 at r1 (raw file):
python backend_server/main.py --port 8080 --local --debug & CMS_PID=$! sleep 4s
This is okay for now, but this should really be a daemon that stores its PID to a user-specified pid file, which can be read once the initial process terminates.
Comments from Reviewable
README.md, line 60 at r1 (raw file):
Is hard-coding this really useful? I imagine the hash could change, and break this link.
UUIDs are deterministic based on the bytestring of the file; this points to a checked in file, and shouldn't change. That said, it's worth mentioning that in the README to prevent future confusion.
Comments from Reviewable
README.md, line 66 at r1 (raw file):
Can this link be relative?
¯_(ツ)_/¯ I'll look into it
Comments from Reviewable
run_demo.sh, line 6 at r1 (raw file):
This is okay for now, but this should really be a daemon that stores its PID to a user-specified pid file, which can be read once the initial process terminates.
I spent 10-15 minutes rooting around the interstacks, and didn't find an example I like -- do you have one in mind you could point to?
Comments from Reviewable
Review status: 13 of 16 files reviewed at latest revision, 1 unresolved discussion.
run_demo.sh, line 6 at r1 (raw file):
I spent 10-15 minutes rooting around the interstacks, and didn't find an example I like -- do you have one in mind you could point to?
How about start-stop-daemon?
Comments from Reviewable
run_demo.sh, line 6 at r1 (raw file):
How about start-stop-daemon?
looks like that's linux only? suppose that would work for travis, but us OS X folks couldn't run it locally ... this is at least unix compliant?
Comments from Reviewable
Reviewed 2 of 16 files at r1. Review status: 15 of 16 files reviewed at latest revision, 1 unresolved discussion.
Comments from Reviewable
Review status: 15 of 16 files reviewed at latest revision, 1 unresolved discussion.
run_demo.sh, line 6 at r1 (raw file):
looks like that's linux only? suppose that would work for travis, but us OS X folks couldn't run it locally ... this is at least unix compliant?
Ugh, OSX. See thread: https://apple.stackexchange.com/questions/99888/is-there-any-port-of-start-stop-daemon-for-os-x
I guess that works via launchctl
or launchd
or something, but I have no way to verify. Sorry!
Comments from Reviewable
run_demo.sh, line 6 at r1 (raw file):
Ugh, OSX. See thread: https://apple.stackexchange.com/questions/99888/is-there-any-port-of-start-stop-daemon-for-os-x I guess that works via `launchctl` or `launchd` or something, but I have no way to verify. Sorry!
Doesn't seem to be the answer -- might need to use a different process shell?
Comments from Reviewable
@bmcfee can I get a fresh look on this? I swapped out the bash shell script demo in favor of a python version, which is probably (hopefully) preferable to the previous solution.
Comments from Reviewable
run_demo.sh, line 6 at r1 (raw file):
Doesn't seem to be the answer -- might need to use a different process shell?
I've rm'ed this file in favor of demo.py
Comments from Reviewable
Reviewed 3 of 3 files at r3. Review status: all files reviewed at latest revision, 1 unresolved discussion.
Comments from Reviewable
Reviewed 1 of 16 files at r1. Review status: all files reviewed at latest revision, 3 unresolved discussions.
demo.py, line 39 at r3 (raw file):
try: input("Press return to exit.") except:
don't do a bare catch here; use the correct exception class
demo.py, line 42 at r3 (raw file):
pass os.killpg(os.getpgid(server.pid), signal.SIGTERM) os.killpg(os.getpgid(webapp.pid), signal.SIGTERM)
put subprocess kills in a finally block
Comments from Reviewable
Review status: all files reviewed at latest revision, 4 unresolved discussions.
demo.py, line 1 at r3 (raw file):
#!/usr/bin/python
use #!/usr/bin/env python instead of #!/usr/bin/python to ensure proper environment capsulization
Comments from Reviewable
Review status: all files reviewed at latest revision, 5 unresolved discussions.
demo.py, line 25 at r3 (raw file):
'8080', '--local', '--debug'], stdout=subprocess.PIPE, preexec_fn=os.setsid) time.sleep(4)
this still seems wrong, but we can revisit later.
Comments from Reviewable
demo.py, line 1 at r3 (raw file):
use #!/usr/bin/env python instead of #!/usr/bin/python to ensure proper environment capsulization
Done.
Comments from Reviewable
demo.py, line 42 at r3 (raw file):
put subprocess kills in a finally block
Done.
Comments from Reviewable
demo.py, line 25 at r3 (raw file):
this still seems wrong, but we can revisit later.
I did something smarter here, you might want to give this a look.
Comments from Reviewable
demo.py, line 42 at r3 (raw file):
Done.
actually, didn't need that second try / except? I was getting some funny business from input()
, but it seems to have resolved itself.
Comments from Reviewable
demo.py, line 39 at r3 (raw file):
don't do a bare catch here; use the correct exception class
unnec.
Comments from Reviewable
Reviewed 1 of 2 files at r4. Review status: 15 of 16 files reviewed at latest revision, 4 unresolved discussions.
Comments from Reviewable
tiny ping @bmcfee
Reviewed 1 of 3 files at r3, 2 of 2 files at r4. Review status: all files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
thanks, merging
Note: The audio-annotator submodule was updated in the course of these changes.
This change is![Reviewable](https://reviewable.io/review_button.svg)