4848 [gca_pipeline_state_v1beta1 .PipelineState .PIPELINE_STATE_FAILED ]
4949)
5050
51- # Vertex AI Pipelines service API job name relative name prefix pattern.
52- _JOB_NAME_PATTERN = "{parent}/pipelineJobs/{job_id}"
53-
5451# Pattern for valid names used as a Vertex resource name.
5552_VALID_NAME_PATTERN = re .compile ("^[a-z][-a-z0-9]{0,127}$" )
5653
@@ -178,19 +175,18 @@ def __init__(
178175 )
179176
180177 pipeline_name = pipeline_job ["pipelineSpec" ]["pipelineInfo" ]["name" ]
181- job_id = job_id or "{pipeline_name}-{timestamp}" .format (
178+ self . job_id = job_id or "{pipeline_name}-{timestamp}" .format (
182179 pipeline_name = re .sub ("[^-0-9a-z]+" , "-" , pipeline_name .lower ())
183180 .lstrip ("-" )
184181 .rstrip ("-" ),
185182 timestamp = _get_current_time ().strftime ("%Y%m%d%H%M%S" ),
186183 )
187- if not _VALID_NAME_PATTERN .match (job_id ):
184+ if not _VALID_NAME_PATTERN .match (self . job_id ):
188185 raise ValueError (
189186 "Generated job ID: {} is illegal as a Vertex pipelines job ID. "
190187 "Expecting an ID following the regex pattern "
191188 '"[a-z][-a-z0-9]{{0,127}}"' .format (job_id )
192189 )
193- job_name = _JOB_NAME_PATTERN .format (parent = self ._parent , job_id = job_id )
194190
195191 builder = pipeline_utils .PipelineRuntimeConfigBuilder .from_job_spec_json (
196192 pipeline_job
@@ -206,7 +202,6 @@ def __init__(
206202
207203 self ._gca_resource = gca_pipeline_job_v1beta1 .PipelineJob (
208204 display_name = display_name ,
209- name = job_name ,
210205 pipeline_spec = pipeline_job ["pipelineSpec" ],
211206 labels = labels ,
212207 runtime_config = runtime_config ,
@@ -215,18 +210,6 @@ def __init__(
215210 ),
216211 )
217212
218- def _assert_gca_resource_is_available (self ) -> None :
219- # TODO(b/193800063) Change this to name after this fix
220- if not getattr (self ._gca_resource , "create_time" , None ):
221- raise RuntimeError (
222- f"{ self .__class__ .__name__ } resource has not been created."
223- + (
224- f" Resource failed with: { self ._exception } "
225- if self ._exception
226- else ""
227- )
228- )
229-
230213 @base .optional_sync ()
231214 def run (
232215 self ,
@@ -257,12 +240,10 @@ def run(
257240
258241 _LOGGER .log_create_with_lro (self .__class__ )
259242
260- # PipelineJob.name is not used by pipeline service
261- pipeline_job_id = self ._gca_resource .name .split ("/" )[- 1 ]
262243 self ._gca_resource = self .api_client .create_pipeline_job (
263244 parent = self ._parent ,
264245 pipeline_job = self ._gca_resource ,
265- pipeline_job_id = pipeline_job_id ,
246+ pipeline_job_id = self . job_id ,
266247 )
267248
268249 _LOGGER .log_create_complete_with_getter (
0 commit comments