Skip to content

Container Trees

Vanessa Sochat edited this page Apr 18, 2017 · 4 revisions

Singularity Python has functions to visualize containers, meaning creating container trees and comparing containers.

View the inside of a container

What's inside that container? Right now, the main way to answer this question is to do some equivalent of ssh. shub provides a command line function for rendering a view to (immediately) show the contents of an image (folders and files) in your web browser.

Container Trees

shub will render the guts of any Docker image, even if it's not currently on your system. You don't need to have Docker installed for this to work.

shub --image docker://ubuntu:latest --tree

You can also do this with a local image, it will work equivalently:

shub --image ubuntu.img --tree

Each of these commands will open up something that looks like this:

img/files.png An interactive demo is also available, and see the example for updates.

Package Trees

Do you have sets of containers or packages, and want to cluster them based on similarities?

examples/package_tree/docker-os.png

We have examples for both deriving scores and producing plots like the above, see examples/visualize/tree/package_tree

Similarity Trees

examples/similar_tree/simtree.png

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:

shub --images centos.img,ubuntu.img --simtree --debug

We can also compare a local image to a Docker image:

shub --images docker://ubuntu:latest,/home/vanessa/Desktop/ubuntu.img --simtree --debug

Or two Docker images:

shub --images docker://ubuntu:latest,docker://centos:latest --simtree

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.

An interactive demo is also available.

Difference Trees

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.

shub --subtract --images docker://ubuntu:latest,docker://centos:latest

As with simtree, this function supports both docker and singularity images as inputs.

examples/difference_tree/difftree.png

An interactive demo is also available.

Clone this wiki locally