cursus.steps.configs.config_package_step

class PackageConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', image_uri=None, subnets=None, security_group_ids=None, enable_network_isolation=None, source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, processing_instance_count=1, processing_volume_size=500, processing_instance_type_large='ml.m5.4xlarge', processing_instance_type_small='ml.m5.2xlarge', use_large_processing_instance=False, skip_volume_kms=None, processing_source_dir=None, processing_entry_point='package.py', processing_script_arguments=None, processing_framework_version='1.2-1', inference_scripts_dir=None, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for a model packaging step.

This configuration follows the three-tier field categorization: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that users can override 3. Tier 3: Derived Fields - fields calculated from other fields, stored in private attributes

processing_entry_point: str
inference_scripts_dir: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

validate_config()[source]

Validate configuration and ensure defaults are set.

This validator ensures that: 1. Entry point is provided 2. Script contract is available and valid 3. Required input paths are defined in the script contract

get_environment_variables(declared_env_vars=None)[source]

Packaging env vars (the single env source; moved here from the builder, FZ 31e1d3g).

declared_env_vars accepted for the builder’s names-driven contract but ignored — these are config-derived names (PIPELINE_NAME, REGION, …) emitted only when the underlying field is present, preserving the builder’s original conditional-add behavior.

inference_scripts_source()[source]

Local RESOLVED source path for the packaging step’s inference_scripts_input (FZ 31e1d3i).

The packaging step always mounts inference scripts from a LOCAL path (overriding any dependency-resolved value). This is DELIBERATELY decoupled from processing_source_dir (which resolves the packaging entry point package.py — typically in a scripts/ subdir): the inference handler + its Python package deps usually live at the source_dir ROOT, one level ABOVE that scripts subdir, so packaging processing_source_dir would omit them and the serving DLC would fall back to its default model_fn.

Resolution order (each hybrid-resolved to a real path, mirroring effective_source_dir): 1. inference_scripts_dir (explicit override) 2. source_dir (DEFAULT — the full code tree, NOT processing_source_dir) 3. effective_source_dir (last-resort; processing_source_dir → source_dir → legacy) 4. the literal "inference" when nothing is configured.

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

processing_instance_count: int
processing_volume_size: int
processing_instance_type_large: str
processing_instance_type_small: str
use_large_processing_instance: bool
skip_volume_kms: bool | None
processing_source_dir: str | None
processing_script_arguments: List[str] | None
processing_framework_version: str
author: str
bucket: str
role: str
region: str
service_name: str
pipeline_version: str
model_class: str
current_date: str
framework_version: str
py_version: str
image_uri: str | None
subnets: List[str] | None
security_group_ids: List[str] | None
enable_network_isolation: bool | None
source_dir: str | None
enable_caching: bool
use_secure_pypi: bool
max_runtime_seconds: int
project_root_folder: str