Commit 2d9a56f4 authored by Spiros Koulouzis's avatar Spiros Koulouzis

refactor planner

parent a538b5a0
...@@ -35,4 +35,8 @@ ...@@ -35,4 +35,8 @@
/drip-manager/target/ /drip-manager/target/
/drip-manager/nbproject/ /drip-manager/nbproject/
/.idea/ /.idea/
/drip-manager/.idea/ /drip-manager/.idea/
\ No newline at end of file /drip-planner/service/__pycache__/
/drip-planner/planner/__pycache__/
/drip-planner/util/__pycache__/
/drip-planner/test/__pycache__/
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (drip-planner)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/drip-planner.iml" filepath="$PROJECT_DIR$/.idea/drip-planner.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/drip-planner.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/__main__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/planner/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/planner/planner.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/service/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/service/simple_spec_alayzer.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/service/spec_service.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/service/specification_analyzer.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/test/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/test/test_planner.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/util/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/util/tosca_helper.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../drip_planner2/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/src/planner/planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/../drip_planner2/src/planner/planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/src/planner/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/../drip_planner2/src/planner/simple_spec_alayzer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/src/tests/test_planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/../drip_planner2/src/tests/test_planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../jenkins_pipeline" beforeDir="false" afterPath="$PROJECT_DIR$/../jenkins_pipeline" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="ProjectId" id="1TI7vNZs1Z3y1uB6wXCH5F47r0F" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/service" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/service" />
<recent name="$PROJECT_DIR$/util" />
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/planner" />
<recent name="$PROJECT_DIR$/test" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Python tests.Unittests in test_planner.py">
<configuration name="__main__" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="drip-planner" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/__main__.py" />
<option name="PARAMETERS" value="test_local" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="Unittests in test_planner.py" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="drip-planner" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/test" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/test/test_planner.py&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
<list>
<item itemvalue="Python.__main__" />
<item itemvalue="Python tests.Unittests in test_planner.py" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python tests.Unittests in test_planner.py" />
<item itemvalue="Python.__main__" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="" />
<created>1573135985084</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1573135985084</updated>
</task>
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="462ede19-adfe-472b-975e-fefefa973fe0" name="Default Changelist" comment="" /> <list default="true" id="462ede19-adfe-472b-975e-fefefa973fe0" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/../drip-planner/.idea/drip-planner.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/__main__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/planner/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/planner/planner.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/service/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/service/simple_spec_alayzer.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/service/spec_service.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/service/specification_analyzer.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/setup.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/test/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/test/test_planner.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/util/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../drip-planner/util/tosca_helper.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/planner/planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/planner/planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/planner/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/planner/simple_spec_alayzer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/tests/test_planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/test_planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../jenkins_pipeline" beforeDir="false" afterPath="$PROJECT_DIR$/../jenkins_pipeline" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -55,7 +74,7 @@ ...@@ -55,7 +74,7 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Python.rpc_server"> <component name="RunManager" selected="Python.test_planner">
<configuration name="basic_planner" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="basic_planner" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="drip_planner2" /> <module name="drip_planner2" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
...@@ -135,8 +154,8 @@ ...@@ -135,8 +154,8 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Python.rpc_server" />
<item itemvalue="Python.test_planner" /> <item itemvalue="Python.test_planner" />
<item itemvalue="Python.rpc_server" />
<item itemvalue="Python tests.Unittests in tests" /> <item itemvalue="Python tests.Unittests in tests" />
<item itemvalue="Python.basic_planner" /> <item itemvalue="Python.basic_planner" />
</list> </list>
......
...@@ -5,10 +5,10 @@ from toscaparser.topology_template import TopologyTemplate ...@@ -5,10 +5,10 @@ from toscaparser.topology_template import TopologyTemplate
import operator import operator
from planner.simple_spec_alayzer import SimpleAnalyzer from src.planner.simple_spec_alayzer import SimpleAnalyzer
from utils.tosca_helper import * from src.utils.tosca_helper import *
from planner.specification_analyzer import * from src.planner.specification_analyzer import *
from utils import tosca_helper as tosca_util from src.utils import tosca_helper as tosca_util
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
......
...@@ -3,8 +3,8 @@ import copy ...@@ -3,8 +3,8 @@ import copy
from toscaparser.nodetemplate import NodeTemplate from toscaparser.nodetemplate import NodeTemplate
from toscaparser.properties import Property from toscaparser.properties import Property
from utils import tosca_helper as tosca_util from src.utils import tosca_helper as tosca_util
from planner.specification_analyzer import SpecificationAnalyzer from src.planner.specification_analyzer import SpecificationAnalyzer
import networkx as nx import networkx as nx
import logging import logging
......
...@@ -12,9 +12,10 @@ from src.utils import tosca_helper as tosca_util ...@@ -12,9 +12,10 @@ from src.utils import tosca_helper as tosca_util
class MyTestCase(unittest.TestCase): class MyTestCase(unittest.TestCase):
def test_something(self): def test_something(self):
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
tosca_path = "../../../TOSCA/" tosca_path = "../../TOSCA/"
input_tosca_file_path = tosca_path + '/application_example_2_topologies.yaml' input_tosca_file_path = tosca_path + '/application_example_2_topologies.yaml'
dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = os.path.dirname(os.path.realpath(__file__))
...@@ -54,3 +55,7 @@ class MyTestCase(unittest.TestCase): ...@@ -54,3 +55,7 @@ class MyTestCase(unittest.TestCase):
response["parameters"] = [] response["parameters"] = []
print("Output message:" + json.dumps(response)) print("Output message:" + json.dumps(response))
self.assertEqual(True, True) self.assertEqual(True, True)
if __name__ == '__main__':
unittest.main()
...@@ -43,4 +43,5 @@ pipeline { ...@@ -43,4 +43,5 @@ pipeline {
echo 'For example, if the Pipeline was previously failing but is now successful' echo 'For example, if the Pipeline was previously failing but is now successful'
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment