Open toxygene opened 2 weeks ago
Let me think about some solutions. I will comeback to you with a feature branch.
@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://git@github.com/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.
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 acdk.out
directory that was ~2.5G), thecontainer.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 anexclude
property in thepyproject.toml
file. It looks likeTarFile.add
supports afilter
argument, which looks like a good starting point.Attached is the stacktrace that was output when the OSError occurred.
stacktrace.txt