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

Check envd version before building images #2122

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Check envd version before building images #2122

merged 3 commits into from
Jan 23, 2024

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jan 20, 2024

Tracking issue

NA

Why are the changes needed?

This PR changes the default destination-dir to ., so flytekit will download the code to the workdir specified in the Dockerfile. However, envd<0.3.39 replace the workdir to /, and flytekit may not have permission to download a file to /. Therefore, we should force people to use envd>0.3.39 to build the image.

image

What changes were proposed in this pull request?

Check envd version before building images. Raise an error if it is lower than 0.3.39.

How was this patch tested?

from flytekit import task, workflow, ImageSpec

image_spec = ImageSpec(
    base_image="ghcr.io/flyteorg/flytekit:py3.11-1.10.2",
    packages=["flytekit>=1.6.0", "numpy", "mypy"],
    registry="pingsutw",
    python_version="3.11"
)


@task(container_image=image_spec, cache_version="1.0", cache=True)
def get_data() -> str:
    return "hello dgx.."


@task(
    container_image=dgx_image_spec
)
def train(data: str) -> str:
    print(data)

    return f"gpu is available: 123"


@workflow
def wf() -> str:
    data = get_data()
    return train(data=data)

Check all the applicable boxes

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

Signed-off-by: Kevin Su <pingsutw@gmail.com>
Signed-off-by: Kevin Su <pingsutw@gmail.com>
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (139fa2f) 85.78% compared to head (cc052dd) 85.78%.

Files Patch % Lines
flytekit/image_spec/image_spec.py 42.85% 3 Missing and 1 partial ⚠️
...lytekit-envd/flytekitplugins/envd/image_builder.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2122      +/-   ##
==========================================
- Coverage   85.78%   85.78%   -0.01%     
==========================================
  Files         313      313              
  Lines       23525    23531       +6     
  Branches     3517     3519       +2     
==========================================
+ Hits        20182    20185       +3     
- Misses       2734     2736       +2     
- Partials      609      610       +1     

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

Signed-off-by: Kevin Su <pingsutw@gmail.com>
Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test it by using the code in the PR.
image

@pingsutw pingsutw merged commit 0006b01 into master Jan 23, 2024
82 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants