Skip to content

Commit

Permalink
Publish pyfuncserver executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Arief Rahmansyah committed Mar 5, 2024
1 parent 650bc5e commit ccc9fc8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
19 changes: 12 additions & 7 deletions python/pyfunc-server/pyfuncserver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@
import traceback

import uvloop

from pyfuncserver.config import Config
from pyfuncserver.model.model import PyFuncModel
from pyfuncserver.server import PyFuncServer
from pyfuncserver.utils.contants import ERR_DRY_RUN

parser = argparse.ArgumentParser()
parser.add_argument('--model_dir', required=True,
help='A URI pointer to the model binary')
parser.add_argument('--dry_run', default=False, action='store_true', required=False,
help="Dry run pyfunc server by loading the specified model "
"in --model_dir without starting webserver")
parser.add_argument(
"--model_dir", required=True, help="A URI pointer to the model binary"
)
parser.add_argument(
"--dry_run",
default=False,
action="store_true",
required=False,
help="Dry run pyfunc server by loading the specified model "
"in --model_dir without starting webserver",
)
args, _ = parser.parse_known_args()

logging.getLogger('tornado.access').disabled = True
logging.getLogger("tornado.access").disabled = True

if __name__ == "__main__":
# use uvloop as the event loop
Expand Down
1 change: 1 addition & 0 deletions python/pyfunc-server/pyfuncserver/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "0.40.0"
17 changes: 13 additions & 4 deletions python/pyfunc-server/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import imp
import os

from setuptools import find_packages, setup

version = imp.load_source(
"pyfuncserver.version", os.path.join("pyfuncserver", "version.py")
).VERSION

tests_require = [
"joblib>=0.13.0,<1.2.0", # >=1.2.0 upon upgrade of kserve's version
"mypy",
Expand All @@ -40,13 +45,13 @@
merlin_sdk_package = "merlin-sdk"
for index, item in enumerate(REQUIRE):
if merlin_sdk_package in item:
REQUIRE[
index
] = f"{merlin_sdk_package} @ file://localhost/{merlin_path}#egg={merlin_sdk_package}"
REQUIRE[index] = (
f"{merlin_sdk_package} @ file://localhost/{merlin_path}#egg={merlin_sdk_package}"
)

setup(
name="pyfuncserver",
version="0.6.0",
version=version,
author_email="[email protected]",
description="Model Server implementation for mlflow pyfunc model",
long_description=open("README.md").read(),
Expand All @@ -56,4 +61,8 @@
install_requires=REQUIRE,
tests_require=tests_require,
extras_require={"test": tests_require},
entry_points="""
[console_scripts]
pyfuncserver=pyfuncserver.__main__:main
""",
)

0 comments on commit ccc9fc8

Please sign in to comment.