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

[BUG] Raise an error if fast-package.tar.gz is too big #5568

Closed
2 tasks done
pingsutw opened this issue Jul 18, 2024 · 2 comments
Closed
2 tasks done

[BUG] Raise an error if fast-package.tar.gz is too big #5568

pingsutw opened this issue Jul 18, 2024 · 2 comments
Labels
bug Something isn't working flytekit FlyteKit Python related issue Improve error handling improve-error-message

Comments

@pingsutw
Copy link
Member

pingsutw commented Jul 18, 2024

Describe the bug

request failed to upload the tar file if it's too big.

Expected behavior

We should check the file size before uploading and raise a nicer error.

Additional context to reproduce

import random
import string

from flytekit import task, workflow


@task(enable_deck=True)
def t1(a: int) -> int:
    return a + 1


@workflow
def wf() -> int:
    return t1(a=3)


if __name__ == '__main__':
    def create_large_file(filename, size_in_mb):
        # Size of the file in megabytes
        size_in_bytes = size_in_mb * 1024 * 1024
        chunk = bytes(''.join(random.choices(string.ascii_uppercase + string.digits, k=1024 * 1024)), 'utf-8')

        with open(filename, 'wb') as f:
            for _ in range(size_in_bytes // len(chunk)):
                f.write(chunk)

            # Write the remaining bytes if any
            remaining_bytes = size_in_bytes % len(chunk)
            if remaining_bytes:
                f.write(b'0' * remaining_bytes)

    create_large_file('/Users/kevin/git/flytekit/flyte-example/test/dummy', 1024 * 5)

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@pingsutw pingsutw added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jul 18, 2024
Copy link

runllm bot commented Jul 18, 2024

The issue you described is related to the failure of uploading a tar file if it exceeds a certain size limit. This can be addressed by checking the file size before attempting the upload and raising a more user-friendly error if the file is too large.

To implement this, you can add a file size check in the flytekit codebase before the upload request. If the file size exceeds the allowed limit, raise an appropriate error message.

Would you like more details on how to implement this in the flytekit codebase?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @RunLLM to ask follow-up questions. See runllm.com for more!

@pingsutw pingsutw added flytekit FlyteKit Python related issue improve-error-message Improve error handling and removed untriaged This issues has not yet been looked at by the Maintainers labels Jul 18, 2024
@davidmirror-ops davidmirror-ops moved this from Backlog to Feature requests in Flyte Issues/PRs maintenance Aug 1, 2024
@pingsutw
Copy link
Member Author

fixed by flyteorg/flytekit#2641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue Improve error handling improve-error-message
Projects
None yet
Development

No branches or pull requests

1 participant