Repository navigation
Update start servers - #163
Conversation
| import logging | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
I'll remove all of these extra white spaces. I stupidly diff -w to ignore the whitespace.
| threaded=True, ssl_context=('certs/server.crt', 'certs/server.key')) | ||
| # For http | ||
| else: | ||
| print 'Starting non-secure flask' |
There was a problem hiding this comment.
So non-secure means you can't use ASR right? Is that stated somewhere?
There was a problem hiding this comment.
I'm adding a comment within this file but also I think it'll be more clear once I write out the instructions on how to start servers with and without ASR.
|
|
||
| start_server: | ||
| gnome-terminal -x bash -c "./gradlew run $(filter-out $@,$(MAKECMDGOALS)); read -n1" | ||
| ./gradlew run |
There was a problem hiding this comment.
can you speak to what $(filter-out $@,$(MAKECMDGOALS)); read -n1 was doing?
There was a problem hiding this comment.
I honestly don't know what these were doing. Every time I run with $(filter-out $@,$(MAKECMDGOALS)); read -n1 it says these commands are not found.
According to the internet: $(filter-out PATTERN...,TEXT) returns all whitespace-separated words in TEXT that do not match any of the PATTERN words, removing the words that do match one or more. And read -n1 means read one character at a time. But MAKECMDGOALS is not defined anywhere.
|
|
||
| gnome-terminal -x bash -c "python kaldigstserver/worker.py -u ws://localhost:8081/worker/ws/speech -c sample_english_nnet2.yaml; read -n1" | ||
| python kaldigstserver/worker.py -u ${ASR_ADDR_PORT}/worker/ws/speech -c sample_english_nnet2.yaml | ||
|
|
There was a problem hiding this comment.
Getting rid of the extra spaces.
| if [ "$1" == "secure" ]; then | ||
| echo "Enabling secure host" | ||
| # Getting the host IP address | ||
| export ASR_ADDR_PORT="wss://$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'):8081" |
There was a problem hiding this comment.
This makes me a little nervous, so all ASR ports run on 8081 and its sort of hard coded all over the place right?
There was a problem hiding this comment.
Yes, that's how it seems. Each service has a port that is hard-coded and used in multiple places.
There was a problem hiding this comment.
Yes I know that I'm asking if you have an idea for a better design?
There was a problem hiding this comment.
The issue is we need a common place to have a service registry that all servers and cmd center can access. In some other implementations the command center holds the registry, the microservices register themselves giving the cmd their host and port, and the cmd adds this to its service registry. This way the microservices can change their locations and just register themselves every time they are initialized.
| unset SECURE_HOST | ||
| fi | ||
|
|
||
| declare -a commandcenter=("CMD" "$(pwd)/../lucida/commandcenter/") |
There was a problem hiding this comment.
I don't know what declare does, can you enlighten me?
There was a problem hiding this comment.
the declare allows you to declare and initialize an array by specifying the list of elements (separated by white space) rather than initializing each element of an array separately
| ./DIGServer | ||
|
|
||
| start_test: | ||
| gnome-terminal -x bash -c "./run-test.sh $(filter-out $@,$(MAKECMDGOALS)); read -n1" |
There was a problem hiding this comment.
if you're removing all gnome-terminals, why not get rid of this one too?
There was a problem hiding this comment.
There currently isn't a automated way to test all of the servers so when someone wants to run tests they have to go to each individual microservice folder and run start_test. In this situation it may be necessary to have a new terminal open as it won't be necessary to keep it running after the test has been run unlike a server.
There was a problem hiding this comment.
I see your point but I think in that case there should be a better way to test. can you open an issue about moving start_test as unittest, similar to what we do internally? Look at the infrastructure we use
There was a problem hiding this comment.
Okay, I created an issue. In the meantime let me look into our internal infrastructure.
| @@ -19,3 +19,9 @@ local: | |||
|
|
|||
| start_all: | |||
There was a problem hiding this comment.
are these other make targets still relevant? In adding your features, are there any cleanups you can make that would make it easier to understand what you're adding?
There was a problem hiding this comment.
Think about that across your PR. I know the make targets are defined one way, unclear whether its the best way
There was a problem hiding this comment.
I will remove start_all since start_all_tmux replaces that. As far as the way make targets are defined, they are defined in a consistent way across all services which makes it easy to loop through all services and start them.
There was a problem hiding this comment.
Once the PR is merged I will be sure to update the wikis/README to show the new way to start all servers (both with and without ASR).
| @@ -0,0 +1,71 @@ | |||
| #!/bin/bash | |||
| facerecognition) | ||
|
|
||
| # Create the session | ||
| tmux new-session -s ${SESSION_NAME} -n vim -d |
There was a problem hiding this comment.
Tmux is an okay way of doing this, have you thought/investigated other ways of deploying/running web services? I know about supervisord. What else is out there?
There was a problem hiding this comment.
I've gotten as far seeing different options out there. This article has a good comparison of different options (http://centos-vn.blogspot.com/2014/06/daemon-showdown-upstart-vs-runit-vs.html). I'll need to do more research about what would be best for our situation.
|
I still need to test all this out but there are some discussion points as well |
|
After testing:
|
|
Answers below.
…---
Saijel Mokashi
https://clinc.com
On Mon, Apr 17, 2017 at 8:29 AM, Johann Hauswald ***@***.***> wrote:
After testing:
- what's the first vim window for? *I added this window to do
development in. I guess it is not completely necessary. Should I remove it?*
- can you add a check if I already have a window named lucida? *Yes, I
added this check and updated the pull request.*
- can you add a check to not nest tmux sessions if i'm already in
tmux? This is generally bad practice. *Fixed in the above statement*
- how do i got about adding a new service? is that automatic or do I
need to edit the bash script everytime? Is this related to your registry
idea?* Currently, you'd have to edit the bash script every time. I
think the entire process of adding a microservice needs to be planned out
to try to make it more automated. *
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZQku_nKUCzHuCW5sYZF0_cuWpvT4R4fks5rw1s2gaJpZM4MztZ6>
.
|
|
Went through all your responses, yes I would remove the development window from tmux. Agreed on everything else. |
| # use the following command: | ||
| # $tmux a -t lucida | ||
|
|
||
| SESSION_NAME="lucida" |
There was a problem hiding this comment.
where's the check to see if you're already in a tmux session? What if I'm in a tmux session that is not called lucida?
|
Also what about the fixes that you have? can you make a quick MR for those? |
| facerecognition) | ||
|
|
||
| # First window (0) -- vim | ||
| tmux send-keys -t ${SESSION_NAME} 'vim' C-m |
There was a problem hiding this comment.
are you still generating a vim window? I don't think there's much use...
| echo "Session ${SESSION_NAME} already exists." | ||
| exit 0; | ||
| elif [ -n "$TMUX" ]; then | ||
| echo "Already in a tmux session" |
There was a problem hiding this comment.
@jhauswald removing the first vim window
list of changes: