Index: /saga/trunk/examples/misc/aws.cpp =================================================================== --- /saga/trunk/examples/misc/aws.cpp (revision 3242) +++ /saga/trunk/examples/misc/aws.cpp (revision 3243) @@ -6,6 +6,4 @@ #include - -#define COUNT 100 void print_io (saga::job::job j) @@ -40,39 +38,27 @@ std::string instance = "") { + saga::url js_url (type + "://" + instance); - std::cout << " ----------------------- 0 (" << type << ") \n"; + std::cout << " ----------------------- (" << type << " - " << js_url << ") \n"; - saga::session s1; - std::cout << " ----------------------- 1 (" << type << ") \n"; + // create a context for that cloud type + saga::context c (type); + c.set_defaults (); - saga::context c1 (type); + // attach it to the session + saga::session s; + s.add_context (c); - std::cout << " ----------------------- 2 (" << type << ") \n"; + // create a job service in that session + saga::job::service js (s, js_url); - c1.set_defaults (); + // create and run a job on that job service (i.e. on that VM) + saga::job::job j = js.create_job (jd); + j.run (); - std::cout << " ----------------------- 3 (" << type << ") \n"; - - s1.add_context (c1); - - std::cout << " ----------------------- 4 (" << type << " - " << js_url << ") \n"; - - saga::job::service js1 (s1, js_url); - - std::cout << " ----------------------- 5 (" << type << ") \n"; - - saga::job::job j1 = js1.create_job (jd); - - std::cout << " ----------------------- 6 (" << type << ") \n"; - - j1.run (); - - std::cout << " ----------------------- 7 (" << type << ") \n"; - - print_io (j1); - - std::cout << " ----------------------- 8 (" << type << ") \n"; + // print job output + print_io (j); } @@ -97,9 +83,9 @@ jd.set_vector_attribute (saga::job::attributes::description_arguments, args); - saga::url t ("file://localhost//Users/merzky/links/saga/projects/applications/MapReduce/samples/file.txt"); // FIXME: the job service contact should point to the ec2 service instance. // Problem: what protocol to use? We need to denotify the context type (do - // we?), _and_ the ec2 service protocol (http/https). + // we?), _and_ the ec2 service protocol (http/https). Anyway, this needs to + // be fixed in the adaptor. // // "https://ec2.amazonaws.com/" @@ -107,9 +93,18 @@ // "https://tp-vm1.ci.uchicago.edu:8445/wsrf/services/ElasticNimbusService" // "https://vm02.cct.lsu.edu:8443/" - - // test_cloud (jd, "ec2"); - test_cloud (jd, "ec2", "i-d642c7bf"); + + // create a new instance on ec2, and run a test job + test_cloud (jd, "ec2"); + + // access a running VM instance on ec2, and run a test job + // test_cloud (jd, "ec2", "i-d642c7bf"); + + // samoe for eucalyptus + // test_cloud (jd, "eucalyptus"); // test_cloud (jd, "eucalyptus", "i-417E085F"); + + // samoe for nimbus // test_cloud (jd, "nimbus"); + // test_cloud (jd, "nimbus", "i-3247A527"); }