04-21-2020 02:55 PM - edited 04-21-2020 03:05 PM
Hi,
I'm building docker container for a stateful app I'm working on and I installed the cobra SDK on it:
pip install acicobra-4.2_3l-py2.py3-none-any.whl pip install acimodel-4.2_3l-py2.py3-none-any.whl
I noticed that the size of these modules is huge and takes 877MB out of the total 1GB of my container size:
/ # du | sort -k1,1n -r | tail -20 21628 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/pol 22264 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/copp 23252 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/eqptcapacity 27772 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/eqpt/__pycache__ 28240 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/action/__pycache__ 30968 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/condition 31148 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/cloud 34864 ./usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu 39600 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/fault/__pycache__ 62740 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/action 68836 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/eqpt 88640 ./usr/local/lib/python3.8/site-packages/cobra/modelimpl/fault 874420 ./usr/local/lib/python3.8/site-packages/cobra/modelimp
877316 ./usr/local/lib/python3.8/site-packages/cobra911296 ./usr/local/lib/python3.8/site-packages 981676 ./usr/local/lib/python3.8 1000580 ./usr/local/lib 1001748 ./usr/local 1008224 ./usr 1016316 .
Having the 1GB limitation for the container size makes it very difficult to install other python packages that are required for my container (Flask, requests, SQLalchemy etc.)
The reference docker file from the developer guide is using python2 which I would like to avoid so that's why I'm not using it.
Please advise if there is a way to minimize the cobra SDK size or alternatively to increase the 1GB image limit.
Thanks,
Yaniv
Solved! Go to Solution.
04-22-2020 08:43 AM
@Yaniv Rozenboim wrote:My container works fine but perhaps it's better to document that the 1GB isn't really a hard limit but more of a recommendation.
Probably that's why it's mentioned "should" in the cfg guide.
I also think it would make sense to publish a new reference docker image that includes the cobra SDK running on Python3 (especially now with Python2 reaching EOL).
I fully agree! Also, python2 is already EOL, from all perspectives. Whoever is doing new projects in python2 should be punished. just my opinion :)
04-22-2020 12:28 AM
I know that the guidelines and limitation says that the docker image should not exceed 1GB, but looking at the size you have, you are at 1,01GB so that's not that much over the 'soft' limit.
Have you tested the app like this? Do you see any problems running it?
Regards,
Sergiu
04-22-2020 01:08 AM
04-22-2020 02:17 AM
04-22-2020 07:20 AM
Your post is back! ^_^
04-22-2020 08:13 AM
Thanks a lot!
My container works fine but perhaps it's better to document that the 1GB isn't really a hard limit but more of a recommendation.
I also think it would make sense to publish a new reference docker image that includes the cobra SDK running on Python3 (especially now with Python2 reaching EOL).
04-22-2020 08:43 AM
@Yaniv Rozenboim wrote:My container works fine but perhaps it's better to document that the 1GB isn't really a hard limit but more of a recommendation.
Probably that's why it's mentioned "should" in the cfg guide.
I also think it would make sense to publish a new reference docker image that includes the cobra SDK running on Python3 (especially now with Python2 reaching EOL).
I fully agree! Also, python2 is already EOL, from all perspectives. Whoever is doing new projects in python2 should be punished. just my opinion :)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide