Skip to content
Snippets Groups Projects
Commit 99bf87d2 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

run_server main method can now be called externally

parent cd19fc19
No related branches found
No related tags found
No related merge requests found
...@@ -27,14 +27,14 @@ def parse_args(): ...@@ -27,14 +27,14 @@ def parse_args():
) )
return parser.parse_args() return parser.parse_args()
if __name__ == '__main__':
def main() -> None:
args = parse_args() args = parse_args()
print('CLI args:\n' + str(args)) print('CLI args:\n' + str(args))
server_process = Process( server_process = Process(
target=uvicorn.run, target=uvicorn.run,
args=('model_server.api:app',), args=('model_server.base.api:app',),
kwargs={ kwargs={
'app_dir': '.', 'app_dir': '.',
'host': args.host, 'host': args.host,
...@@ -66,3 +66,7 @@ if __name__ == '__main__': ...@@ -66,3 +66,7 @@ if __name__ == '__main__':
server_process.terminate() server_process.terminate()
print('Finished') print('Finished')
if __name__ == '__main__':
main()
...@@ -6,17 +6,15 @@ model_server implement image analysis jobs for online use (e.g. in feedback micr ...@@ -6,17 +6,15 @@ model_server implement image analysis jobs for online use (e.g. in feedback micr
1. Install Git:<br>https://git-scm.com/download/win 1. Install Git:<br>https://git-scm.com/download/win
2. Install Miniforge for environment management:<br>https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-Windows-x86_64.exe 2. Install Miniforge for environment management:<br>https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-Windows-x86_64.exe
3. Under the Start menu, open `Miniforge3 > Miniforge Prompt` 3. Under the Start menu, open `Miniforge3 > Miniforge Prompt`
4. In the new terminal, run:<br> 4. In the new terminal, clone the model_server repository:<br>
`cd %userprofile%`<br> `cd %userprofile%`<br>
`git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git` `git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git`
5. Open the newly created project root: `cd model_server` 5. Then clone the trec-adaptive-feedback repository, run:<br>
6. Create the environment: `mamba env create --file requirements.yml --name model_server_env` `git clone https://almf-staff:gldt-9szJvEjhupPvMjDv18EB@git.embl.de/almf/trec-adaptive-feedback.git`
7. Activate the environment: `mamba activate model_server_env` 6. Open the newly created model_server project root: `cd model_server`
8. Add the project source as a Python package: `pip install -e .` 7. Create the environment: `mamba env create --file requirements.yml --name model_server_env`
8. Activate the environment: `mamba activate model_server_env`
9. Add the project source as a Python package: `pip install -e .`
# Start the server # Start the server
Simply click "start_server command" in the model_server directory. This should open a terminal that reports server requests, as well as a browser with a status confirmation page. To stop the server, type "stop" in the terminal. Simply click "start_server command" in the trec-adapative-feedback directory. This should open a terminal that reports server requests, as well as a browser with a status confirmation page. To stop the server, type "stop" in the terminal.
# Examples \ No newline at end of file
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment