mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-21 07:34:20 +01:00
⌛ fix: time out hub push
This commit is contained in:
@@ -5,4 +5,5 @@ psutil
|
|||||||
jina
|
jina
|
||||||
jcloud
|
jcloud
|
||||||
jina-hubble-sdk
|
jina-hubble-sdk
|
||||||
langchain
|
langchain
|
||||||
|
timeout-decorator
|
||||||
@@ -11,6 +11,7 @@ from pathlib import Path
|
|||||||
import click
|
import click
|
||||||
import hubble
|
import hubble
|
||||||
import requests
|
import requests
|
||||||
|
import timeout_decorator
|
||||||
from hubble.executor.helper import upload_file, archive_package, get_request_header
|
from hubble.executor.helper import upload_file, archive_package, get_request_header
|
||||||
from jcloud.flow import CloudFlow
|
from jcloud.flow import CloudFlow
|
||||||
from jina import Flow
|
from jina import Flow
|
||||||
@@ -62,6 +63,18 @@ In this case, please cancel this run, rerun your gptdeploy command and login int
|
|||||||
|
|
||||||
|
|
||||||
def push_executor(dir_path):
|
def push_executor(dir_path):
|
||||||
|
for i in range(3):
|
||||||
|
try:
|
||||||
|
_push_executor(dir_path)
|
||||||
|
break
|
||||||
|
except timeout_decorator.timeout_decorator.TimeoutError:
|
||||||
|
print('timeout error, retrying...')
|
||||||
|
if i == 2:
|
||||||
|
raise Exception('timeout error, please try again later')
|
||||||
|
continue
|
||||||
|
|
||||||
|
@timeout_decorator.timeout(10*60)
|
||||||
|
def _push_executor(dir_path):
|
||||||
dir_path = Path(dir_path)
|
dir_path = Path(dir_path)
|
||||||
|
|
||||||
md5_hash = hashlib.md5()
|
md5_hash = hashlib.md5()
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ metas:
|
|||||||
self.write_config_yml(gateway_name, gateway_path, 'custom_gateway.py')
|
self.write_config_yml(gateway_name, gateway_path, 'custom_gateway.py')
|
||||||
|
|
||||||
# push the gateway
|
# push the gateway
|
||||||
|
print('Final step...')
|
||||||
hubble_log = push_executor(gateway_path)
|
hubble_log = push_executor(gateway_path)
|
||||||
|
|
||||||
def debug_microservice(self, path, microservice_name, num_approach, packages):
|
def debug_microservice(self, path, microservice_name, num_approach, packages):
|
||||||
|
|||||||
Reference in New Issue
Block a user