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

copy_to_container fails if the project is large #32

Open
toxygene opened this issue Oct 26, 2024 · 2 comments · May be fixed by #33
Open

copy_to_container fails if the project is large #32

toxygene opened this issue Oct 26, 2024 · 2 comments · May be fixed by #33

Comments

@toxygene
Copy link

toxygene commented Oct 26, 2024

Assuming I understand the code correctly, it appears that the copy_to_container method creates a tar file containing the entire project, and copies it to the container. If the project contains any large files (in my case, I had a cdk.out directory that was ~2.5G), the container.put_archive call fails with a mysterious ('Connection aborted.', OSError(22, 'Invalid argument')) error. Best I've been able to determine, this is due to the filesize exceeding some limit imposed by the OS (MacOS Sonoma 14.6.1, in my case).

It would be helpful if this plugin supported something similar to .dockerignore or an exclude property in the pyproject.toml file. It looks like TarFile.add supports a filter argument, which looks like a good starting point.

Attached is the stacktrace that was output when the OSError occurred.

stacktrace.txt

@micmurawski
Copy link
Owner

Let me think about some solutions. I will comeback to you with a feature branch.

@micmurawski micmurawski linked a pull request Oct 27, 2024 that will close this issue
@micmurawski
Copy link
Owner

micmurawski commented Oct 28, 2024

@toxygene I am still working on finishing touches, but you may check how the feature works for you by installing it from the feature branch

poetry self add git+ssh://[email protected]/micmurawski/poetry-plugin-lambda-build@feat/implement-ignore-files

if you run poetry lambda-build --help, you should notice a new field copy-to-container-ignore you can provide it as an argument of CLI execution poetry lambda-build --copy-to-container-ignore, or in pypoject.toml

copy-to-container-ignore = ["cdk.out"]

I am curious about your feedback. Let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants