Skip to content

Commit

Permalink
fix: ensure builds don't timeout due to gcp client pooling (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsilva authored Apr 13, 2023
1 parent e3d4f2f commit 83a9c3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wanna/core/services/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from caseconverter import kebabcase
from checksumdir import dirhash
from google.api_core.client_options import ClientOptions
from google.api_core.future.polling import DEFAULT_POLLING
from google.api_core.operation import Operation
from google.cloud.devtools import cloudbuild_v1
from google.cloud.devtools.cloudbuild_v1.services.cloud_build import CloudBuildClient
Expand Down Expand Up @@ -307,6 +308,11 @@ def _build_image_on_gcp_cloud_build(

timeout = Duration()
timeout.seconds = self.cloud_build_timeout

# Set the pooling timeout to self.cloud_build_timeout seconds
# since often large GPUs builds exceed the 900s limit
DEFAULT_POLLING._timeout = self.cloud_build_timeout

if self.cloud_build_workerpool:
project_number = convert_project_id_to_project_number(self.project_id)
options = BuildOptions(
Expand Down

0 comments on commit 83a9c3c

Please sign in to comment.