Repository navigation
fix: use pipeline code_hash for FrameworkProcessor sourcedir upload - #6494
mohamedzeidan2021 merged 2 commits into
Conversation
FrameworkProcessor._package_code() now uses _pipeline_config.code_hash in the S3 key when available, matching the behavior of ScriptProcessor._upload_code(). This enables pipeline cache hits for FrameworkProcessor jobs with source_dir. Fixes aws#6493
|
The new hash-based Could we preserve the |
Preserve the sourcedir.tar.gz filename under the pipeline code-hash prefix so _pack_and_upload_code helper replace() URIs stay distinct. Add a regression test covering _pack_and_upload_code with two hashes.
|
Thanks, that was a real collision. |
There was a problem hiding this comment.
🤖 AI code review
This PR fixes FrameworkProcessor._package_code() to build a content-addressed S3 key using _pipeline_config.pipeline_name and _pipeline_config.code_hash when a pipeline config is present, enabling ProcessingStep cache hits for jobs with source_dir (issue #6493). The implementation mirrors the existing ScriptProcessor._upload_code() pattern, uses the same local import of _pipeline_config, and correctly preserves the sourcedir.tar.gz filename so the downstream s3_payload.replace("sourcedir.tar.gz", ...) logic that derives runproc.sh/install_requirements.py URIs still works. The two added unit tests cover both the S3-key content and helper-script non-collision across distinct hashes, and existing tests cover the standalone (non-pipeline) path. The change looks correct and well-tested; no issues found.
Reviewed commit 5cab44b. Automated review; verify before acting.
Issue #, if available: #6493
Description of changes:
Fixes #6493.
FrameworkProcessor._package_code()always usedjob_namein the sourcedir S3 key, so pipelines never got cache hits for jobs withsource_dir. It now uses_pipeline_config.pipeline_nameand_pipeline_config.code_hashwhen they're set, matchingScriptProcessor._upload_code(). Added the unit testtest_package_code_with_pipeline_config, which fails on current master (the S3 key containstest-job) and passes with the fix. The 5 local-mode failures in test_processing.py also fail on unmodified master because the test environment has no AWS region set.Note: prepared with AI assistance and reviewed by the author.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.