diff --git a/python/pyfunc-server/test/test_examples.py b/python/pyfunc-server/test/test_examples.py index f890f15e3..df26423b0 100644 --- a/python/pyfunc-server/test/test_examples.py +++ b/python/pyfunc-server/test/test_examples.py @@ -31,7 +31,7 @@ def _get_free_port(): sock.close() -def _wait_server_ready(proc, url, timeout_second=300, tick_second=5): +def _wait_server_ready(proc, url, timeout_second=600, tick_second=10): time.sleep(5) ellapsed_second = 0 diff --git a/python/sdk/merlin/pyfunc.py b/python/sdk/merlin/pyfunc.py index b852edf6d..268677c86 100644 --- a/python/sdk/merlin/pyfunc.py +++ b/python/sdk/merlin/pyfunc.py @@ -562,18 +562,21 @@ def _run_container( for started_container in started_containers: started_container.remove(force=True) - try: - env_vars["CARAML_HTTP_PORT"] = "8080" - env_vars["CARAML_GRPC_PORT"] = "9000" - env_vars["CARAML_MODEL_NAME"] = model_name - env_vars["CARAML_MODEL_VERSION"] = model_version - env_vars["CARAML_MODEL_FULL_NAME"] = model_full_name - env_vars["WORKERS"] = "1" + if env_vars is None: + env_vars = {} + + env_vars["CARAML_HTTP_PORT"] = "8080" + env_vars["CARAML_GRPC_PORT"] = "9000" + env_vars["CARAML_MODEL_NAME"] = model_name + env_vars["CARAML_MODEL_VERSION"] = model_version + env_vars["CARAML_MODEL_FULL_NAME"] = model_full_name + env_vars["WORKERS"] = "1" - ports = {"8080/tcp": port} - if "CARAML_PROTOCOL" in env_vars and env_vars["CARAML_PROTOCOL"] == "UPI_V1": - ports = {"9000/tcp": port} + ports = {"8080/tcp": port} + if "CARAML_PROTOCOL" in env_vars and env_vars["CARAML_PROTOCOL"] == "UPI_V1": + ports = {"9000/tcp": port} + try: container = docker_client.containers.run( image=image_tag, name=model_name,