Skip to content

Commit 94d640e

Browse files
demartinofrasean-smith
authored andcommitted
Remove MNP support
Signed-off-by: Francesco De Martino <[email protected]>
1 parent 8b56d7e commit 94d640e

File tree

12 files changed

+15
-1547
lines changed

12 files changed

+15
-1547
lines changed

Diff for: cli/awsbatch/awsbhosts.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,11 @@ def main():
228228
log = config_logger(args.log_level)
229229
log.info("Input parameters: %s" % args)
230230
config = AWSBatchCliConfig(log, args.cluster)
231-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
231+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
232232
aws_access_key_id=config.aws_access_key_id,
233233
aws_secret_access_key=config.aws_secret_access_key)
234234

235-
# FIXME remove
236-
if config.endpoint_url:
237-
compute_environment = config.compute_environment_mnp
238-
else:
239-
compute_environment = config.compute_environment
240-
241-
AWSBhostsCommand(log, boto3_factory).run(compute_environments=[compute_environment],
235+
AWSBhostsCommand(log, boto3_factory).run(compute_environments=[config.compute_environment],
242236
instance_ids=args.instance_ids, show_details=args.details)
243237

244238
except KeyboardInterrupt:

Diff for: cli/awsbatch/awsbjobs.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def main():
299299
log = config_logger(args.log_level)
300300
log.info("Input parameters: %s" % args)
301301
config = AWSBatchCliConfig(log=log, cluster=args.cluster)
302-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
302+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
303303
aws_access_key_id=config.aws_access_key_id,
304304
aws_secret_access_key=config.aws_secret_access_key)
305305

@@ -308,14 +308,9 @@ def main():
308308
else:
309309
job_status = ['SUBMITTED', 'PENDING', 'RUNNABLE', 'STARTING', 'RUNNING', 'SUCCEEDED', 'FAILED']
310310

311-
# FIXME remove
312-
if config.endpoint_url:
313-
job_queue = config.job_queue_mnp
314-
else:
315-
job_queue = config.job_queue
316-
317311
AWSBjobsCommand(log, boto3_factory).run(job_status=job_status, expand_arrays=args.expand_arrays,
318-
job_ids=args.job_ids, job_queue=job_queue, show_details=args.details)
312+
job_ids=args.job_ids, job_queue=config.job_queue,
313+
show_details=args.details)
319314

320315
except KeyboardInterrupt:
321316
print("Exiting...")

Diff for: cli/awsbatch/awsbkill.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def main():
108108
log = config_logger(args.log_level)
109109
log.info("Input parameters: %s" % args)
110110
config = AWSBatchCliConfig(log=log, cluster=args.cluster)
111-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
111+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
112112
aws_access_key_id=config.aws_access_key_id,
113113
aws_secret_access_key=config.aws_secret_access_key)
114114
AWSBkillCommand(log, boto3_factory).run(job_ids=args.job_ids)

Diff for: cli/awsbatch/awsbout.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def main():
191191
log = config_logger(args.log_level)
192192
log.info("Input parameters: %s" % args)
193193
config = AWSBatchCliConfig(log=log, cluster=args.cluster)
194-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
194+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
195195
aws_access_key_id=config.aws_access_key_id,
196196
aws_secret_access_key=config.aws_secret_access_key)
197197

Diff for: cli/awsbatch/awsbqueues.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,15 @@ def main():
126126
log = config_logger(args.log_level)
127127
log.info("Input parameters: %s" % args)
128128
config = AWSBatchCliConfig(log=log, cluster=args.cluster)
129-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
129+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
130130
aws_access_key_id=config.aws_access_key_id,
131131
aws_secret_access_key=config.aws_secret_access_key)
132132

