Skip to content

Commit

Permalink
tmp commit (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Sep 26, 2019
1 parent f62b9b7 commit d032a57
Show file tree
Hide file tree
Showing 14 changed files with 910 additions and 620 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,9 @@ class BareMetalComputeServiceJobTerminationTestWMS : public wrench::WMS {

// Create a 2-task job
wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {},
{std::make_tuple(this->test->input_file, wrench::FileLocation::LOCATION(this->storage_service), wrench::ComputeService::SCRATCH)},
{std::make_tuple(this->test->input_file,
wrench::FileLocation::LOCATION(this->test->storage_service),
wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))},
{}, {});

// Submit the 2-task job for execution
Expand Down Expand Up @@ -1252,7 +1254,9 @@ class BareMetalComputeServiceCompletedJobTerminationTestWMS : public wrench::WMS

// Create a 2-task job
wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {},
{std::make_tuple(this->test->input_file, wrench::FileLocation::LOCATION(this->storage_service), wrench::ComputeService::SCRATCH)},
{std::make_tuple(this->test->input_file,
wrench::FileLocation::LOCATION(this->test->storage_service),
wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))},
{}, {});

// Submit the 2-task job for execution
Expand Down Expand Up @@ -1307,7 +1311,8 @@ void BareMetalComputeServiceTestStandardJobs::do_CompletedJobTermination_test()
// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::BareMetalComputeService(hostname,
{std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
{std::make_pair(hostname,
std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
"/scratch", {})));

// Create a WMS
Expand Down Expand Up @@ -1564,13 +1569,13 @@ void BareMetalComputeServiceTestStandardJobs::do_ShutdownStorageServiceBeforeJob

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::BareMetalComputeService(hostname,
{std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
0, {})));
"", {})));

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;;
Expand All @@ -1585,7 +1590,7 @@ void BareMetalComputeServiceTestStandardJobs::do_ShutdownStorageServiceBeforeJob


// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down
166 changes: 93 additions & 73 deletions test/compute_services/BatchService/BatchServiceTest.cpp

Large diffs are not rendered by default.

86 changes: 50 additions & 36 deletions test/compute_services/StandardJobExecutorTest.cpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,38 @@ class VirtualizedClusterServiceResourceAllocationTest : public ::testing::Test {
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\"> "
" <zone id=\"AS0\" routing=\"Full\"> "
" <host id=\"Gateway\" speed=\"1f\" /> "
" <host id=\"Gateway\" speed=\"1f\" > "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <host id=\"4Cores10RAM\" speed=\"1f\" core=\"4\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <prop id=\"ram\" value=\"10\"/> "
" </host> "
" <host id=\"2Cores20RAM\" speed=\"1f\" core=\"2\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <prop id=\"ram\" value=\"20\"/> "
" </host> "
" <link id=\"1\" bandwidth=\"5000GBps\" latency=\"0us\"/>"
Expand Down Expand Up @@ -184,19 +211,19 @@ void VirtualizedClusterServiceResourceAllocationTest::do_VMResourceAllocationAlg
cloud_service_first_fit = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
{"/scratch"},
{{wrench::CloudComputeServiceProperty::VM_RESOURCE_ALLOCATION_ALGORITHM, "first-fit"}}));

cloud_service_best_fit_ram_first = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
{"/scratch"},
{{wrench::CloudComputeServiceProperty::VM_RESOURCE_ALLOCATION_ALGORITHM, "best-fit-ram-first"}}));

cloud_service_best_fit_cores_first = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
{"/scratch"},
{{wrench::CloudComputeServiceProperty::VM_RESOURCE_ALLOCATION_ALGORITHM, "best-fit-cores-first"}}));

// Create a WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ void VirtualizedClusterServiceTest::do_ShutdownVMAndThenShutdownServiceTest_test
new wrench::FileRegistryService(hostname)));

// Staging the input_file on the storage service
ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -1363,11 +1363,7 @@ class SubmitToVMTestWMS : public wrench::WMS {
// Create a job manager
auto job_manager = this->createJobManager();

wrench::StandardJob *job2 = job_manager->createStandardJob({this->test->task2}, {},
{std::make_tuple(this->test->input_file,
this->test->storage_service,
wrench::ComputeService::SCRATCH)},
{}, {});

std::vector<std::tuple<std::string,std::shared_ptr<wrench::BareMetalComputeService>>> vm_list;

auto cs = *(this->getAvailableComputeServices<wrench::VirtualizedClusterComputeService>().begin());
Expand Down Expand Up @@ -1463,12 +1459,12 @@ void VirtualizedClusterServiceTest::do_SubmitToVMTest_test() {

// Create a Storage Service
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Cloud Service
std::vector<std::string> execution_hosts = {simulation->getHostnameList()[1]};
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 1000)));
new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "/scratch")));

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;;
Expand All @@ -1481,7 +1477,7 @@ void VirtualizedClusterServiceTest::do_SubmitToVMTest_test() {
ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname)));

