<s> import sys <EOL> import os <EOL> import time <EOL> import logging <EOL> import uuid <EOL> from pilot import PilotComputeService , PilotDataService , ComputeDataService , State <EOL> from bigjob import logger <EOL> COORDINATION_URL = "<STR_LIT>" <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print COORDINATION_URL <EOL> pilot_data_service = PilotDataService ( coordination_url = COORDINATION_URL ) <EOL> pilot_data_description_aws = { <EOL> "<STR_LIT>" : "<STR_LIT>" + str ( uuid . uuid1 ( ) ) , <EOL> "<STR_LIT:size>" : <NUM_LIT:100> , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> pilot_data_description_india = { <EOL> "<STR_LIT>" : "<STR_LIT>" + str ( uuid . uuid1 ( ) ) , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> pd = pilot_data_service . create_pilot ( pilot_data_description = pilot_data_description_aws ) <EOL> data_unit_description = { <EOL> "<STR_LIT>" : [ os . path . join ( os . getcwd ( ) , "<STR_LIT>" ) ] , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> input_data_unit = pd . submit_data_unit ( data_unit_description ) <EOL> input_data_unit . wait ( ) <EOL> logger . info ( "<STR_LIT>" + input_data_unit . get_url ( ) ) <EOL> pilot_compute_service = PilotComputeService ( coordination_url = COORDINATION_URL ) <EOL> pilot_compute_description_amazon_west = { <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : <NUM_LIT:1> , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> pilot_compute_description_euca_india = { <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : <NUM_LIT:1> , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT:root>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> pilotjob = pilot_compute_service . create_pilot ( pilot_compute_description = pilot_compute_description_amazon_west ) <EOL> compute_data_service = ComputeDataService ( ) <EOL> compute_data_service . add_pilot_compute_service ( pilot_compute_service ) <EOL> compute_data_service . add_pilot_data_service ( pilot_data_service ) <EOL> output_data_unit_description = { <EOL> "<STR_LIT>" : [ ] <EOL> } <EOL> output_data_unit = pd . submit_data_unit ( output_data_unit_description ) <EOL> output_data_unit . wait ( ) <EOL> compute_unit_description = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] , <EOL> "<STR_LIT>" : <NUM_LIT:1> , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:error>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ input_data_unit . get_url ( ) ] , <EOL> "<STR_LIT>" : [ <EOL> { <EOL> output_data_unit . get_url ( ) : <EOL> [ "<STR_LIT>" ] <EOL> } <EOL> ] <EOL> } <EOL> compute_unit = compute_data_service . submit_compute_unit ( compute_unit_description ) <EOL> logger . info ( "<STR_LIT>" ) <EOL> compute_data_service . wait ( ) <EOL> logger . debug ( "<STR_LIT>" + str ( output_data_unit . list ( ) ) ) <EOL> logger . info ( "<STR_LIT>" ) <EOL> compute_data_service . cancel ( ) <EOL> pilot_data_service . cancel ( ) <EOL> pilot_compute_service . cancel ( ) </s>
