Skip to content

Commit ff109c6

Browse files
committed
extend timeout for istio proxy sidecars
1 parent 6c503c0 commit ff109c6

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

interactive_ai/workflows/common/jobs_common/k8s_helpers/trainer_pod_definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def create_flyte_container_task( # noqa: PLR0913
334334
primary_container_name=CONTAINER_NAME,
335335
annotations={
336336
"proxy.istio.io/config": '{ "holdApplicationUntilProxyStarts": true, '
337-
'"terminationDrainDuration": "10s" }',
337+
'"terminationDrainDuration": "30s" }',
338338
"karpenter.sh/do-not-disrupt": "true",
339339
},
340340
),

interactive_ai/workflows/common/jobs_common/tasks/primary_container_task.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
AWS_CONFIG_VOLUME_NAME = "aws-client-config"
4646
AWS_CONFIG_MOUNT_PATH = "/home/non-root/.aws"
4747
FLYTE_POD_ANNOTATIONS = {"proxy.istio.io/config": '{ "holdApplicationUntilProxyStarts": true, '
48-
'"terminationDrainDuration": "10s" }'}
48+
'"terminationDrainDuration": "30s" }'}
4949
SPICEDB_TLS_SECRETS_VOLUME_NAME = "tls-secrets"
5050
SPICEDB_TLS_SECRETS_MOUNT_PATH = "/etc/tls-secrets"
5151
TERM_ISTIO_PROXY_URL = "http://127.0.0.1:15020/quitquitquit"
@@ -386,21 +386,21 @@ def get_flyte_pod_spec(
386386

387387
def _terminate_istio_proxy(n_trials: int = 10, timeout: float = 1.0, sleep_sec: float = 1.0):
388388
is_terminated = False
389-
sleep(5)
389+
logger.info("starting terminating the istio-proxy container - new")
390390
for step in range(1, n_trials + 1):
391-
try:
392-
response = requests.post(TERM_ISTIO_PROXY_URL, timeout=timeout)
391+
try:
392+
response = requests.post(TERM_ISTIO_PROXY_URL, timeout=timeout)
393393

394-
if response.status_code == 200:
395-
is_terminated = True
396-
break
397-
except Exception as e:
398-
logger.warning("[%d/%d] Cannot terminate istio proxy: %s", step, n_trials, e)
394+
if response.status_code == 200:
395+
is_terminated = True
396+
break
397+
except Exception as e:
398+
logger.warning("[%d/%d] Cannot terminate istio proxy: %s", step, n_trials, e)
399399

400-
sleep(sleep_sec)
400+
sleep(sleep_sec)
401401

402402
if not is_terminated:
403-
logger.error("Cannot terminate istio proxy")
403+
logger.error("Cannot terminate istio proxy")
404404

405405

406406
DEFAULT_TASK_CONFIG = Pod(

0 commit comments

Comments
 (0)