Skip to content

Commit 7bdcb8e

Browse files
committed
Remove heart beat related part from framework and setup script
1 parent 952fc17 commit 7bdcb8e

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

hpcframework.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def run(self):
3939
except KeyboardInterrupt:
4040
print('Stop requested by user, stopping framework....')
4141

42-
def __init__(self, script_path, setup_path, headnode, ssl_thumbprint, client_cert, framework_uri, listen_port,
43-
node_group=""):
42+
def __init__(self, script_path, setup_path, headnode, ssl_thumbprint, client_cert, node_group=""):
4443
logging.basicConfig()
4544
self.logger = logging_aux.init_logger_aux("hpcframework", "hpcframework.log")
4645
# signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -50,8 +49,6 @@ def __init__(self, script_path, setup_path, headnode, ssl_thumbprint, client_cer
5049
self.setup_path = setup_path
5150
self.headnode = headnode
5251
self.ssl_thumbprint = ssl_thumbprint
53-
self.framework_uri = framework_uri
54-
self.listen_port = listen_port
5552
self.node_group = node_group
5653
self.hpc_client = HpcRestClient(client_cert)
5754
self.heartbeat_table = hpc_cluster_manager.HpcClusterManager(self.hpc_client, node_group=self.node_group)
@@ -93,7 +90,6 @@ def shutdown(self):
9390
self.driver.tearDown()
9491
self.mesos_client.stop = True
9592
self.stop = True
96-
self.heartbeat_server.stop()
9793

9894
def subscribed(self, driver):
9995
self.logger.warn('SUBSCRIBED')
@@ -187,7 +183,6 @@ def accept_offer(self, offer):
187183
'command': {'value':
188184
'powershell -File ' + self.script_path + " -setupPath " + self.setup_path +
189185
" -headnode " + self.headnode + " -sslthumbprint " + self.ssl_thumbprint +
190-
" -frameworkUri " + self.framework_uri + " -port " + str(self.listen_port) +
191186
" > setupscript.log"}
192187
}
193188
self.logger.debug("Sending command:\n{}".format(task['command']['value']))
@@ -213,16 +208,13 @@ def _kill_task_by_hostname(self, hostname):
213208
parser = argparse.ArgumentParser(description="HPC Pack Mesos framework")
214209
parser.add_argument("-g", "--node_group", default="",
215210
help="The node group in which we need to perform grow-shrink.")
216-
parser.add_argument("-p", "--listen_port", default=8088, type=int,
217-
help="The port to which Mesos slave heart beat will send back")
218211
parser.add_argument("script_path", help="Path of HPC Pack Mesos slave setup script (e.g. setupscript.ps1)")
219212
parser.add_argument("setup_path", help="Path of HPC Pack setup executable (e.g. setup.exe)")
220213
parser.add_argument("headnode", help="Hostname of HPC Pack cluster head node")
221214
parser.add_argument("ssl_thumbprint",
222215
help="Thumbprint of certificate which will be used in installation and communication with HPC "
223216
"Pack cluster")
224217
parser.add_argument("client_cert", help=".pem file of client cert used for HPC Management REST API authentication")
225-
parser.add_argument("heartbeat_uri", help="Base URI of heart beat server of HPC Pack Mesos framework")
226218
args = parser.parse_args()
227219

228220
print "Input arguments:"
@@ -231,11 +223,9 @@ def _kill_task_by_hostname(self, hostname):
231223
print "headnode: " + args.headnode
232224
print "ssl_thumbprint: " + args.ssl_thumbprint
233225
print "client_cert: " + args.client_cert
234-
print "heartbeat_uri: " + args.heartbeat_uri
235-
print "listen_port: " + str(args.listen_port)
236226
if args.node_group != "":
237227
print "node_group: " + args.node_group
238228

239229
hpcpack_framework = HpcpackFramwork(args.script_path, args.setup_path, args.headnode, args.ssl_thumbprint,
240-
args.client_cert, args.heartbeat_uri, args.listen_port, args.node_group)
230+
args.client_cert, args.node_group)
241231
hpcpack_framework.start()

hpcframework_unittest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_mock_mesos_offer(cpus, max_cores, is_windows, hostname):
5656

5757
class HpcFrameworkUnitTest(unittest.TestCase):
5858
def setUp(self):
59-
self.hpcpackFramework = hpcframework.HpcpackFramwork("", "", "", "", "", "", 0, "")
59+
self.hpcpackFramework = hpcframework.HpcpackFramwork("", "", "", "", "", "")
6060

6161
@patch('hpcframework.HpcpackFramwork.decline_offer')
6262
@patch('hpcframework.HpcpackFramwork.accept_offer')

setupscript.ps1

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param ([string]$setupPath = "C:\HPCPack2016\setup.exe", [string]$headnode = "", [string]$sslthumbprint = "", [string]$frameworkUri = "localhost", [string]$port = "8088")
1+
param ([string]$setupPath = "C:\HPCPack2016\setup.exe", [string]$headnode = "", [string]$sslthumbprint = "")
22

33
$createdMutex = ""
44
$mutex = New-Object -TypeName system.threading.mutex($true, "Global\HpcMesos", [ref]$CreatedMutex)
@@ -19,7 +19,6 @@ schtasks /run /tn mesoshpcdaemon
1919

2020
$setupPath
2121
$setupProc = Start-Process $setupPath -ArgumentList "-unattend -computenode:$headnode -sslthumbprint:$sslthumbprint" -PassThru
22-
#$setupProc = Start-Process "C:\HPCPack2016\private.20180308.251b491.release.debug\release.debug\setup.exe" -ArgumentList "-unattend -computenode:mesoswinagent -sslthumbprint:0386B1198B956BBAAA4154153B6CA1F44B6D1016" -PassThru
2322
$setupProc.WaitForExit()
2423

2524
Write-Output "Set CCP_ env vars and registry"
@@ -53,10 +52,6 @@ sc.exe start HpcNodeManager
5352
sc.exe start HpcSoaDiagMon
5453
sc.exe start HpcBroker
5554

56-
$heartBeatParams = @{ "hostname" = hostname } | ConvertTo-Json
57-
$url = "http://" + $frameworkUri + ":" + $port
58-
$url
59-
6055
while ($true)
6156
{
6257
try
@@ -67,9 +62,6 @@ while ($true)
6762
Write-Output "Daemon script not found. Restart."
6863
schtasks /run /tn mesoshpcdaemon
6964
}
70-
71-
Write-Output "Send HeartBeat to" $url
72-
Invoke-WebRequest -Method Post $url -Body $heartBeatParams
7365
}
7466
catch
7567
{

0 commit comments

Comments
 (0)