ale
10/06/2020, 4:53 PMChris White
ale
10/06/2020, 4:54 PMFailed to load and execute Flow's environment: ValueError('The given taskDefinition does not match the existing
taskDefinition 00-orchestrator.nDetail:
containerDefinition.0.environment ->
Given:
[
{'name': 'PREFECT__CLOUD__GRAPHQL', 'value': '<https://apollo-prefect-server.srv-stage.xxx.xyz/graphql/graphql>'},
{'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'},
{'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'},
{'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'},
{'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'}, {'name': 'PREFECT__LOGGING__EXTRA_LOGGERS', 'value': '[]'}
],
Expected:
[
{'name': 'PREFECT__CLOUD__AGENT__LABELS', 'value': '[]'},
{'name': 'PREFECT__LOGGING__LEVEL', 'value': 'INFO'},
{'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'},
{'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'},
{'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'},
{'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'},
{'name': 'PREFECT__CLOUD__API', 'value': '<https://apollo-prefect-server.srv-stage.xxx.xyz/graphql>'}
]
containerDefinition.0.name ->
Given: flow-container,
Expected: flow
containerDefinition.0.command ->
Given: ['/bin/sh', '-c', "python -c 'import prefect; prefect.environments.execution.load_and_run_flow()'"],
Expected: ['/bin/sh', '-c', 'prefect execute flow-run']
taskRoleArn ->
Given: arn:aws:iam::xxxxxxxxxxxx:role/stage-prefect-flows-00-orchestrator-rTaskRole-1JJ3YRSUBDEUY,
Expected: arn:aws:iam::xxxxxxxxxxxx:role/stage-safelake-etl-rAgentTaskRole-1JTX5S73405MQ
executionRoleArn ->
Given: arn:aws:iam::xxxxxxxxxxxx:role/stage-prefect-flows-00-orchestrator-rExecutionRole-CLWR2BUOW8IW,
Expected: arn:aws:iam::xxxxxxxxxxxx:role/stage-safelake-etl-rExecutionRole-1QPZMUQ6CUP5X
memory ->
Given: 1024,
Expected: 512
nnIf the given configuration is desired, deregister the existingntaskDefinition and re-run the flow. Alternatively, you cannchange the family/taskDefinition name in the FargateTaskEnvironmentnfor this flow.')
Spencer
10/06/2020, 5:09 PMale
10/06/2020, 5:15 PMSpencer
10/06/2020, 5:15 PMale
10/06/2020, 5:19 PMSpencer
10/06/2020, 5:20 PM00-orchestrator
? Perhaps it's in a different region?ale
10/06/2020, 5:22 PMenvironment = FargateTaskEnvironment(
cpu="256",
memory="1024",
family=ETL_FLOW_NAME,
taskDefinition=ETL_FLOW_NAME,
taskRoleArn=ETL_TASK_ROLE_ARN,
executionRoleArn=ETL_EXECUTION_ROLE_ARN,
requiresCompatibilities=["FARGATE"],
containerDefinitions=[
{
"name": "flow",
"image": ETL_IMAGE_NAME,
"command": [
"/bin/sh",
"-c",
"prefect execute flow-run"
],
"environment": [],
"essential": True,
}
]
)
Spencer
10/06/2020, 5:26 PMETL_FLOW_NAME
? That is the name of the pre-existing taskDefinitionale
10/06/2020, 5:27 PM00-orchestrator
Spencer
10/06/2020, 5:27 PMale
10/06/2020, 5:31 PMSpencer
10/06/2020, 5:31 PMfamily
for your Agent's configuration, as you have for the FargateTaskEnvironment
? Which would cause this issueale
10/06/2020, 5:35 PMfamily
Spencer
10/06/2020, 5:43 PMale
10/06/2020, 5:45 PMSpencer
10/06/2020, 5:49 PM00-orchestrator
? Just change that to something else like prefect-launch
or something 🤷♂️ale
10/06/2020, 5:51 PMFailed to load and execute Flow's environment: ValueError("The given taskDefinition does not match the existing taskDefinition 01-process-event-flow.\nDetail: \n\
tcontainerDefinition.0.environment ->
Given: [
{'name': 'PREFECT__CLOUD__GRAPHQL', 'value': '<https://apollo-prefect-server.srv-stage.cloudacademy.xyz/graphql/graphql>'},
{'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'},
{'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'},
{'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'},
{'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'},
{'name': 'PREFECT__LOGGING__EXTRA_LOGGERS', 'value': '[]'}
],
Expected: [
{'name': 'PREFECT__CLOUD__GRAPHQL', 'value': '<https://apollo-prefect-server.srv-stage.cloudacademy.xyz/graphql/graphql>'}
{'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'},
{'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'},
{'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'},
{'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'},
{'name': 'PREFECT__LOGGING__EXTRA_LOGGERS', 'value': '[]'},
]
\n\nIf the given configuration is desired, deregister the existing\ntaskDefinition and re-run the flow. Alternatively, you can\nchange the family/taskDefinition name in the FargateTaskEnvironment\nfor this flow.")
But I don’t see differences between Given and Expected 😅Spencer
10/07/2020, 12:17 PMGiven
, then it's probably a slight oversight in the validation logic.ale
10/07/2020, 12:37 PMFailed to load and execute Flow's environment: ValueError("The given taskDefinition does not match the existing taskDefinition 01-process-event-flow.\nDetail: \n\tcontainerDefinition.0.environment -> Given: [{'name': 'PREFECT__CLOUD__GRAPHQL', 'value': '<https://apollo-prefect-server.srv-stage.cloudacademy.xyz/graphql/graphql>'}, {'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'}, {'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'}, {'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'}, {'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'}, {'name': 'PREFECT__LOGGING__EXTRA_LOGGERS', 'value': '[]'}], Expected: [{'name': 'PREFECT__CLOUD__USE_LOCAL_SECRETS', 'value': 'false'}, {'name': 'PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudFlowRunner'}, {'name': 'PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS', 'value': 'prefect.engine.cloud.CloudTaskRunner'}, {'name': 'PREFECT__LOGGING__LOG_TO_CLOUD', 'value': 'true'}, {'name': 'PREFECT__LOGGING__EXTRA_LOGGERS', 'value': '[]'}, {'name': 'PREFECT__CLOUD__GRAPHQL', 'value': '<https://apollo-prefect-server.srv-stage.cloudacademy.xyz/graphql/graphql'}>]\n\nIf the given configuration is desired, deregister the existing\ntaskDefinition and re-run the flow. Alternatively, you can\nchange the family/taskDefinition name in the FargateTaskEnvironment\nfor this flow.")
Given
.
The problem seems to be the validation between the elements in environment
which are in different order.
@Spencer does this make sense to you?Spencer
10/07/2020, 1:27 PMgiven=sorted(value) if key == "environment" else value,
expected=sorted(existing_container_definition.get(key)) if key == "environment" else value,
ale
10/07/2020, 1:35 PMenvironment
Spencer
10/07/2020, 1:38 PMale
10/07/2020, 1:40 PMSpencer
10/07/2020, 1:59 PMale
10/07/2020, 2:41 PMSpencer
10/16/2020, 1:25 AMale
10/16/2020, 8:46 AMMaikel Penz
11/03/2020, 7:59 AMsorted
to the givenContainerDefinitions
and expectedContainerDefinitions
variables but the error log prints them out of order (same as the original behaviour @ale raised)