Kyle McChesney
07/29/2021, 4:58 PMParameter validation failed:
Unknown parameter in input: "null", must be one of: capacityProviderStrategy, cluster, count, enableECSManagedTags, enableExecuteCommand, group, launchType, networkConfiguration, overrides, placementConstraints, placementStrategy, platformVersion, propagateTags, referenceId, startedBy, tags, taskDefinition
This is coming from the boto3 call triggered here: https://github.com/PrefectHQ/prefect/blob/6b59d989dec33aad8c62ea2476fee519c32f5c63/src/prefect/agent/ecs/agent.py#L320
My agent is being started like so (with prefecthq/prefect:0.14.13-python3.8, maybe this is old?):
prefect agent ecs start --run-task-kwargs s3://$bucket/run_task_kwargs.yml -a <https://my-api:4200/graphql>
My run task kwargs yaml has cluster
, launchType
and networkConfiguration
. I also attempted to provide values in the run config via the UI, but it did not seem to change much (added CPU, memory, task and exec role). Any help is much appreciated!Kevin Kho
.yml
, just anonymize sensitive info?Kyle McChesney
07/29/2021, 5:01 PMcluster: test
launchType: FARGATE
networkConfiguration:
awsvpcConfiguration:
subnets:
- subnet-######
- subnet-######
- subnet-######
- subnet-######
securityGroups:
- sg-#######
assignPublicIp: DISABLED
Kevin Kho
yml
is not being passed right. It would error out though.
Could you check the output if you do this?
import yaml
from prefect.utilities.filesystems import read_bytes_from_path
yaml.safe_load(read_bytes_from_path(run_task_kwargs_path))
Kevin Kho
run_task_kwargs_path
is s3://$bucket/run_task_kwargs.yml
Kyle McChesney
07/29/2021, 5:24 PMKevin Kho
Kyle McChesney
07/29/2021, 5:28 PMKevin Kho
Kevin Kho
ECSRun
around run_task_kwargs
?Kyle McChesney
07/29/2021, 5:55 PMKyle McChesney
07/29/2021, 5:55 PMimport math
from prefect import Flow, task, Parameter
from prefect.executors import LocalDaskExecutor
@task
def data(range_amount):
return range(range_amount)
@task
def compute_sqaure_root(item):
return math.sqrt(item)
@task
def sum_roots(items):
return sum(items)
with Flow('ecs_test', executor=LocalDaskExecutor()) as flow:
range_amount = Parameter('range_amount', default=100)
items = data(range_amount)
roots = compute_sqaure_root.map(items)
summed = sum_roots(roots)
Kyle McChesney
07/29/2021, 5:55 PMKevin Kho
ECSRun()
? Could you try flow.run_config = ECSRun()
? Import with from prefect.run_configs.ecs import ECSRun
Kyle McChesney
07/29/2021, 5:59 PMKyle McChesney
07/29/2021, 5:59 PMKevin Kho
run_task_kwargs
is probably null
and getting misinterpreted as a string when converted from JS to Python.Kyle McChesney
07/29/2021, 6:03 PMKevin Kho
Kevin Kho
Kyle McChesney
07/29/2021, 6:18 PMKyle McChesney
07/29/2021, 6:19 PMKyle McChesney
07/29/2021, 6:21 PMKevin Kho
Kevin Kho