// Staging the input_file on the storage service
ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -1570,11 +1566,11 @@ void VirtualizedClusterServiceTest::do_VMStartShutdownStartShutdown_test() {
compute_service = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
"/scratch",
{}));

// Create a Storage Service
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, 10000000000000.0));
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, {"/"}));

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;;
Expand All @@ -1585,7 +1581,7 @@ void VirtualizedClusterServiceTest::do_VMStartShutdownStartShutdown_test() {
// Staging the input_file on the storage service
// Create a File Registry Service
simulation->add(new wrench::FileRegistryService(hostname));
simulation->stageFiles({{input_file->getID(), input_file}}, storage_service);
simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -1619,12 +1615,6 @@ class CloudServiceVMShutdownWhileJobIsRunningTestWMS : public wrench::WMS {
// Create a job manager
auto job_manager = this->createJobManager();

// Create a job
wrench::StandardJob *job = job_manager->createStandardJob({this->test->task1}, {},
{std::make_tuple(this->test->input_file,
this->test->storage_service,
wrench::ComputeService::SCRATCH)},
{}, {});

// Create a VM on the Cloud Service
auto vm_name = cloud_service->createVM(2, 1024);
Expand All @@ -1633,7 +1623,17 @@ class CloudServiceVMShutdownWhileJobIsRunningTestWMS : public wrench::WMS {
wrench::Simulation::sleep(10);
auto vm_cs = cloud_service->startVM(vm_name);

// Submit the job to it
// Create a job
wrench::StandardJob *job = job_manager->createStandardJob(
{this->test->task1}, {},
{std::make_tuple(
this->test->input_file,
wrench::FileLocation::LOCATION(this->test->storage_service),
wrench::FileLocation::LOCATION(vm_cs->getScratch()))},
{}, {});


// Submit the job to the vm
job_manager->submitJob(job, vm_cs);

wrench::Simulation::sleep(10);
Expand Down Expand Up @@ -1698,11 +1698,11 @@ void VirtualizedClusterServiceTest::do_VMShutdownWhileJobIsRunning_test() {
compute_service = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
"/scratch",
{}));

// Create a Storage Service
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, 10000000000000.0));
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, {"/"}));

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;;
Expand All @@ -1713,7 +1713,7 @@ void VirtualizedClusterServiceTest::do_VMShutdownWhileJobIsRunning_test() {
// Staging the input_file on the storage service
// Create a File Registry Service
simulation->add(new wrench::FileRegistryService(hostname));
simulation->stageFiles({{input_file->getID(), input_file}}, storage_service);
simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -1749,12 +1749,6 @@ class CloudServiceVMComputeServiceStopWhileJobIsRunningTestWMS : public wrench::
// Create a job manager
auto job_manager = this->createJobManager();

// Create a job
wrench::StandardJob *job = job_manager->createStandardJob({this->test->task1}, {},
{std::make_tuple(this->test->input_file,
this->test->storage_service,
wrench::ComputeService::SCRATCH)},
{}, {});

// Create a VM on the Cloud Service
auto vm_name = cloud_service->createVM(2, 1024);
Expand All @@ -1763,7 +1757,15 @@ class CloudServiceVMComputeServiceStopWhileJobIsRunningTestWMS : public wrench::
wrench::Simulation::sleep(10);
auto vm_cs = cloud_service->startVM(vm_name);

// Submit the job to it
// Create a job
wrench::StandardJob *job = job_manager->createStandardJob(
{this->test->task1}, {},
{std::make_tuple(this->test->input_file,
wrench::FileLocation::LOCATION(this->test->storage_service),
wrench::FileLocation::LOCATION(vm_cs->getScratch()))},
{}, {});

// Submit the job to the VM
job_manager->submitJob(job, vm_cs);

wrench::Simulation::sleep(10);
Expand Down Expand Up @@ -1831,11 +1833,11 @@ void VirtualizedClusterServiceTest::do_VMComputeServiceStopWhileJobIsRunning_tes
compute_service = simulation->add(
new wrench::CloudComputeService(hostname,
compute_hosts,
100.0,
"/scratch",
{}));

// Create a Storage Service
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, 10000000000000.0));
storage_service = simulation->add(new wrench::SimpleStorageService(hostname, {"/"}));

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;;
Expand All @@ -1846,7 +1848,7 @@ void VirtualizedClusterServiceTest::do_VMComputeServiceStopWhileJobIsRunning_tes
// Staging the input_file on the storage service
// Create a File Registry Service
simulation->add(new wrench::FileRegistryService(hostname));
simulation->stageFiles({{input_file->getID(), input_file}}, storage_service);
simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down
Loading

0 comments on commit d032a57

Please sign in to comment.