Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
removed second test instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanluciano committed Apr 9, 2024
1 parent c249659 commit 07c3d77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
4 changes: 2 additions & 2 deletions prefect_aws/workers/ecs_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,8 +1353,8 @@ def _prepare_task_definition(

elif launch_type == "EC2":
# Container level memory and cpu are required when using ec2
container.setdefault("cpu", container_cpu or ECS_DEFAULT_CPU)
container.setdefault("memory", container_memory or ECS_DEFAULT_MEMORY)
container.setdefault("cpu", container_cpu)
container.setdefault("memory", container_memory)

# Ensure set values are cast to integers
container["cpu"] = int(container["cpu"])
Expand Down
17 changes: 0 additions & 17 deletions tests/workers/test_ecs_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,6 @@ def ecs_mocks(
# NOTE: Even when using FARGATE, moto requires container instances to be
# registered. This differs from AWS behavior.
add_ec2_instance_to_ecs_cluster(session, "default")
ec2_client = session.client("ec2")
ec2_resource = session.resource("ec2")

images = ec2_client.describe_images()
image_id = images["Images"][0]["ImageId"]

test_instance = ec2_resource.create_instances(
ImageId=image_id, MinCount=1, MaxCount=1
)[0]

session.client("ecs").register_container_instance(
cluster="default",
instanceIdentityDocument=json.dumps(
generate_instance_identity_document(test_instance)
),
)

yield ecs

Expand All @@ -344,7 +328,6 @@ async def construct_configuration_with_job_template(
print(f"Using variables: {variables.json(indent=2)}")

base_template = ECSWorker.get_default_base_job_template()
print(f"Using base template configuration: {json.dumps(base_template, indent=2)}")
for key in template_overrides:
base_template["job_configuration"][key] = template_overrides[key]

Expand Down

0 comments on commit 07c3d77

Please sign in to comment.