in src/workflow/build.py [0:0]
def _create_kernel_image(self, cb_project, env_overrides, timeout) :
## limit build execution to once every 100 seconds as a protective
## measure for the unexpected.
token = str(int(datetime.now().timestamp()/100)*100)
start = time()
response = self.cb.start_build( projectName=cb_project,
environmentVariablesOverride=self._env_overrides_input(env_overrides),
idempotencyToken=token)
if response :
build_id = response["build"]["id"]
else :
raise Exception("Failed to start the build.")
while True :
info = self.cb.batch_get_builds(ids= [build_id])["builds"][0]
if info :
status = info["buildStatus"]
if status == 'SUCCEEDED':
self.update_and_next({"id":info["id"],"arn":info["arn"],"num":info["buildNumber"], "status":status})
break
elif status == 'FAILED' or status == 'FAULT' or status == 'STOPPED' or status == 'TIMED_OUT':
err_msg = f"Build Id: {build_id} Status: {status}"
self.update_and_next(err_msg)
raise Exception(err_msg)
self._handle_wait(start, timeout)