nrdg / cloudknot

A python library to run your existing code on AWS Batch
https://nrdg.github.io/cloudknot/
Other
70 stars 17 forks source link

If length issue with compute environment name should fail immediately #281

Closed bloomdt-uw closed 3 years ago

bloomdt-uw commented 3 years ago

using knot name = 'dhcp-mrtrix-2021-04-23T14-37us-west-1' resulted in following error, only after started to initialize AWS resources


ClientError Traceback (most recent call last)

in ----> 1 knot = ck.Knot( 2 name='dhcp-mrtrix-' + timestamp + region_name, 3 docker_image=dockerImage, 4 pars_policies=('AmazonS3FullAccess',), 5 job_def_vcpus=1, ~/anaconda/envs/pyAFQ/lib/python3.8/site-packages/cloudknot/cloudknot.py in __init__(self, name, pars, pars_policies, docker_image, base_image, func, image_script_path, image_work_dir, image_github_installs, username, repo_name, image_tags, no_image_cache, job_definition_name, job_def_vcpus, memory, retries, compute_environment_name, instance_types, min_vcpus, max_vcpus, desired_vcpus, volume_size, image_id, ec2_key_pair, bid_percentage, job_queue_name, priority, aws_resource_tags) 1610 template_body = fp.read() 1611 -> 1612 response = aws.clients["cloudformation"].create_stack( 1613 StackName=self.name + "-knot", 1614 TemplateBody=template_body, ~/anaconda/envs/pyAFQ/lib/python3.8/site-packages/botocore/client.py in _api_call(self, *args, **kwargs) 314 "%s() only accepts keyword arguments." % py_operation_name) 315 # The "self" in this scope is referring to the BaseClient. --> 316 return self._make_api_call(operation_name, kwargs) 317 318 _api_call.__name__ = str(py_operation_name) ~/anaconda/envs/pyAFQ/lib/python3.8/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params) 633 error_code = parsed_response.get("Error", {}).get("Code") 634 error_class = self.exceptions.from_code(error_code) --> 635 raise error_class(parsed_response, operation_name) 636 else: 637 return parsed_response ClientError: An error occurred (ValidationError) when calling the CreateStack operation: Parameter CeName failed to satisfy constraint: The compute environment name must be between 1 and 64 characters