Include hash of pod template when computing fast registration version#3247
Conversation
Code Review Agent Run #47a158Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Changelist by BitoThis pull request implements the following key changes.
|
- NOTE: the flytekit 1.16 release changed hash calculation a bit with flyteorg#3247, so this commit is a little different from what was done on the 1.15.4 version of the Domino branch (and the 2 commits for this were squashed into one) - This is necessary due to another pending PR to upstream flytekit: flyteorg#2428 In case this PR is not likely to be merged, we have a plan to move away from this change, see the linked Doc in DOM-57472 [DOM-68737] Refactor version_hash_additional_context to use bytes (#7) `bytes` is more flexible. This flexibility is relevant when including the serialized input bindings (bytes) in the version hash calculations. This is necessary to fix a bug that can occur: There is a bug where Flyte rejects a valid workflow. This can happen when workflow inputs are read from a file, causing the workflow input bindings to be updated, without an update to the version. Refactor version_hash_additional_context, which currently uses `str`, to use `bytes`
- NOTE: the flytekit 1.16 release changed hash calculation a bit with flyteorg#3247, so this commit is a little different from what was done on the 1.15.4 version of the Domino branch (and the 2 commits for this were squashed into one) - This is necessary due to another pending PR to upstream flytekit: flyteorg#2428 In case this PR is not likely to be merged, we have a plan to move away from this change, see the linked Doc in DOM-57472 [DOM-68737] Refactor version_hash_additional_context to use bytes (#7) `bytes` is more flexible. This flexibility is relevant when including the serialized input bindings (bytes) in the version hash calculations. This is necessary to fix a bug that can occur: There is a bug where Flyte rejects a valid workflow. This can happen when workflow inputs are read from a file, causing the workflow input bindings to be updated, without an update to the version. Refactor version_hash_additional_context, which currently uses `str`, to use `bytes`
Signed-off-by: Atharva <atharvakulkarni172003@gmail.com>
- NOTE: the flytekit 1.16 release changed hash calculation a bit with flyteorg#3247, so this commit is a little different from what was done on the 1.15.4 version of the Domino branch (and the 2 commits for this were squashed into one) - This is necessary due to another pending PR to upstream flytekit: flyteorg#2428 In case this PR is not likely to be merged, we have a plan to move away from this change, see the linked Doc in DOM-57472 [DOM-68737] Refactor version_hash_additional_context to use bytes (flyteorg#7) `bytes` is more flexible. This flexibility is relevant when including the serialized input bindings (bytes) in the version hash calculations. This is necessary to fix a bug that can occur: There is a bug where Flyte rejects a valid workflow. This can happen when workflow inputs are read from a file, causing the workflow input bindings to be updated, without an update to the version. Refactor version_hash_additional_context, which currently uses `str`, to use `bytes`
Why are the changes needed?
We need to account for changes to the image and pod template based on resolution of env variables rather than a code change. e.g. a user may have an env variable that controls the base image of an imagespec. If the env variable changes, the version we compute should change, but currently it does not.
There are two paths fast registration can take:
In remote.py, we account for a change in
container_imagebut notpod_template. In repo.py, don't account for for either.What changes were proposed in this pull request?
PodTemplatethat hashes its contents.How was this patch tested?
Before:
After:
Check all the applicable boxes
Summary by Bito
This PR enhances versioning by incorporating pod template changes alongside container images in version computation. It adds a hashing method in PodTemplate to capture environment variable changes reflecting image modifications. The implementation spans remote.py and repo.py to ensure consistent behavior across registration and run commands, with comprehensive tests validating functionality.Unit tests added: True
Estimated effort to review (1-5, lower is better): 2