generated from ow2-proactive/yamt
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from ow2-proactive/azure-integration
Azure integration
- Loading branch information
Showing
10 changed files
with
276 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<job | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="urn:proactive:jobdescriptor:3.13" xsi:schemaLocation="urn:proactive:jobdescriptor:3.13 http://www.activeeon.com/public_content/schemas/proactive/jobdescriptor/3.13/schedulerjob.xsd" name="Define_NS_Azure" projectName="NebulOuS" priority="normal" onTaskError="continueJobExecution" maxNumberOfExecution="2" > | ||
<variables> | ||
<variable name="NS_name" value="" /> | ||
<variable name="NS_nVMs" value="0" model="PA:Integer" /> | ||
<variable name="azure_username" value="" model="PA:HIDDEN" /> | ||
<variable name="azure_secret" value="" model="PA:HIDDEN" /> | ||
<variable name="security_group" value="" /> | ||
<variable name="sshUsername" value="" /> | ||
<variable name="sshKeyPairName" value="" /> | ||
<variable name="sshPrivateKey" value="" model="PA:HIDDEN" /> | ||
<variable name="subnet" value="" /> | ||
<variable name="image" value="" /> | ||
<variable name="rm_host_name" value="" /> | ||
<variable name="pa_port" value="" /> | ||
</variables> | ||
<description> | ||
<![CDATA[ A workflow that executes Groovy in JVM. ]]> | ||
</description> | ||
<taskFlow> | ||
<task name="defineAzureNodeSource" | ||
|
||
|
||
|
||
|
||
fork="true"> | ||
<description> | ||
<![CDATA[ Define an Azure NodeSource ]]> | ||
</description> | ||
<scriptExecutable> | ||
<script> | ||
<code language="groovy"> | ||
<![CDATA[ | ||
// Connecting to the Scheduler | ||
def retCode = 0; | ||
def nodeSourceName = variables.get("NS_name") | ||
def protocol = (variables.get("pa_port") == "443" || variables.get("pa_port") == "8443" ) ? "https" : "http" | ||
println "[+] Preparation of NodeSoure " + nodeSourceName | ||
print "(1/4) Connecting to the RM ..." | ||
rmapi.connect() | ||
println " ... OK !" | ||
// Getting NS configuration settings | ||
def infrastructureType = "org.ow2.proactive.resourcemanager.nodesource.infrastructure.AzureInfrastructure" | ||
def infrastructureParameters = [variables.get("azure_username"), //username | ||
variables.get("azure_secret"), //secret | ||
variables.get("NS_nVMs"), //N of VMs | ||
"1", //N VMs per node | ||
variables.get("image"), //image | ||
variables.get("sshUsername"), //sshUsername | ||
variables.get("sshKeyPairName"), //sshKeyPair | ||
"", //ram | ||
"", //Ncore | ||
"", //VmType | ||
variables.get("security_group"), //sg | ||
variables.get("subnet"), //subnet | ||
variables.get("rm_host_name"), //host | ||
protocol + "://" + variables.get("rm_host_name") + ":"+ variables.get("pa_port") + "/connector-iaas", //connector-iaas url | ||
protocol + "://" + variables.get("rm_host_name") + ":"+ variables.get("pa_port") + "/rest/node.jar", //node jar url | ||
"-Dproactive.useIPaddress=true", //additionalProperties" | ||
"300000", //timeout | ||
"mkdir -p /tmp/node && cd /tmp/node; if ! type -p jre/bin/java; then wget -nv -N https://s3.amazonaws.com/ci-materials/Latest_jre/jre-8u312b07-linux-x64.tar.gz; tar -xf jre-8u312b07-linux-x64.tar.gz; mv jre1.8.0_312b07/ jre; fi; wget -nv --no-check-certificate %nodeJarUrl% ; nohup jre/bin/java -Xmx600m -jar node.jar -Dproactive.communication.protocol=%protocol% -Dpython.path=%jythonPath% -Dproactive.pamr.router.address=%rmHostname% -D%instanceIdNodeProperty%=%instanceId% -r %rmUrl% -s %nodeSourceName% %nodeNamingOption% -v %credentials% -w %numberOfNodesPerInstance% %additionalProperties% &", | ||
""] | ||
def infrastructureFileParameters = [variables.get("sshPrivateKey")] | ||
def policyType = "org.ow2.proactive.resourcemanager.nodesource.policy.EmptyPolicy" | ||
def poliyParameters = ["ALL","ME"] | ||
def policyFileParameters = [] | ||
def nodesRecoverable = "true" | ||
// Enforcing .... | ||
try { | ||
print "(2/4) Creating NodeSource ..." | ||
rmapi.defineNodeSource(nodeSourceName,infrastructureType,(String[]) infrastructureParameters.toArray(),(String[]) infrastructureFileParameters.toArray(), policyType, (String[]) poliyParameters.toArray(), (String[]) policyFileParameters.toArray(),nodesRecoverable) | ||
println " ... OK !" | ||
print "(3/4) Deploying the NodeSource ..." | ||
rmapi.deployNodeSource(nodeSourceName) | ||
println " ... OK !" | ||
} catch (Exception e) { | ||
println " ... Error: " + e.getMessage(); | ||
retCode = 1; | ||
} finally { | ||
print "(4/4) Logging out ..." | ||
rmapi.disconnect(); | ||
println " ... OK !" | ||
} | ||
return retCode; | ||
]]> | ||
</code> | ||
</script> | ||
</scriptExecutable> | ||
<metadata> | ||
<positionTop> | ||
142.125 | ||
</positionTop> | ||
<positionLeft> | ||
351.5 | ||
</positionLeft> | ||
</metadata> | ||
</task> | ||
</taskFlow> | ||
<metadata> | ||
<visualization> | ||
<![CDATA[ <html> | ||
<head> | ||
<link rel="stylesheet" href="/studio/styles/studio-standalone.css"> | ||
<style> | ||
#workflow-designer { | ||
left:0 !important; | ||
top:0 !important; | ||
width:2864px; | ||
height:3536px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="workflow-visualization-view"><div id="workflow-visualization" style="position:relative;top:-137.1171875px;left:-346.5px"><div class="task _jsPlumb_endpoint_anchor_ ui-draggable" id="jsPlumb_1_1" style="top: 142.125px; left: 351.5px;"><a class="task-name" data-toggle="tooltip" data-placement="right" title="Define an Azure NodeSource"><img src="/studio/images/Groovy.png" width="20px"> <span class="name">defineAzureNodeSource</span></a></div><div class="_jsPlumb_endpoint source-endpoint dependency-source-endpoint connected _jsPlumb_endpoint_anchor_ ui-draggable ui-droppable" style="position: absolute; height: 20px; width: 20px; left: 412px; top: 172px;"><svg style="position:absolute;left:0px;top:0px" width="20" height="20" pointer-events="all" position="absolute" version="1.1" xmlns="http://www.w3.org/1999/xhtml"><circle cx="10" cy="10" r="10" version="1.1" xmlns="http://www.w3.org/1999/xhtml" fill="#666" stroke="none" style=""></circle></svg></div></div></div> | ||
</body> | ||
</html> | ||
]]> | ||
</visualization> | ||
</metadata> | ||
</job> |
Oops, something went wrong.