Skip to content

Commit

Permalink
Remove Docker bundling in SageMaker model pkg promote pipeline (#228)
Browse files Browse the repository at this point in the history
This removes the custom Docker image used for bundling assets in the
SageMaker model package promote pipeline stack.

It is unnecessary since the s3_assets.Asset` construct can natively zip
a directory via the path argument.
  • Loading branch information
clokep authored Aug 21, 2024
1 parent 09b4c06 commit 90f5830
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- increased timeout on finetune_llm_evaluation project from 1 hour (default) to 4 hours
- pin `ray-operator`, `ray-cluster`, and `ray-image` modules versions
- pin module versions for all manifests
- the `sagemaker/sagemaker-model-package-promote-pipeline` module no longer generates a Docker image

## v1.4.0

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def setup_resources(self) -> None:

self.kms_key = kms.Key.from_key_arn(self, "KMSKey", self.kms_key_arn) if self.kms_key_arn else None

self.code_asset = self.setup_code_assets()
self.code_asset = s3_assets.Asset(
self,
"CodeAsset",
path=os.path.join(os.path.dirname(os.path.realpath(__file__)), "seed_code"),
)
self.pipeline = self.setup_pipeline()
self.rule = self.setup_events()

Expand Down Expand Up @@ -287,35 +291,6 @@ def setup_pipeline_deploy_project(self, metadata_path: str) -> codebuild.Pipelin

return project

def setup_code_assets(self) -> s3_assets.Asset:
"""Deploy seed code to an S3 bucket.
Returns
-------
A Asset instance.
"""
zip_image = cdk.DockerImage.from_build("images/zip-image")
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "seed_code")

bundling = cdk.BundlingOptions(
image=zip_image,
command=[
"sh",
"-c",
"""zip -r /asset-output/code_asset.zip .""",
],
output_type=cdk.BundlingOutput.ARCHIVED,
)

code_asset = s3_assets.Asset(
self,
"CodeAsset",
path=path,
bundling=bundling,
)

return code_asset

def setup_events(self) -> Optional[events.Rule]:
"""Setup an event rule
Expand Down

0 comments on commit 90f5830

Please sign in to comment.