benchbuild.container module¶
Container construction tool.
This tool assists in the creation of customized uchroot containers. You can define strategies and apply them on a given container base-image to have a fixed way of creating a user-space environment.
-
class
benchbuild.container.BashStrategy[source]¶ Bases:
benchbuild.container.ContainerStrategyThe user interface for setting up a bash inside the container.
-
class
benchbuild.container.Container(executable)[source]¶ Bases:
plumbum.cli.application.ApplicationManage uchroot containers.
-
VERSION= '3.4.2.dev3+g0712eee'¶
-
verbosity¶ Sets an attribute
-
-
class
benchbuild.container.ContainerBootstrap(executable)[source]¶ Bases:
plumbum.cli.application.ApplicationCheck for the needed files.
-
class
benchbuild.container.ContainerCreate(executable)[source]¶ Bases:
plumbum.cli.application.ApplicationCreate a new container with a predefined strategy.
We offer a variety of creation policies for a new container. By default a basic ‘spawn a bash’ policy is used. This just leaves you inside a bash that is started in the extracted container. After customization you can exit the bash and pack up the result.
-
class
benchbuild.container.ContainerList(executable)[source]¶ Bases:
plumbum.cli.application.ApplicationPrints a list of the known containers.
-
class
benchbuild.container.ContainerRun(executable)[source]¶ Bases:
plumbum.cli.application.ApplicationExecute commannds inside a prebuilt container.
-
class
benchbuild.container.ContainerStrategy[source]¶ Bases:
objectInterfaces for the different containers chosen by the experiment.
-
class
benchbuild.container.MockObj(**kwargs)[source]¶ Bases:
objectContext object to be used in strategies.
This object’s attributes are initialized on construction.
-
class
benchbuild.container.SetupPolyJITGentooStrategy[source]¶ Bases:
benchbuild.container.ContainerStrategyInterface of using gentoo as a container for an experiment.
-
benchbuild.container.clean_directories(builddir, in_dir=True, out_dir=True)[source]¶ Remove the in and out of the container if confirmed by the user.
-
benchbuild.container.find_hash(container_db, key)[source]¶ Find the first container in the database with the given key.
-
benchbuild.container.pack_container(in_container, out_file)[source]¶ Pack a container image into a .tar.bz2 archive.
Parameters: - in_container (str) – Path string to the container image.
- out_file (str) – Output file name.
-
benchbuild.container.run_in_container(command, container_dir)[source]¶ Run a given command inside a container.
Mounts a directory as a container at the given mountpoint and tries to run the given command inside the new container.
-
benchbuild.container.set_input_container(_container, cfg)[source]¶ Save the input for the container in the configurations.
-
benchbuild.container.setup_bash_in_container(builddir, _container, outfile, shell)[source]¶ Setup a bash environment inside a container.
Creates a new chroot, which the user can use as a bash to run the wanted projects inside the mounted container, that also gets returned afterwards.