Maven

PenchY is using Maven in order to distribute the client and its dependencies. You can find the corresponding Maven Project Object Models in the mvn subdirectory of the PenchY distribution.

The PenchY client is deployed as a zip file built by the Maven Assembly Plugin when you execute mvn deploy in mvn/penchy. The descriptor is located in mvn/penchy/descriptor.xml and lists the files which are going to be included in the zip file.

Deploying PenchY via Maven

If you wish to host PenchY on your own server, you need to edit mvn/penchy/pom.xml and set the id in of your maven repository server accordingly.

Let’s assume your ~/.m2/settings.xml defines a server mysite:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository/>
    <interactiveMode/>
    <usePluginRegistry/>
    <offline/>
    <pluginGroups/>
    <servers>
        <server>
            <id>mysite</id>
            <username>bp</username>
            <privateKey>${env.HOME}/.ssh/id_rsa</privateKey>
            <filePermissions>664</filePermissions>
            <directoryPermissions>775</directoryPermissions>
        </server>
    </servers>
</settings>

Then you’d have to modify penchy/mvn/pom.xml and set the server id to mysite:

<distributionManagement>
    <repository>
        <id>mysite</id>
        <url>scpexe://mysite/var/www/mvn.0x0b.de/htdocs</url>
    </repository>
</distributionManagement>

and finally execute:

mvn deploy

to build the PenchY zip and upload it to your server.

Please keep in mind that if you change the repository from which your clients will receive PenchY from, you also need to edit BootstrapPOM in penchy/maven.py to reflect this change.

If you remove repo from the DEPENDENCY dictionary completely, your nodes need to know where to find PenchY by itself. This is usually done by setting up a ~/.m2/settings.xml on the nodes.

Updating PenchY

When you add features to PenchY such as new filters or workloads, you will have to update PenchY in your maven repository.

This can be accomplished by increasing the version number in mvn/penchy/pom.xml and simply running:

mvn deploy

The version number in PenchY’s source code will automatically replaced by the maven replacer plugin.

Deploying Tamiflex via Maven

PenchY ships with a Project Object Model for Tamiflex, which is located in mvn/poa/pom.xml. If you wish to host Tamiflex by yourself, you’ll need to edit the Project Object Model and set the server you wish to upload to. Afterwards, you can simply call:

mvn deploy

Maven will then automatically download Tamiflex from its website using the wagon maven plugin. and deploy it to your server.

Yet again, when using your own repository for tamiflex, you’ll have to change the location of Dacapo in penchy/jobs/workloads.py.

Declaring Maven Dependencies

PenchY is using Maven to handle dependencies which Workloads might have.

Maven dependencies can be declared using the MavenDependeny module:

class penchy.maven.MavenDependency(groupId, artifactId, version, repo=None, classifier=None, artifact_type=None, packaging=None, filename=None, checksum=None)[source]

Bases: object

This class represents a Maven Dependency.

A sample Maven Dependency might look like:

dep = MavenDependency('de.tu_darmstadt.penchy',
                      'pia', '2.0.0.0', 'http://mvn.0x0b.de')

This class will try its best to determine the filename on its own, but since it’s not always clear what the exact filename will be like, it might be neccessary to pass it as keyword argument. If the filename cannot be determined, LookupError will be thrown.

If the checksum parameter is specified, the file’s sha1 checksum will be checked against this checksum. An artifact’s checksum can be computed using:

$ sha1sum myartifact-0.1.jar

A real life MavenDependency making use of the checksum feature would look like:

MavenDependency(
    'org.scalabench.benchmarks',
    'scala-benchmark-suite',
    '0.1.0-20110908.085753-2',
    'http://repo.scalabench.org/snapshots/',
    filename='scala-benchmark-suite-0.1.0-SNAPSHOT.jar',
    checksum='fb68895a6716cc5e77f62ed7992d027b1dbea355')
Parameters:
  • groupId (string) – the maven group id.
  • artifactId (string) – the maven artifact id.
  • version (string) – the version of the artifact.
  • repo (string) – the maven repository to use.
  • classifier (string) – the classifier of the artifact.
  • artifact_type (string) – the type of the artifact.
  • packaging (string) – the packaging of the artifact.
  • filename (string) – filename of the artifact; guessed if not specified.
  • checksum (string) – the sha1 checksum of the file.
actual_checksum

The actual checksum of this artifact. Will be computed and cached.

check_checksum()[source]

Checks if the checksum is correct.

Raises:IntegrityError if the checksum is not correct.
filename

The full absolute path to this artifact.

Returns:path to artifact
Return type:string

If you want to write, for example, a Workload named Dacapo which depends on the dacapo benchmark suite, you’d simply declare its dependencies as a class attribute like so:

class Dacapo(Workload):
    DEPENDENCIES = set((MavenDependency(...),)

Once the dependencies have been declared, they will be collected and installed on the nodes via maven pom files which are automatically produced on all nodes.