@@ -1641,6 +1641,68 @@ def _run(
16411641 create_request_timeout (float):
16421642 Optional. The timeout for the create request in seconds.
16431643 """
1644+ self .submit (
1645+ service_account = service_account ,
1646+ network = network ,
1647+ timeout = timeout ,
1648+ restart_job_on_worker_restart = restart_job_on_worker_restart ,
1649+ enable_web_access = enable_web_access ,
1650+ tensorboard = tensorboard ,
1651+ create_request_timeout = create_request_timeout ,
1652+ )
1653+
1654+ self ._block_until_complete ()
1655+
1656+ def submit (
1657+ self ,
1658+ * ,
1659+ service_account : Optional [str ] = None ,
1660+ network : Optional [str ] = None ,
1661+ timeout : Optional [int ] = None ,
1662+ restart_job_on_worker_restart : bool = False ,
1663+ enable_web_access : bool = False ,
1664+ tensorboard : Optional [str ] = None ,
1665+ create_request_timeout : Optional [float ] = None ,
1666+ ) -> None :
1667+ """Submit the configured CustomJob.
1668+
1669+ Args:
1670+ service_account (str):
1671+ Optional. Specifies the service account for workload run-as account.
1672+ Users submitting jobs must have act-as permission on this run-as account.
1673+ network (str):
1674+ Optional. The full name of the Compute Engine network to which the job
1675+ should be peered. For example, projects/12345/global/networks/myVPC.
1676+ Private services access must already be configured for the network.
1677+ timeout (int):
1678+ The maximum job running time in seconds. The default is 7 days.
1679+ restart_job_on_worker_restart (bool):
1680+ Restarts the entire CustomJob if a worker
1681+ gets restarted. This feature can be used by
1682+ distributed training jobs that are not resilient
1683+ to workers leaving and joining a job.
1684+ enable_web_access (bool):
1685+ Whether you want Vertex AI to enable interactive shell access
1686+ to training containers.
1687+ https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell
1688+ tensorboard (str):
1689+ Optional. The name of a Vertex AI
1690+ [Tensorboard][google.cloud.aiplatform.v1beta1.Tensorboard]
1691+ resource to which this CustomJob will upload Tensorboard
1692+ logs. Format:
1693+ ``projects/{project}/locations/{location}/tensorboards/{tensorboard}``
1694+
1695+ The training script should write Tensorboard to following Vertex AI environment
1696+ variable:
1697+
1698+ AIP_TENSORBOARD_LOG_DIR
1699+
1700+ `service_account` is required with provided `tensorboard`.
1701+ For more information on configuring your service account please visit:
1702+ https://cloud.google.com/vertex-ai/docs/experiments/tensorboard-training
1703+ create_request_timeout (float):
1704+ Optional. The timeout for the create request in seconds.
1705+ """
16441706 if service_account :
16451707 self ._gca_resource .job_spec .service_account = service_account
16461708
@@ -1682,8 +1744,6 @@ def _run(
16821744 )
16831745 )
16841746
1685- self ._block_until_complete ()
1686-
16871747 @property
16881748 def job_spec (self ):
16891749 return self ._gca_resource .job_spec
0 commit comments