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

run_server runs on CLI

parent 53f8dcd7
No related branches found
No related tags found
No related merge requests found
model_server
\ No newline at end of file
import importlib
from model_server.base.api import app
from ..base.api import app
print(f'PACKAGE NAME IS ' + __package__)
for ex in ['ilastik']:
m = importlib.import_module(f'extensions.{ex}.router')
m = importlib.import_module(f'..extensions.{ex}.router', package=__package__)
app.include_router(m.router)
......@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "model_server"
license = {file = "LICENSE"}
version = "2024.09_25"
version = "2024.09.30"
authors = [
{ name="Christopher Rhodes", email="christopher.rhodes@embl.de" },
]
......@@ -16,13 +16,14 @@ requires-python = ">=3.9"
dependencies = [
"czifile",
"fastapi >=0.101",
"ilastik ==1.4.1b15",
"ilastik ==1.4.1b6",
"imagecodecs",
"jupyterlab",
"matplotlib",
"numpy",
"pandas",
"pillow",
"protobuf ==4.25.3",
"pydantic ~=1.10.1",
"pytorch ==1.*",
"scikit-image >=0.21.0",
......
File moved
import argparse
from multiprocessing import Process
from pathlib import Path
import requests
from requests.adapters import HTTPAdapter
from urllib3 import Retry
import uvicorn
import webbrowser
from conf.defaults import server_conf
from model_server.conf.defaults import server_conf
def parse_args():
......@@ -15,7 +16,7 @@ def parse_args():
)
parser.add_argument(
'--confpath',
default='conf.servers.extensions',
default='model_server.conf.fastapi',
help='path to server startup configuration',
)
parser.add_argument(
......@@ -49,7 +50,8 @@ def main(args) -> None:
target=uvicorn.run,
args=(f'{args.confpath}:app',),
kwargs={
'app_dir': '.',
# 'app_dir': Path('..').resolve().__str__(),
'app_dir': '..',
'host': args.host,
'port': int(args.port),
'log_level': 'debug',
......
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