Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing '=' character from generated image tag hash value #2240

Merged
merged 7 commits into from
Mar 6, 2024

Conversation

jasonlai1218
Copy link
Contributor

@jasonlai1218 jasonlai1218 commented Mar 5, 2024

Tracking issue

Why are the changes needed?

To remove = directly is more clarity

What changes were proposed in this pull request?

  • remove trailing '=' character
  • Add an assertion to check if the tag does not contain equal signs

How was this patch tested?

Setup process

FLYTE_SDK_LOGGING_LEVEL=20 pyflyte run --remote -p flytesnacks --domain development my_workflows/dev_image_spec.py wf

from flytekit import ImageSpec, task, workflow

flytekit_git_version = "git+https://github.com/jasonlai1218/flytekit.git@remove-equal-sign#commit=4c9ff81992692dbf5331fe8a04851cf36cb3761b"

py_image_spec = ImageSpec(
    name="test_version_1",
    registry="jasonlai1218",
    packages=[flytekit_git_version],
    apt_packages=["git"],
    env={"FLYTE_SDK_LOGGING_LEVEL": "20"},
)


@task(container_image=py_image_spec)
# @task
def t(a: int, b: int) -> int:
    return a + b


@workflow
def wf(a: int=5, b: int=3) -> int:
    out = t(a=a, b=b)
    return out

Screenshots

Screenshot 2024-03-05 at 4 23 50 PM

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

- Fix a bug where the tag contains equal signs
- Add an assertion to check if the tag does not contain equal signs

Signed-off-by: jason.lai <[email protected]>
- Modify assertion to check for inequality instead of absence of character in tag
- Refactor image name calculation to use f-string interpolation

Signed-off-by: jason.lai <[email protected]>
- Add print statements to display the generated tag
- Update the tag generation process to remove trailing equals sign

Signed-off-by: jason.lai <[email protected]>
- Remove `click.secho` calls for outputting the tag
- Add `print` statements for outputting the tag

Signed-off-by: jason.lai <[email protected]>
- Refactor tag generation code in `calculate_hash_from_image_spec` function

Signed-off-by: jason.lai <[email protected]>
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.98%. Comparing base (1bb5067) to head (89b476c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2240   +/-   ##
=======================================
  Coverage   85.98%   85.98%           
=======================================
  Files         320      320           
  Lines       24245    24250    +5     
  Branches     3666     3667    +1     
=======================================
+ Hits        20847    20852    +5     
  Misses       2746     2746           
  Partials      652      652           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- Update the image tag values in `test_run.py`
- Remove ellipses from the image tag values

Signed-off-by: jason.lai <[email protected]>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Mar 6, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by maintainer label Mar 6, 2024
@pingsutw pingsutw merged commit cacb9f0 into flyteorg:master Mar 6, 2024
92 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants