Skip to content

Commit

Permalink
Updated README.md instructions to use nlds-up
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Sep 30, 2024
1 parent 9238f8d commit 367ffd9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Running the Server
FastAPI displays automatically generated documentation for the REST-API, to
browse this go to http://127.0.0.1:8000/docs/
2. To run the microservices, you have two options:
* In individual terminals, after activating the virtual env, (e.g.
2. To run the microservices, you have three options:
1. In individual terminals, after activating the virtual env, (e.g.
`source ~/nlds-venv/bin/activate`), start each of the microservice
consumers:
```
Expand All @@ -114,11 +114,28 @@ Running the Server
This will send the output of each consumer to its own terminal (as well
as whatever is configured in the logger).
* Alternatively, you can use the scripts in the `test_run/` directory,
notably `start_test_run.py` to start and `stop_test_run.py` to stop.
2. Alternatively, you can use the scripts in the `test_run/` directory:
`start_test_run.py` to start and `stop_test_run.py` to stop.
This will start a [screen](https://www.gnu.org/software/screen/manual/screen.html)
session with all 8 processors (+ api server) in, sending each output to
a log in the `./nlds_log/` directory.
This method is good for getting a whole NLDS infrastructure up and running
quickly, but is not so great for debugging.
3. Also in the `test_run/` directory is a script called `nlds-up` which will
activate the virtual environment and run one of the microservices listed above.
It requires the enviroment variable `NLDS_VENV` to be set to point to the
virtual environemnt created above (e.g. `~/nlds-venv/` - however, user paths
have to be expanded so, for the Mac, this would be
`/Users/<your_username>/nlds-venv`).
It is recommended to set the environment variable in your shell profile. For **bash** this is `~/.bash_profile`, and the environment can be set using the
line:
```
export NLDS_VENV="/Users/<your_username>/python-venvs/nlds-venv"
```
Running `nlds-up` then takes the name of one of the microservices above: e.g.
`nlds-up catalog_q`
Tests
-----
Expand Down
8 changes: 1 addition & 7 deletions test_run/nlds-up
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
#! /usr/bin/env bash
if [[ -z $NLDS_VENV ]]; then
echo "NLDS_VENV environment variable not set"
return 1
else
source $NLDS_VENV/bin/activate
fi

if [[ -z $NLDS_CODE ]]; then
echo "NLDS_CODE environment variable not set"
return 1
else
cd $NLDS_CODE
fi

if [ $1 = 'nlds_q' ]; then
nlds_q
elif [ $1 = 'catalog_q' ]; then
Expand Down

0 comments on commit 367ffd9

Please sign in to comment.