HUB
Sign inSign up

bscppc/compss-container-master

By bscppc

•Updated almost 7 years ago

Image
0

820

bscppc/compss-container-master repository overview

⁠COMPSs on Docker

This Docker image serves as a COMPSs master that is able to deploy and run tasks on containers. Create the container with the following command:

docker run -it --rm -p <port>:<port> bscppc/compss-container-master

...where port represents the port that the master will use to communicate with the compute nodes. Once inside the container, check that the $PATH is correctly loaded by trying to run runcompss -h. If the command is not found, run . /etc/profile.d/compss.sh.

In the $HOME (/root) directory there is a JAR file with a COMPSs application. This application is matmul, this is, a matrix multiplication application. This application has also been uploaded to the DockerHub as bscppc/compss-matmul-app. Along with the app, two configuration files, project.xml and resources.xml have been added. These need to be updated with the information of the nodes that are going to be used.

⁠resources.xml

The resources.xml file looks as shown below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourcesList>
    <ComputeNode Name="WORKER-IP">
        <Processor Name="MainProcessor">
            <ComputingUnits>4</ComputingUnits>
        </Processor>
        <Adaptors>
            <Adaptor Name="es.bsc.compss.nio.master.NIOAdaptor">
                <SubmissionSystem>
                    <Interactive/>
                </SubmissionSystem>
                <Ports>
                    <MinPort>43001</MinPort>
                    <MaxPort>43002</MaxPort>
                </Ports>
                <Properties>
                    <Property>
                        <Name>Engine</Name>
                        <Value>docker</Value>
                    </Property>
                </Properties>
            </Adaptor>
        </Adaptors>
    </ComputeNode>
</ResourcesList>

One ComputeNode entry must be created per each compute node that shall be used, specifying the IP or hostname (if resolvable) in the name, replacing WORKER-IP. The Engine property specifies that the tasks will run on Docker. The master, i.e. the container itself, should be able to do passwordless SSH to all compute nodes. To do so, the content of the file ~/.ssh/id_rsa.pub inside the container must be copied into the ~/.ssh/authorized_keys of all compute nodes.

⁠project.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Project>
    <MasterNode/>
    <ComputeNode Name="WORKER-IP">
        <InstallDir>/opt/COMPSs</InstallDir>
        <WorkingDir>/tmp/COMPSsWorker/</WorkingDir>
        <User>WORKER-USER</User>
        <Adaptors>
            <Adaptor Name="es.bsc.compss.nio.master.NIOAdaptor">
                <SubmissionSystem>
                    <Interactive/>
                </SubmissionSystem>
                <Properties>
                    <Property>
                        <Name>ImageName</Name>
                        <Value>bscppc/compss-matmul-app</Value>
                    </Property>
                </Properties>
            </Adaptor>
        </Adaptors>
    </ComputeNode>
</Project>

Again, each compute node should have its corresponding ComputeNode entry in the file. The name or IP field and the user field must be correctly filled, replacing WORKER-IP. The user field is used to specify the username for the SSH connection, so WORKER-USER must be replaced with the actual user name of the compute node.

An optional Property, PullIfNeeded, can be set to true if the application image is not in the compute node. If the property is set to true COMPSs will take care of pulling the image, but the execution of the application will be considerably longer. It is recommended that the image is pulled beforehand.

⁠Running the app

To run the app, run the following command:

runcompss [-d] --master_name=HOST_IP --master_port=PORT --project=project.xml --resources=resources.xml matmul.objects.Matmul MSIZE BSIZE 

...where HOST_IP is the IP of the interface in the host running the container that connects to the compute node, PORT is the port specified in the port redirection when creating the container and MSIZE and BSIZE specify the size of the matrices that will be multiplied. Setting both to 5 makes for a short execution, and setting them to, say, 15, makes for a fairly long execution.

⁠Creating your own application image

If you have another Java COMPSs application compiled into a JAR, you can create your own application image with docker build and the following Dockerfile:

FROM bscppc/compss-worker-x86_64

ADD app.jar /compss/app.jar

...asumming the name of the JAR file is app.jar and that it is stored in the same directory. This image only works for x86_64 architecture.

Tag summary
Recent tags
Content type
Image
Digest
Size
1 GB
Last updated
almost 7 years ago
docker pull bscppc/compss-container-master:latest