Skip to content

Commit

Permalink
chore: Disable preview custom job logs when executing remote training
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 571095097
  • Loading branch information
jaycee-li authored and Copybara-Service committed Oct 5, 2023
1 parent 9fedd34 commit 5c993d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vertexai/preview/_workflow/executor/training.py
Expand Up @@ -713,6 +713,7 @@ def remote_training(invokable: shared._Invokable, rewrapper: Any):

# disable CustomJob logs
logging.getLogger("google.cloud.aiplatform.jobs").disabled = True
logging.getLogger("google.cloud.aiplatform.preview.jobs").disabled = True
try:
job = jobs.CustomJob(
display_name=display_name,
Expand Down Expand Up @@ -746,6 +747,7 @@ def remote_training(invokable: shared._Invokable, rewrapper: Any):
finally:
# enable CustomJob logs after remote training job is done
logging.getLogger("google.cloud.aiplatform.jobs").disabled = False
logging.getLogger("google.cloud.aiplatform.preview.jobs").disabled = False

if job.state in jobs._JOB_ERROR_STATES:
return job
Expand Down

0 comments on commit 5c993d2

Please sign in to comment.