From cc27fc8a06d188c54789a9235c6b362d2e9e4fe5 Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Sun, 9 Jul 2023 22:57:30 -1000 Subject: [PATCH] Implemented file locations for standard jobs --- tools/wrench/wrench-daemon/doc/wrench-openapi.json | 6 +----- .../wrench-daemon/src/SimulationController.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/wrench/wrench-daemon/doc/wrench-openapi.json b/tools/wrench/wrench-daemon/doc/wrench-openapi.json index ece4bc89c8..92062c882a 100755 --- a/tools/wrench/wrench-daemon/doc/wrench-openapi.json +++ b/tools/wrench/wrench-daemon/doc/wrench-openapi.json @@ -408,16 +408,12 @@ } ], "requestBody": { - "description": "Job characteristics.", + "description": "Input file.", "required": true, "content": { "application/json": { "schema": { "properties": { - "task": { - "type": "string", - "description": "The task's ID" - }, "file": { "type": "string", "description": "The file's ID" diff --git a/tools/wrench/wrench-daemon/src/SimulationController.cpp b/tools/wrench/wrench-daemon/src/SimulationController.cpp index 10d2d1ddd7..a26d7ef825 100755 --- a/tools/wrench/wrench-daemon/src/SimulationController.cpp +++ b/tools/wrench/wrench-daemon/src/SimulationController.cpp @@ -626,7 +626,17 @@ namespace wrench { tasks.push_back(this->workflow->getTaskByID(name)); } - auto job = this->job_manager->createStandardJob(tasks); + std::map, std::shared_ptr> file_locations; + for (auto it = data["file_locations"].begin(); it != data["file_locations"].end(); ++it) + { + auto file = this->workflow->getFileByID(it.key()); + std::shared_ptr storage_service; + this->storage_service_registry.lookup(it.value(), storage_service); + file_locations[file] = FileLocation::LOCATION(storage_service, file); + } + + + auto job = this->job_manager->createStandardJob(tasks, file_locations); this->job_registry.insert(job->getName(), job); json answer; answer["job_name"] = job->getName(); @@ -743,7 +753,7 @@ namespace wrench { * @return JSON output */ json SimulationController::addInputFile(json data) { - auto task = this->workflow->getTaskByID(data["task"]); + auto task = this->workflow->getTaskByID(data["tid"]); auto file = this->workflow->getFileByID(data["file"]); task->addInputFile(file); return {};