Daniil Ponizov
09/16/2021, 3:41 PMShaoyi Zhang
09/16/2021, 5:19 PMPREFECT__CLOUD__AGENT__AGENT_ADDRESS
field fo Kubernetes deployment without modifying the yaml file directly? Is there a command line argument that I can use? I was suspecting --agent-address
, but that’s not available.
- name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
value: http://:8080
Below is the command I’m testing
prefect agent kubernetes install --backend cloud --api "<https://api.prefect.io>" --namespace xxxxx --tenant-id xxxxx --service-account-name xxxx --key xxxx --rbac | kubectl apply --namespace=xxxxx -f -
Andy Dyer
09/16/2021, 5:27 PMKevin Weiler
09/16/2021, 5:40 PMKathryn Klarich
09/16/2021, 9:33 PMBen Muller
09/17/2021, 12:26 AMan error occurred (ClientException) when calling the RegisterTaskDefinition operation: Too many concurrent attempts to create a new revision of the specified family
I have followed the instructions here, but have had no change in the behaviour. We run about 2500 flows every 24 hours and they are generally short running ~60 seconds and run every 15 or so minutes.
I use the aws cdk and this is how I have injected the variables into my fargate ecs agent.
fargate_task_definition.add_container(
id="prefect-fargate-agent-container",
container_name="prefect-fargate-agent-container",
image=ecs.ContainerImage.from_ecr_repository(
prefect_agent_image_repo, "latest"
),
cpu=256,
memory_limit_mib=256,
logging=ecs.AwsLogDriver(stream_prefix="prefect-fargate-agent-container"),
environment={
"AWS_DEFAULT_REGION": "ap-southeast-2",
"LAUNCH_TYPE": "FARGATE",
"AWS_RETRY_MODE": "adaptive",
"AWS_MAX_ATTEMPTS": "100",
"TASK_ROLE_ARN": task_role.role_arn,
"LABEL": "prefect-agent-fargate",
"NAME": "prefect-fargate-agent",
},
secrets={
"PREFECT__CLOUD__AGENT__AUTH_TOKEN": ecs.Secret.from_ssm_parameter(
prefect_cloud_agent_auth_token
)
},
)
Is there anyone who might be able to help me fix this issue, its really hurting us at the moment.
CheersAndreas Tsangarides
09/17/2021, 7:27 AMif __name__ == '__main__':
# run/register flow
works fine. But if you have modules python does not like it. I was hoping for a structure like the screenshot attached below. For now, I import the flow I am working on the main,py
file and that's the one I use to register my flow and test locally (with docker-compose, local agent and the UI)Lucas Beck
09/17/2021, 8:48 AM@task
decorator? I am sub classing Task
and would like to name it based on the inputs given to run
Jacob Blanco
09/17/2021, 8:51 AMDaniil Ponizov
09/17/2021, 9:37 AMhaf
09/17/2021, 12:38 PMsnapshotting
?Benjamin Holzknecht
09/17/2021, 1:10 PMPedro Machado
09/17/2021, 1:15 PMfrom prefect import Flow, Parameter, task, unmapped
produces
"Flow" is not exported from module "prefect"
Import from "prefect.core" instead Pylance(reportPrivateImportUsage)
"Parameter" is not exported from module "prefect"
Import from "prefect.core" instead Pylance(reportPrivateImportUsage)
"task" is not exported from module "prefect"
Import from "prefect.utilities.tasks" instead Pylance(reportPrivateImportUsage)
is not exported from module "prefect"
Import from "prefect.utilities.edges" instead Pylance(reportPrivateImportUsage)
Also, I am getting pylance errors when passing Parameters to tasks that expect str
arguments. I don't believe this was happening before.
Do you know if something changed recently in pylance or in how we are supposed to import modules? I am using prefect 0.15.4 Thanks!Constantino Schillebeeckx
09/17/2021, 3:40 PMget_key_value
or if there's an ENV I can alternatively set.Jacob Goldberg
09/17/2021, 4:49 PMfalse
. How can i get it to execute in both cases where the parameter is true
or false
? Sample code in threadJason Prado
09/17/2021, 5:27 PMKubernetesRun
? The name of the image or ideally its hash?Jason Prado
09/17/2021, 6:32 PMKubernetesAgent
(code here) uses the environment variables used in the k8s deployment, particularly IMAGE_PULL_POLICY
, to build the podspec for a flow run. It looks like if a flow specifies run_config=KubernetesRun(…)
at all, then IMAGE_PULL_POLICY
from the deployment env is ignored? Is that right?Kevin Weiler
09/17/2021, 8:58 PMclass SetTrDate(Task):
def run(self, tr_date: str):
prefect.context.tr_date = tr_date or get_last_tr_date()
and then I read it in subsequent tasks with :
prefect.context.get('tr_date')
The subsequent tasks seem to think that it’s set to None
Should this work?Daniel Saxton
09/18/2021, 3:43 PMIntervalSchedule
if the workflow is raising an exception (so we'd like to simply cancel the workflow as soon an error occurs)?Jacolon Walker
09/19/2021, 4:55 AMNadav Nuni
09/19/2021, 9:25 AMtask is already running
(for a KubernetesRun)? and then Finished task run for task with final state: 'Running'
…. (other than that, it seems like the task doesn’t really run.Nadav Nuni
09/19/2021, 9:28 AMWilliam Burdett
09/19/2021, 3:18 PMFile "/usr/local/lib/python3.9/site-packages/marshmallow/fields.py", line 1410, in _serialize
return int(value.total_seconds() / base_unit.total_seconds())
AttributeError: 'int' object has no attribute 'total_seconds'
In the comments I have the full stack tracehaf
09/20/2021, 8:30 AMAbhishek
09/20/2021, 11:06 AMprefect agent ecs start --key $KEY --task-role-arn $TASK_ARN --log-level INFO --label s3_sync --name farget-dev --execution-role-arn $EXEC_ROLE_ARN
and its giving me an error:
ValueError: Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs`
I am created a ecs cluster (using default). I used following command to use create cluster:
aws ecs create-cluster
which creates a default cluster.
Can anyone point out if i am missing anything?Abhishek
09/20/2021, 11:07 AMThomas Fredriksen
09/20/2021, 12:29 PMClient.get_flow_run_info
-function seems to be one way of achieving this, but it may not scale as number of runs for a flow grows large.Gareth Dwyer
09/20/2021, 12:55 PMAnatoly Alekseev
09/20/2021, 2:16 PMGarcía Gimenez Ignacio - 6to 2da
09/20/2021, 2:39 PM