You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,6 +49,8 @@ After installation, you should be able to run `shub` on the command line, withou
49
49
--package package a singularity container for singularity hub
50
50
--tree view the guts of an singularity image (use --image)
51
51
--simtree view common guts between two images (use --images)
52
+
--subtract subtract one container image from the second to make
53
+
a difference tree (use --images first,subtract)
52
54
--simcalc calculate similarity (number) between images based on
53
55
file contents.
54
56
--size SIZE If using Docker or shub image, you can change size
@@ -114,10 +116,12 @@ This will open up something that looks like this:
114
116
An [interactive demo](https://singularityware.github.io/singularity-python/examples/container_tree) is also available, and see the [example](examples/container_tree) for updates.
What do two containers have in common, in terms of files and folders? shub provides a command line function for rendering a view to (immediately) show the similarity between to container images:
122
126
123
127
@@ -139,26 +143,52 @@ Or two Docker images:
139
143
If you need output for any of the following, you can add the `--debug` argument. Note that when generating docker comparisons, the back end is obtaining the layers, creating the images, importing and packaging, so the result is not instantanous.
140
144
141
145
146
+
An [interactive demo](https://singularityware.github.io/singularity-python/examples/similar_tree/) is also available.
147
+
148
+
149
+
#### Container Difference Tree
150
+
What files and folders differ between two containers? What does it look like if I subtract one image from the second? `shub` provides a command line tool to generate a visualization to do exactly this.
An [interactive demo](https://singularityware.github.io/singularity-python/examples/difference_tree/) is also available.
160
+
161
+
162
+
### Compare Containers
163
+
The same functions above can be used to show the exact similarities (intersect) and differences (files and/or folders unique to two images) between two images. You can get a data structure with this information as follows:
164
+
165
+
166
+
from shub.views import compare_containers
167
+
168
+
image1 = 'ubuntu.img'
169
+
image2 = 'centos.img'
170
+
by = "files.txt" # can also be "folders.txt", or a list with both
We can calculate similarity of images based on the file content inside. For an example, see [examples/calculate_similarity](examples/calculate_similarity). We can compare two local images as follows:
and the same applies for specification of Docker images, as in the previous example. Note that we are specifying `images` for the argument instead of `image`, and it's a single string of image names separated by a comma. For this argument you can specify an image or package.
182
+
and the same applies for specification of Docker images, as in the previous example. Note that we are specifying `images` for the argument instead of `image`, and it's a single string of image names separated by a comma.
An [interactive demo](https://singularityware.github.io/singularity-python/examples/similar_tree/) is also available.
154
184
155
185
156
186
### Build your container
157
187
More information coming soon.
158
188
159
189
160
190
### Functions Provided
161
-
You can also use the library as a module, and import singularity-python functions into your application.
191
+
You can also use the library as a module, and import singularity-python functions into your application. If you would like to see specific examples for something, [please ask](https://github.com/singularityware/singularity-python)!
0 commit comments