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

Fix sqlite in python3 #64

Merged
merged 8 commits into from
Mar 11, 2019
Merged

Fix sqlite in python3 #64

merged 8 commits into from
Mar 11, 2019

Conversation

pshem
Copy link

@pshem pshem commented Mar 4, 2019

As discussed in #62.

Changes to python3x/module.py and python3x/GET can be reverted when cloudius-systems/osv#184 is closed, as they will no longer be useful.

python3x/GET Outdated Show resolved Hide resolved
when there are no benefits to rsync
@wkozaczuk
Copy link
Collaborator

@pshem I am going to merge this pull request. But would you mind to tweak this app to not include some huge static library files (*.a) that make the resulting images 70MB big. Thanks.

@wkozaczuk wkozaczuk merged commit 6a075f3 into cloudius-systems:master Mar 11, 2019
@wkozaczuk
Copy link
Collaborator

More specifically these 2 are huge and bother me:

du -h /usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/*.a
37M	/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a
36M	/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m-pic.a

@pshem
Copy link
Author

pshem commented Mar 11, 2019

Gj @wkozaczuk ! I didn't realize we could just filter out the static libraries. Should I write a patch to do the same thing with the non-stripped shared objects, or do you think that would break things?

@wkozaczuk
Copy link
Collaborator

wkozaczuk commented Mar 11, 2019 via email

@pshem
Copy link
Author

pshem commented Mar 11, 2019

I just updated the OSv submodule we use and saw my application's compiled image halved. Thank you very much!

@wkozaczuk
Copy link
Collaborator

wkozaczuk commented Mar 13, 2019

You can remove specific shared libraries if you know they are NOT used by python or its modules or Python libraries you are using. In general shared libraries (*.so) are dynamically loaded typically in the lazy fashion so it is not that easy to verify if they are used or not. For example ldd shows you what shared libraries given native app depends on, but it does NOT tell you which symbols in those libraries and which execution paths would actually be used.

On other hand *.a files are static libraries which are ONLY used when statically linking native code in build phase, which does not happen in this case against those *.a files any way. Concluding *.a files can be always removed as a rule of thumb from all OSv images as they would NEVER be used by running OSv. I hope it makes it all clear.

pshem added a commit to pshem/osv-apps that referenced this pull request Mar 14, 2019
Static libraries have been removed from `mysql` images. This speeds up the build process and shrinks the resulting image. All credit for the idea to @wkozaczuk, based on cloudius-systems#64 (comment)
@pshem pshem deleted the patch-3 branch March 20, 2019 00:12
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 this pull request may close these issues.

3 participants