133133
if args.job_queues:
134134
job_queues = args.job_queues
135135
show_details = True
136136
else:
137-
# FIXME remove
138-
if config.endpoint_url:
139-
job_queue = config.job_queue_mnp
140-
else:
141-
job_queue = config.job_queue
142-
job_queues = [job_queue]
137+
job_queues = [config.job_queue]
143138
show_details = args.details
144139
AWSBqueuesCommand(log, boto3_factory).run(job_queues=job_queues, show_details=show_details)
145140

Diff for: cli/awsbatch/awsbsub.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ def _get_parser():
6262
parser.add_argument('-t', '--timeout', help='The time duration in seconds (measured from the job attempt\'s '
6363
'startedAt timestamp) after which AWS Batch terminates your jobs '
6464
'if they have not finished. It must be at least 60 seconds', type=int)
65-
# MNP parameter
66-
parser.add_argument('-n', '--nodes', help='The number of nodes to reserve for the job. '
67-
'It enables Multi Node Parallel submission', type=int)
6865
# array parameters
6966
parser.add_argument('-a', '--array-size', help='The size of the array. It can be between 2 and 10,000. '
7067
'If you specify array properties for a job, '
@@ -370,7 +367,7 @@ def main():
370367
log = config_logger(args.log_level)
371368
log.info("Input parameters: %s" % args)
372369
config = AWSBatchCliConfig(log=log, cluster=args.cluster)
373-
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy, endpoint_url=config.endpoint_url,
370+
boto3_factory = Boto3ClientFactory(region=config.region, proxy=config.proxy,
374371
aws_access_key_id=config.aws_access_key_id,
375372
aws_secret_access_key=config.aws_secret_access_key)
376373

@@ -392,20 +389,10 @@ def main():
392389
# parse and validate depends_on parameter
393390
depends_on = _get_depends_on(args)
394391

395-
# select submission (standard vs MNP)
396-
if args.nodes or config.endpoint_url: # FIXME remove config.endpoint from if
397-
job_definition = config.job_definition_mnp
398-
else:
399-
job_definition = config.job_definition
400-
401-
# FIXME remove
402-
if config.endpoint_url:
403-
job_queue = config.job_queue_mnp
404-
else:
405-
job_queue = config.job_queue
392+
job_definition = config.job_definition
406393

407394
AWSBsubCommand(log, boto3_factory).run(job_definition=job_definition, job_name=job_name,
408-
job_queue=job_queue, command=command, nodes=args.nodes,
395+
job_queue=config.job_queue, command=command,
409396
vcpus=args.vcpus, memory=args.memory,
410397
array_size=args.array_size, dependencies=depends_on,
411398
retry_attempts=args.retry_attempts, timeout=args.timeout,

Diff for: cli/awsbatch/common.py

+3-26
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,22 @@ class Boto3ClientFactory(object):
8585
"""
8686
Boto3 configuration object
8787
"""
88-
def __init__(self, region, aws_access_key_id, aws_secret_access_key, proxy='NONE', endpoint_url=None):
88+
def __init__(self, region, aws_access_key_id, aws_secret_access_key, proxy='NONE'):
8989
self.region = region
9090
self.aws_access_key_id = aws_access_key_id
9191
self.aws_secret_access_key = aws_secret_access_key
9292
self.proxy_config = Config()
93-
self.endpoint_url = endpoint_url
9493
if not proxy == 'NONE':
9594
self.proxy_config = Config(proxies={'https': proxy})
9695

9796
def get_client(self, service):
9897
try:
99-
if service == 'batch' and self.endpoint_url is not None:
100-
# FIXME remove this ack used for testing
101-
boto3_service = 'batch-zeta'
102-
boto3_endpoint_url = self.endpoint_url
103-
else:
104-
boto3_service = service
105-
boto3_endpoint_url = None
106-
107-
return boto3.client(boto3_service, region_name=self.region,
108-
endpoint_url=boto3_endpoint_url,
98+
return boto3.client(service, region_name=self.region,
10999
aws_access_key_id=self.aws_access_key_id,
110100
aws_secret_access_key=self.aws_secret_access_key,
111101
config=self.proxy_config)
112102
except ClientError as e:
113-
fail("AWS %s service failed with exception: %s" % (boto3_service, e))
103+
fail("AWS %s service failed with exception: %s" % (service, e))
114104

115105

116106
class AWSBatchCliConfig(object):
@@ -128,7 +118,6 @@ def __init__(self, log, cluster):
128118
self.aws_access_key_id = None
129119
self.aws_secret_access_key = None
130120
self.region = None
131-
self.endpoint_url = None
132121
cfncluster_config_file = os.path.expanduser(os.path.join('~', '.cfncluster', 'config'))
133122
if os.path.isfile(cfncluster_config_file):
134123
self.__init_from_cfncluster_config(cfncluster_config_file, log)
@@ -157,7 +146,6 @@ def __verify_initialization(self, log):
157146
log.debug("compute_environment = %s", self.compute_environment)
158147
log.debug("job_queue = %s", self.job_queue)
159148
log.debug("job_definition = %s", self.job_definition)
160-
# FIXME restore log.debug("job_definition_mnp = %s", self.job_definition_mnp)
161149
log.debug("master_ip = %s", self.master_ip)
162150
log.info(self)
163151
except AttributeError as e:
@@ -213,10 +201,6 @@ def __init_from_config(self, cli_config_file, cluster, log):
213201
self.region = config.get('main', 'region')
214202
except NoOptionError:
215203
pass
216-
try:
217-
self.endpoint_url = config.get('main', 'endpoint_url')
218-
except NoOptionError:
219-
pass
220204

221205
try:
222206
self.stack_name = 'cfncluster-' + cluster_name
@@ -228,7 +212,6 @@ def __init_from_config(self, cli_config_file, cluster, log):
228212
self.compute_environment = config.get(cluster_section, 'compute_environment')
229213
self.job_queue = config.get(cluster_section, 'job_queue')
230214
self.job_definition = config.get(cluster_section, 'job_definition')
231-
self.job_definition_mnp = config.get(cluster_section, 'job_definition_mnp')
232215
self.master_ip = config.get(cluster_section, 'master_ip')
233216

234217
# get proxy
@@ -272,16 +255,10 @@ def __init_from_stack(self, cluster, log):
272255
self.s3_bucket = output_value
273256
elif output_key == 'BatchComputeEnvironmentArn':
274257
self.compute_environment = output_value
275-
elif output_key == 'MNPComputeEnvironmentArn': # FIXME remove
276-
self.compute_environment_mnp = output_value
277258
elif output_key == 'BatchJobQueueArn':
278259
self.job_queue = output_value
279-
elif output_key == 'MNPJobQueueArn': # FIXME remove
280-
self.job_queue_mnp = output_value
281260
elif output_key == 'BatchJobDefinitionArn':
282261
self.job_definition = output_value
283-
elif output_key == 'MNPJobDefinitionArn': # FIXME remove
284-
self.job_definition_mnp = output_value
285262
elif output_key == 'MasterPrivateIP':
286263
self.master_ip = output_value
287264

Diff for: cli/awsbatch/examples/awsbatch-cli.cfg

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ compute_environment = arn:aws:batch:<region>:<account-id>:compute-environment/cf
3333
job_queue = arn:aws:batch:<region>:<account-id>:job-queue/cfncluster-<cluster-name>
3434
# Job Definition ARN used for standard job submission
3535
job_definition = arn:aws:batch:<region>:<account-id>:job-definition/cfncluster-<cluster-name>:1
36-
# Job Definition ARN used for Multi Node Parallel job submission
37-
job_definition_mnp = arn:aws:batch:<region>:<account-id>:job-definition/cfncluster-<cluster-name>-mnp:1
3836
# HTTP(S) proxy server, typically http://x.x.x.x:8080, used for internal boto3 calls
3937
proxy = NONE
4038
# Private Master IP, used internally in the job submission phase.

0 commit comments

Comments
 (0)