jclouds / legacy-jclouds-cli

https://jclouds.apache.org
Apache License 2.0
17 stars 5 forks source link

shrink jclouds-cli size #18

Closed gaul closed 9 years ago

gaul commented 11 years ago

Presently the tar.gz is 49 MB -- can we prune any unneeded dependencies? The biggest offenders are Karaf Jaas (7 MB), Spring (8 MB), Pax (7 MB) and Groovy (6 MB).

iocanel commented 11 years ago

We can and should get rid of spring. We may be able to get rid of karaf jaas. We could possibly replace groovy-full with the lightest possible groovy jar that is needed for use with the scripting engine. We can't get rid of pax.

codefromthecrypt commented 11 years ago

as I understand groovy is dragged in only to format column names, right? Is there another way that is lighter weight? or an option to not require this?

iocanel commented 11 years ago

Groovy is used as an expression language to retrieve the data to display for each column.

We could build our own simple expression language that will use reflection and introspection, but it will lack closures, which is really useful in many cases. For example:

hardware.headers=[id];[ram];[cpu];[cores] hardware.expressions=hardware.id;hardware.ram;hardware.processors.sum{it.cores*it.speed};hardware.processors.sum{it.cores}

This is why I preffered groovy over ognl, mvel or a custom build language.

codefromthecrypt commented 11 years ago

yeah I guess it depends on whether folks are in fact making custom aggregating columns all that often, and whether we want to make default drag in support for that. ex. for fire-and-forget cli, this is a replacement for ec2-describe-* etc. style invocation. Basic clis usually don't try to do fancy things, and can be much smaller.

iocanel commented 11 years ago

I specified explicilty the features list. This keeps out of the cli karaf features that we are not using. This reduced the size of the cli to the half.

There is still room for improvement, by removing the groovy stuff, so we might get the distro down to 18MB. Beyound that will require much more effort.

gaul commented 11 years ago

Can we also remove bcpkix-jdk15on-1.47.jar, bcprov-jdk15on-1.47.jar, and netty-3.3.1.Final.jar from jclouds-karaf? This would save about 3.4 MB.