Page History

Turn Off History

Draft & Incomplete

Map-Reduce Jobs under Condor

Introduction

Condor provides a powerful execution environment for running parallel applications like MPI. The Parallel Universe (PU) of Condor is built specifically for this purpose that provides a thin layer of resource management for a wide variety of parallel programming environments. The Map-Reduce (MR) is a relatively recent programming model particularly suitable for applications that require processing a large set of data on cluster of computers. A popular open-source implementation of MR framework is provided by Hadoop project by apache software foundation. This document provides instruction for running Hadoop's MapReduce framework under Condor's opportunistic scheduler.

The support we provided and tested for Map-Reduce (MR) involves using Condor resource manager to select a subset of machines within a cluster, setup a Hadoop MR cluster on this subset, submit a MR job and finally clean-up once the job is finished. The Condor's Parallel Universe already provides support for master-slave style applications e.g. MPI. A user job written to run under PU has the ability to select a set of machines based on certain criteria (specified using job class-ads). These machines will be available as dedicated resources for the duration of the job. Additionally, a user can choose which machine should act as a master and communication channels between masters and slave nodes are also established. In view of these capabilities, Condor has already provided the mechanism to build an on-demand MR cluster.

The above mentioned approach has several advantages over running a dedicated MR cluster e.g. ability to support several execution environments and doing better resource management among these environments. Below we summarize some of the advantages of our approach of running an on-demand MR cluster for specific set of jobs.

  1. Condor has powerful match making capabilities using excellent framework based on Class-Ad mechanism. These capabilities can be exploited to implement multiple policies for a MR cluster beyond the current capabilities of existing frameworks.

  2. MR style of computation might not be suitable for all sorts of applications or problems (e.g. the ones which are inherently sequential). A support for multiple execution environments is needed along with different set of policies for each environment. Condor supports a wide variety of execution environment including MPI style jobs, VMWare job etc.

  3. Perhaps, one of the bigger advantages is related to capacity management with a large shared MR cluster. Currently, the Hadoop MR framework has a very limited support for managing users' job priorities.

Pre-requisite

The support for MR jobs under Condor is based on the availability of Parallel Universe. This document assumes that you have a Condor Parallel Universe setup ready. Mainly you need to configure a dedicated scheduler. The details of this step can be found in the Condor manual (see section 2.9 and 3.13.10). Additionally, you need to have a distributed file system setup e.g. Hadoop distributed file system (HDFS). Starting from version 7.5 Condor comes with a storage daemon that provides support for HDFS. More details about our HDFS daemon can be found in Condor manual (see section 3.3.23 and 3.13.2). Apart from these python version 2.4 or above is required on all the machines, which are part of PU.

Submitting a Job

Getting required files

We have written a handy python script that takes care of a lot of configuration steps involved in creating a job description file. It generates a specially crafted Condor job submit file for your job. It can then be submitted to Condor scheduler using the same script to get back the tracking URL of the job. This URL is where the Job-Tracker' embedded web-server is running. The information about this URL is published as a Job-Ad by mrscript once the Tracker is setup. Using the script you can specify: number of slots (CPUs) to be used, MR cluster parameters e.g. capacity of each TaskTracker, job jar file or a script file if you are trying to submit a set of jobs and also Condor job parameters e.g. 'requirement' attribute.

This script will soon be part of Condor distribution but for now you can just use the latest version attached with this wiki. The attached file (mrscript.tar.gz) contains three files:

You will also need the copy of hadoop software on the machine from where you are submitting the job. This is required, as all required Jar file for running MR processes are copied to machine selected for a given job. As different versions of Hadoop are not compatible with each other, make sure to download the same version as used in Hadoop distributed file system.

{subsubsection: Configuration Parameters)

The mrscript.py require you to specifying certain configuration parameters e.g. number of CPU slots to request, location of Hadoop installation directory on local machine etc. Below is a list of configuration variables whose value you should decide before running the script to generate submit file.

  1. The URL of the Hadoop name-node server.
  2. The java home directory
  3. The hadoop installation directory
  4. The map capacity of each TackTracker.
  5. The reduce capacity of each JobTracker.
  6. The count for machines the parallel universe should use for your job. One of these machines will be used for JobTracker and rest for TaskTracker.
  7. The jar file for your job
  8. The parameters passed to your job.
  9. (Optional) The list of user files that should be sent with your job. These files are other than the ones that mrscript.py is configured to send.

Generating job submit file

Once you have decided upon the values of all of the above-mentioned parameters, you are ready to generate the file. Use the mrscript.py to generate the job.desc file.

	./mrscript.py  -m <map> -r <reduce> -j <java> -c <count> -n <URL> -f <user-file1> -f <user-file2> -c <key-value pair> job-jar-file 'args for job-jar-file'
             (Where) :
               -m: map capacity of a single Task-Tracker
               -r: reducer capacity of a single Task-Tracker
               -j: Location of java home directory on local machine
               -c: Number of machines to request for running MR cluster
               -n: URL of hadoop name-node server
               -f: You can use this option mutliple times to specify additional files that should go with your job.
                   Note that you don't need to specify any of the Hadoop core Jar files.
               -c: Key-value pair corresponding to Hadoop XML configuration files that are placed in appropriate XML files when setting up the MR cluster.
                   You can use this option multiple times.

The above command with right set of parameters will generate 'job.desc' file under current directory. You can directly submit this file. However in that case you will have to extract the location of Job-Tracker web-server from the Job-Ads. It is easy to just use the submit option in mrscript.py for this that periodically poll Job-Ads and pulls the tracker's URL and exits. Here is a simple command to do this step.

         ./mrscript.py -s

Examples

TODO

Attachments: