Skip to content

Job Name length limit #5099

Closed
Closed
@EnyMan

Description

@EnyMan

Describe the bug
When using the PipelineDefinitionConfig i get the error

ClientError: An error occurred (ValidationException) when calling the CreatePipeline operation: Unable to
parse pipeline definition. Model Validation failed: string 
'my-custom-name-SHA256-hash' with 
length=91 cannot be greater than max=63.0 defined for ProcessingJobName.

The issue here is that the hash itself is 64 characters. Also the function that generates the job_name only limits the length of the generated name to 1024 characters.

To reproduce
Any basic pipeline with PipelineDefinitionConfig(use_custom_job_prefix=True)

from sagemaker import ScriptProcessor
from sagemaker.workflow.pipeline import Pipeline
from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
from sagemaker.workflow.steps import ProcessingStep

ROLE_ARN = "ADD_YOUR_ROLE_HERE"
IMAGE_ARN = "ADD_YOUR_IMAGE_HERE"

definition_config = PipelineDefinitionConfig(use_custom_job_prefix=True)
steps = [
    ProcessingStep(
        name=f"my-first-step",
        display_name="My First Step",
        processor=ScriptProcessor(
            command=["python3"],
            role=ROLE_ARN,
            instance_count=1,
            image_uri=IMAGE_ARN,
            instance_type="ml.m5.xlarge",
        ),
        code=f"example.py",
    ),
]
pipeline = Pipeline(
    name="test-pipeline",
    steps=steps,
    pipeline_definition_config=definition_config,
)

pipeline.upsert(
    role_arn=ROLE_ARN,
)

Expected behavior
The name should be truncated, so it fits in the 63 character limit

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.242.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): Any
  • Framework version: Any
  • Python version: 3.12.9
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions