mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2026-01-30 18:54:26 +01:00
⏩ fix: fail fast bad executor
This commit is contained in:
@@ -131,6 +131,14 @@ def _push_executor(dir_path):
|
||||
responses.append(d)
|
||||
return '\n'.join(responses)
|
||||
|
||||
def is_microservice_in_hub(microservice_name):
|
||||
url = f'https://api.hubble.jina.ai/v2/rpc/executor.list?search={microservice_name}&withAnonymous=true'
|
||||
resp = requests.get(url)
|
||||
executor_list = resp.json()['data']
|
||||
for executor in executor_list:
|
||||
if 'name' in executor and executor['name'] == microservice_name:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_user_name(token=None):
|
||||
client = hubble.Client(max_retries=None, jsonify=True, token=token)
|
||||
|
||||
@@ -205,8 +205,14 @@ metas:
|
||||
if i == MAX_DEBUGGING_ITERATIONS - 1:
|
||||
raise self.MaxDebugTimeReachedException('Could not debug the microservice.')
|
||||
else:
|
||||
print('Successfully build microservice.')
|
||||
break
|
||||
# at the moment, there can be cases where no error log is extracted but the executor is still not published
|
||||
# it leads to problems later on when someone tries a run or deployment
|
||||
if is_microservice_in_hub(microservice_name):
|
||||
print('Successfully build microservice.')
|
||||
break
|
||||
else:
|
||||
raise Exception(log_hubble)
|
||||
|
||||
|
||||
return get_microservice_path(path, microservice_name, packages, num_approach, i)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user