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
creating standalone binary for kapitan #323
Conversation
5cf56e4
to
cae117c
Compare
cae117c
to
54e033e
Compare
@yoshi-1224 this is exactly it! |
@ramaro @uberspot So I believe the questions are:
Thanks! |
@yoshi-1224 I don't think we're aiming for performance boost here, but portability instead. I'd say let's keep cython out of the picture for now (we can revisit later). @uberspot what do you think? |
++ for the performance part. Usually this would run in CI pipelines anyway so this wouldn't be greatly prioritised. We can always revisit in the future if that changes. :) |
@ramaro @uberspot Thanks for the feedback!
I see. In that case, Pyinstaller actually advises to run it on each of the target platforms, so I guess Cython wouldn't help for improving the portability any further? So we now need to build a pipeline for automatically building this binary on Debian (as pointed out on the GSoC proposal) for each release. Could you advise me on how I could achieve this? I think as far as building the binary goes, we could use something like Vagrant. |
Travis has the following OSs available https://docs.travis-ci.com/user/reference/overview/ |
@uberspot I added Dockerfile for building the binary. Tests are passing on Travis as well. |
@yoshi-1224 yes good point! Please do add. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go for me! :)
Just needs rebasing before merging:
Rebasing the commits of this branch on top of the base branch cannot be performed automatically due to conflicts encountered while reapplying the individual commits from the head branch.
@uberspot @ramaro @adrianchifor |
Nice! :) |
💯 |
Fixes issue #145
My apologies for not checking in lately. This work is quite exploratory in nature compared to other tasks so couldn't really figure the right time to report.
So far I've been checking out pyinstaller and nuitka as the tool for making the standalone binary for kapitan.
Pyinstaller
Nuitka
suggestion
I believe it is best to go with PyInstaller since we do releases on a regular basis and we want to pick a solution that gives us least hassle for every update. Fortunately, the resulting binary from PyInstaller is not so large either (projects using things like pyqt and pandas seem to have it much worse)
I'd been trying to reduce the size of the resulting binary, and the following shows the output of
ls
ordered by size of the binary components (up to 10th largest):Judging by this, I don't think there is much room for improvement in terms of the size considering the fact that we will need to manually dig through smaller unused imports (and even if that's possible we can't do much with import statements outside of kapitan). I've tried pyinstaller both with and without virtualenv but the resulting size is roughly the same. I've also used UPX for compression, but unfortunately it doesn't do much either.
TODO
@uberspot @ramaro
Please let me know if this direction is ok. Thanks for your time!