Chris
09/13/2024, 2:18 PMfrom bentoml import serve
server = serve(<my-bento-tag>) # start http server
server.start()
#wait until server is ready
# --> no idea what to call here, there is no server.wait_until_ready()
#finally close server
server.stop()
can somebody help?Jian Shen Yap
09/13/2024, 2:27 PMserve is suppose to be used for any production use case. Can you share what is your use case?Chris
09/13/2024, 2:32 PMJian Shen Yap
09/13/2024, 2:34 PMcli insteadChris
09/13/2024, 2:35 PMJian Shen Yap
09/13/2024, 2:36 PMsubprocess to start the server if you prefer to work on python fileChris
09/13/2024, 2:37 PMJian Shen Yap
09/13/2024, 2:38 PMimport subprocess
command = ["bentoml", "serve", "mybento:latest"]
result = subprocess.run(command, check=True, text=True, capture_output=True)Chris
09/13/2024, 2:44 PMJian Shen Yap
09/13/2024, 2:44 PM/readyz endpointChris
09/13/2024, 2:45 PM